Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Arch_Analog_Thermistor_Blinker by
Revision 1:3c5f838ae76d, committed 2013-09-05
- Comitter:
- viswesr
- Date:
- Thu Sep 05 06:47:44 2013 +0000
- Parent:
- 0:ed40790a022a
- Child:
- 2:d7639bb949d7
- Commit message:
- First version
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Sep 05 02:19:37 2013 +0000
+++ b/main.cpp Thu Sep 05 06:47:44 2013 +0000
@@ -1,15 +1,15 @@
#include "mbed.h"
-/* Configure a GPIO pin as output for controlling a LED. 'led' is user assigned name and
- 'LED1' is a internal name given to a port pin P1_8 in this Arch platform. */
+/* Configure a GPIO pin as output for controlling a LED. 'led' is a user assigned name and
+ 'LED1' is an internal name given to a port pin P1_8 in this Arch platform. */
DigitalOut led(LED1);
int main()
{
while(1) {
- led = 1; // Switch ON the LED.
- wait(0.5); // Wait for 0.5 Seconds.
- led = 0; // Switch OFF the LED.
- wait(0.5); // Wait for 0.5 Seconds.
+ led.write(1); // Here, DigitalOut -> write() function is used to set the ouput high.
+ wait_ms(500); // Wait for 0.5 Seconds. The time is specified in milli-seconds using wait_ms() function.
+ led.write(0); // Switch OFF the LED.
+ wait_is(500000); // Wait for 0.5 Seconds. The time is specified in micro-seconds using wait_us() function.
}
}
