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 DigitalOut_HelloWorld by
Revision 7:21a83a7b8f94, committed 2015-03-27
- Comitter:
- mbedAustin
- Date:
- Fri Mar 27 22:02:41 2015 +0000
- Parent:
- 6:4b14e87b65e9
- Child:
- 8:78036976f155
- Commit message:
- fixed bug in printf statement by explicitly stating (uint8_t)
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Mar 27 21:15:35 2015 +0000
+++ b/main.cpp Fri Mar 27 22:02:41 2015 +0000
@@ -17,18 +17,19 @@
DigitalOut myled(LED1);
-int main() {
+int main()
+{
// check that myled object is initialized and connected to a pin
- if(myled.is_connected()){
+ if(myled.is_connected()) {
printf("myled is initialized and connected!\n\r");
}
-
+
// Blink LED
while(1) {
myled = 1; // set LED1 pin to high
- printf("\n\r myled = %d",myled);
+ printf("\n\r myled = %d", (uint8_t)myled );
wait(0.5);
-
+
myled.write(0); // set LED1 pin to low
printf("\n\r myled = %d",myled.read() );
wait(0.5);
