J.P. Armstrong
/
IntToBinaryAssembly
Assembly procedure that represents binary using the LEDs on the mbed.
Diff: main.cpp
- Revision:
- 0:13e4e935bed6
- Child:
- 1:7490aeb7d770
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jan 27 06:24:28 2011 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +// This program will blink LED1 and LED4 +// using assembly language for LED1 and +// API functions for LED4 +// declare external assembly language function (in a *.s file) +extern "C" int binasm(int value); +// declare LED outputs � let C set them up as output bits + +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +DigitalOut myled4(LED4); + +Timer t; +Serial pc(USBTX, USBRX); // tx, rx + +int main() { + + int i = 1; + + while (true) { + binasm(i % 16); + wait(0.1); + i++; + } + +}