![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Conta da 0 a 15 in binario
Dependencies: mbed
main.cpp
- Committer:
- pil310
- Date:
- 2016-02-28
- Revision:
- 0:64b05e7cbcf0
File content as of revision 0:64b05e7cbcf0:
#include "mbed.h" DigitalOut myled1(LED1); DigitalOut myled2(LED2); DigitalOut myled3(LED3); DigitalOut myled4(LED4); int main() { for(int x=0; x<16; x++) { if (x & 0x1) myled1 = 1; else myled1 = 0; if (x & 0x2) myled2 = 1; else myled2 = 0; if (x & 0x4) myled3 = 1; else myled3 = 0; if (x & 0x8) myled4 = 1; else myled4 = 0; wait(0.5); } }