Author: Ivo Georgiev, PhD
Last updated: 2020-02-14
Code: 333fe0348d8c8a00b82d3e4d9eab4a63a7a5dace
This is an optional assignment for the Spring 2020 installment of the CPE 1040 - Intro to Computer Engineering course at MSU Denver.
This assignment explores wireless and wired I/O communication features of the micro:bit.
-
Use the micro:bit radio functions to communicate different data types between 2 micro:bits:
- An integer.
- A floating-point number.
- A boolean.
- A single character.
- A string.
- (Challenge) An object of a class. Hint: Objects are implemented as key-value maps in TypeScript.
-
(Challenge) How would you transfer a function across the radio transmission channel that the micro:bit affords?
-
Briefly explain your code in the experiments section of this README.
-
Record a video that shows the communication, upload to Imgur, and link in the demo video section of this README.
-
(Challenge) Use the micro:bit GPIO pin functions to communicate different data types between 2 micro:bits (_Hint: You might want to consider creating your own protocol and an API like the
sendValue()
andonReceivedValue()
.):- An integer.
- A floating-point number.
- A boolean.
- A single character.
- A string.
- An object of a class.
-
Briefly explain your code in the experiments section of this README.
-
Record a video that shows the communication, upload to Imgur, and link in the demo video section of this README.
-
Measure the time it takes for the round-trip communication, using only radio, of a:
- Number.
- String. How do you signal the end of the string? How does the length of the string affect the time?
-
Repeat the experiment from (1), now using only pins.
-
Repeat the experiment from (1), now using radio in one direction, and pins in the reverse direction.
-
Briefly explain your code in the experiments section of this README.
-
Record a video that shows the communication, upload to Imgur, and link in the demo video section of this README.
-
Create a MM:SS binary-coded decimal clock to display on the LED matrix of the micro:bit. Can you make it run at the correct speed?
-
Once you are done with (1), create a clock-sync procedure between the 2 micro:bits. Note that the second micro:bit should only receive time and time corrections from the first one. Can you get the two micro:bits to run in sync?
-
Explain your code in the experiments section of this README.
-
Record a video that shows the communication, upload to Imgur, and link in the demo video section of this README.
-
A list of some more advanced projects.
-
The projects at the awesome micro:bit list.
-
micro:bit technical documentation.
-
Github Tutorial for Beginners (webpage).
-
Github Basics for Mac and Windows (video).
-
git & Github Crash Course for Beginners (video).
-
Introduction to Github for Beginners (video).
-
About
git
(webpage). -
git
documentation (webpage, book, videos, reference manual).
-
Technically, the language which is used side-by-side with Blocks in the Makecode ronment is a subset of TypeScript, which itself is a superset of JavaScript (technically, ECMAScript), with some JS features not implemented in Makecode.
-
The limited JavaScript mini-tutorial in Makecode.
-
Official TypeScript documentation:
- TypeScript in 5 min tutorial. Note: You will need to download and install an integrated development environment (IDE). The two that I recommend are Visual Studio Code from Microsoft and WebStorm from JetBrains.
- The full documentation and reference is under Handbook. Bear in mind that you are drinking from the hose. Don't be surprised if not everything is presented in a strictly incremental manner.
-
In-browser TypeScript playground. Note that micro:bit specific code will not run, but you can still play. Start making the distinction between a generic multi-purpose programming language (TypeScript) and functionality (packages, libraries, objects, etc.) that is specific to a particular device (micro:bit), though written in the same programming language.
-
A pretty good and very palatable JS tutorial with in-browser coding, by Codecademy.
-
Extensive and detailed JS tutorial, with some advanced material thrown in. I like this one!
-
The most authoritative JS resource on the Web, including tutorials and reference, by Mozilla.
TODO: Describe your communications code, experiements, and comms time-measurements here.
TODO: Add your video descriptions and URLs here. The videos should clearly show the transmitted values at the origin and destination.