Teaching Chloe C (and maybe C++) / Mbed 2 deprecated Exercise4

Dependencies:   mbed

Fork of Exercise4 by Andrew Brown

Committer:
drewantech
Date:
Mon Feb 24 14:05:41 2020 +0000
Revision:
2:28f6fe278532
Parent:
1:245bc5eb1bbe
Exercise 4

Who changed what in which revision?

UserRevisionLine numberNew contents of line
drewantech 0:cb7457d7c822 1 #include "mbed.h"
drewantech 1:245bc5eb1bbe 2 /****************************************************************
drewantech 2:28f6fe278532 3 This is a slightly harder exercise but should be good majour hint use << and >>.
drewantech 2:28f6fe278532 4 in this exercise i would like you to create a function that will take in an 8-bit, 1byre number and then display it on the leds in biary.
drewantech 1:245bc5eb1bbe 5
drewantech 2:28f6fe278532 6 In the main I would like to see the code count up in binary.
drewantech 1:245bc5eb1bbe 7 ***************************************************************/
drewantech 0:cb7457d7c822 8
drewantech 1:245bc5eb1bbe 9 // these functions initializes the led pins and functions associated with them these are technically c++ but dont worry to much about this yet
drewantech 1:245bc5eb1bbe 10 DigitalOut led1(D5);
drewantech 1:245bc5eb1bbe 11 DigitalOut led2(D6);
drewantech 1:245bc5eb1bbe 12 DigitalOut led3(D7);
drewantech 1:245bc5eb1bbe 13 DigitalOut led4(D8);
drewantech 1:245bc5eb1bbe 14 DigitalOut led5(D9);
drewantech 1:245bc5eb1bbe 15 DigitalOut led6(D10);
drewantech 1:245bc5eb1bbe 16 DigitalOut led7(D11);
drewantech 1:245bc5eb1bbe 17 DigitalOut led8(D12);
drewantech 0:cb7457d7c822 18
drewantech 1:245bc5eb1bbe 19 // this is your main function and is where the code starts good luck!
drewantech 0:cb7457d7c822 20 int main() {
drewantech 1:245bc5eb1bbe 21
drewantech 0:cb7457d7c822 22 }