homayoun mh
/
Arduino_Blink
Arduino_Blink sample code ported.
Diff: main.cpp
- Revision:
- 0:516ad7c37471
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Sep 03 10:25:31 2014 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" + +DigitalOut myled(LED1); // Instead of "pinMode(led, OUTPUT);" function, this creates an object called "myled", to be used later. + +// the setup routine runs once when you press reset: +void setup() +{ + +} + +// the loop routine runs over and over again forever: +void loop() +{ + myled = 1; // Instead of "digitalWrite(led, HIGH);" + wait(1.0); // Instead of "delay(1000);" + myled = 0; // Instead of "digitalWrite(led, LOW);" + wait(1.0); // Instead of "delay(1000);" +} + +int main() +{ + setup(); + while(1) loop(); +}