background image

Hover:bit

Coding the micro:bit hovercraft

makekit.no

Summary of Contents for hover:bit

Page 1: ...Hover bit Coding the micro bit hovercraft makekit no...

Page 2: ...rg hardware 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 Antenna 2 4 gHz Reset button USB...

Page 3: ...3 ART Three values that controls the hover bit The Rule...

Page 4: ...Binary 0 1 Throttle speed Percent 0 50 100 Roll steering Degrees 45 0 45 Arm starts and stops motors Roll controls the rudder and stearing Throttle control the speed The values are being transmitter f...

Page 5: ...Let s code...

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 rst...

Page 7: ...here On start Code that will run once at startup Code that will repeat forever Name your project Download to micro bit Save a backup Block mode Javascript mode Share your code Main menu Settings Undo...

Page 8: ...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: ...e 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 s...

Page 10: ...es 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 bet...

Page 11: ...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 but...

Page 12: ...12 This is the code so far...

Page 13: ...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...

Page 14: ...Throttle values as they change Before we plot we use clear screen to prevent the screen to get lled with pixels Show arming Find the forever block Insert a clear screen block under the roll block Use...

Page 15: ...dle right Show Throttle Continue with the forever block Insert a plot block In the y section insert a map block In the map block insert the Throttle variable then 0 100 4 0 This will take a number bet...

Page 16: ...16 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: ...ke 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 Press the A B button to make the arming light to...

Page 18: ...eparate numbers with a little name tag on them so the receiver can tell them apart Send the values over radio Arm Roll Throttle At the bottom of the Forever loop Use the radio send value 0 block Make...

Page 19: ...19 Summary This is the full code...

Page 20: ...ears as a drive 3 Press Download and copy the le to the MICROBIT drive 4 Watch the orange light on the back and make sure it ashes when code is downloaded Download the code Read more about connecting...

Page 21: ...the hovercraft code called Code for hover craft 3 Open the le in the editor Click import and select the le 4 Make sure you have the right radio group to match your transmitter 5 Download the code as s...

Page 22: ...creen the radio channel need to be the same 3 Tilt the remote sideways to verify that the hover bits rudder is moving 4 Press A B to start engines 5 Increase speed with B button 6 Decrease speed with...

Page 23: ...23 Remember Always turn o transmitter and receiver after use There is no auto power o The skull icon means low battery on hovercraft Please recharge the battery Framover Off switch...

Page 24: ...www makekit no henning makekit no makekit gomakekit also twitter Contact Get fast response at our facebook group www facebook com groups gohoverbit...

Reviews: