Page 1
Hover:bit Coding the micro:bit hovercraft makekit.no...
Page 2
Reset button Meet the micro:bit Antenna Battery (3V) 2,4 gHz Screen (5x5 pixels) “Haircut” Button A Button B Sensors “Gold teeth” Front Back micro:bit is a small computer with prosessor, sensors, display and radio. It has connection pins for external components like LEDs, speakers or various sensors.
Page 3
Rule Three values that controls the hover:bit...
Page 4
Controls Arm starts and stops motors. Roll controls the rudder and stearing Throttle control the speed. The values are being transmitter from remote control to the receiver (hovercraft) arm, roll, throttle These 3 values control the hovercraft: Maximum Variable: Type Minimum Neutral Arm (start/stop)
Page 6
Start at makecode.microbit.org Chrome is recommended for better connection with the micro:bit Select “New project”. PS. If you’re new to micro:bit you should try one of the tutorials above first.
Page 7
The editor Javascript Block mode Main menu Share your code mode Settings Code that will repeat forever On start: Simulator: Code that will run once at Test your code here startup Blocks Save a backup Undo zoom Download to micro:bit Name your project...
Page 8
Name your project Start by giving your project a name like “Sender group x”. This is your unique radio channel. If you are alone you can use channel 7 Sender group 7...
Page 9
Radio 1.Make a variable called radioChannel 2.Set the radioChannel to 7 (or a number between 0 and 255). This number must also be used on the hovercraft later 3.Use Show Number (in the forever loop) to å verify that Arm is changing correctly 4.Use the “radio set group”...
Page 10
arm, roll, throttle 1.Make 3 variables called arm, roll and throttle 2.Use the button functions so button A makes throttle 10 (%) less, and button B makes it 10 more. Use “change”, not “set” 3.Use the buttons A + B (a combination) to change the Arm between 0 and 1 everytime A + B is pressed...
Page 11
arm, roll, throttle 1.Put a Show Number (in the forever loop) 2.Use the simulator to test the A+B function (the number will switch between 0 and 1 and back) 3.Delete the same show number block when you have tested it. (use delete button or right click - delete) Simuator...
Page 13
Roll and rudder We want to control the hovercraft´s steering by using the orientation sensor on the micro:bit. This is called roll. This will control the rudder on the hovercraft. Task: In the forever block, set the roll variable to the rotation roll. The block is called “rotation pitch”. Drag it out and change it to “roll”...
Page 14
The display: Arm In the beginning of our code, our radio channel will be shown. We want to use the display to also show our Arm, Roll and Throttle values as they change. Before we plot, we use clear screen to prevent the screen to get filled with pixels. Show arming Find the forever-block.
Page 15
The display: Roll and Throttle We also want to show roll and throttle in the display. Use the blocks below to convert roll and throttle into values that can be plotted on the screen. We want the throttle pixel to move upwards, starting at coordinate 0,4, then climb towards 0,0 We want the roll pixel to slide across the screen, from 0,2 (middle left) to 4,2 (middle right) Show Throttle Continue with the forever-block.
Emergency stop Make this little code to create a quick and effective way to stop your hover:bit. All you need to do is to shake your controller and the motor will stop. Shake to stop!
Page 17
Test it! Use the simulator (left side of make:code) to test your code. • Move the mouse cursor sidewys over the micro:bit. Make sure the dot moves along your mouse arrow. (Green span) • Press B button numerous times. Verify that the throttle is climbing upwards as in the blue span •...
Page 18
Send the values over radio To make our remote control work wirelessly, we need to use the radio to transmit our ART-values. They will be sent as separate numbers, with a little name tag on them so the receiver can tell them apart. At the bottom of the Forever-loop: •...
Page 20
3. Press “Download” and copy the file to the MICROBIT drive. 4. Watch the orange light on the back and make sure it flashes when code is downloaded Read more about connecting the micro:bit See the micro:bit introduction at makekit.no/...
Page 21
The receiver code 1. Go to makekit.no/docs 2. Download the hovercraft code called “Code for hover:craft” 3. Open the file in the editor. Click “import” and select the file 4. Make sure you have the right radio group to match your transmitter 5.
Page 22
5. Increase speed with B button 6. Decrease speed with A button 7. Stop with A+B again or shake to stop quickly. 8. Have fun drifting your hover:bit! It can be used indoor and outdoor on dry clean surfaces like asphalt.
Page 23
Remember: Always turn off transmitter and receiver after use. There is no auto power off. The skull icon means low battery on hovercraft. Please recharge the battery. Framover Off switch...
Page 24
Contact: www.makekit.no henning@makekit.no makekit gomakekit (also twitter) Get fast response at our facebook group: www.facebook.com/groups/gohoverbit/...
Need help?
Do you have a question about the Hover:bit and is the answer not in the manual?
Questions and answers