Presentation is loading. Please wait.

Presentation is loading. Please wait.

What is your age in binary? I am 12. 12 is a decimal number Use this table to convert a decimal number into a binary number. To make 12 I need to add 8.

Similar presentations


Presentation on theme: "What is your age in binary? I am 12. 12 is a decimal number Use this table to convert a decimal number into a binary number. To make 12 I need to add 8."— Presentation transcript:

1 What is your age in binary? I am 12. 12 is a decimal number Use this table to convert a decimal number into a binary number. To make 12 I need to add 8 and 4. Put a 1 under these numbers. Put a 0 under the numbers that are not needed 8421 In binary I am 1100 Can you work out your own age in binary? 1 1 0 0

2 Can you make your micro:bit count up to 7 in binary? Gnd3V 210 Show the number in decimal on here. Press one of these to make it count up from 0 to 7 1 2 4 Write the number in binary on the pins

3 If Button is pressed: Increment variable “decimal” by 1 Output Decimal Assign variable “binary” to same value as “decimal” if “binary” >= 4 Make pin0 High Subtract 4 from “binary” else Make pin0 Low if “binary” >= 2 Make pin1 High Subtract 2 from “binary” else Make pin1 Low if “binary” = 1 Make pin2 High else Make pin2 Low

4 https://www.microbit.co.uk/dlrjhk

5 Can you make your micro:bit talk to a Raspberry Pi over the GPIO pins?

6 Make some GPIO connector wires You will need Male to Female jumpers Paperclips Tin foil Sticky Tape

7 Put the paperclip, tin foil and male end of the jumper together. Make sure the two loops of the paperclip are pointing outwards.

8 Wrap it all up tightly with the tinfoil.

9 Wrap the tinfoil up with sticky tape. Make sure you leave the paperclip clear.

10 Connect the wires to Gnd, pin0, pin1, pin2. Use a bit more sticky tape to secure them in place. Connect the other ends of the jumpers to the Raspberry Pi GPIO pins. Micro:bit gnd pin Micro:bit pin0 Micro:bit pin1 Micro:bit pin2

11 Can you program Scratch so that the cat says in decimal the binary number sent from the micro:bit?

12 Can you give the raspberry pi robot more senses using the micro:bit? How can you get all that data across those 3 wires? DISCUSS Forwards Backwards Left Right Temperature Light Level Compass Heading Buttons pushed Tilt Shake


Download ppt "What is your age in binary? I am 12. 12 is a decimal number Use this table to convert a decimal number into a binary number. To make 12 I need to add 8."

Similar presentations


Ads by Google