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.
Dependencies: mbed
Revision 8:5a2df0569c67, committed 2019-02-12
- Comitter:
- Danyal
- Date:
- Tue Feb 12 12:30:41 2019 +0000
- Parent:
- 7:dd77d598e6cb
- Commit message:
- Aufgabe1
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Dec 01 14:40:10 2018 +0000 +++ b/main.cpp Tue Feb 12 12:30:41 2019 +0000 @@ -1,42 +1,27 @@ #include "mbed.h" -/** Test - * Nucleo-F091 Getting started +/** + * Execution Time */ Serial pc(SERIAL_TX, SERIAL_RX); -//9600, 8 data bits, no parity,1 stop bit,no flow control -DigitalOut onboardLed(LED1); -DigitalIn userButton(BUTTON1); + +DigitalOut digO(D8); int main() -{ - // Initial sequence - pc.printf("Hello World !\n\r"); - onboardLed=1; - wait(1.0f); //https://en.cppreference.com/w/cpp/language/floating_literal - onboardLed=!onboardLed; - wait(1.0f); - onboardLed=0; - pc.printf("Press any key on the keyboard to start the program\n\r"); - pc.putc(pc.getc()); //echo keyboard input, blocking wait - pc.printf(" was pressed\n\r"); - for (int32_t i=0;i<=10;i++){ - pc.printf("***\n\r"); //Generate some new lines - } +{ + // Endless loop + while(1) { - - // Endless loop - int32_t i=0; - while(1) { - onboardLed.write(1); //switch on LED - wait_ms(200); - onboardLed.write(0); //switch off - wait_ms(700); - pc.printf("This program runs since %d (0x%X) seconds.\n\r", i,i); - if (userButton==0) { - pc.printf("Userbutton pressed\n\r"); - } - i++; //increase loop counter + //volatile double a = 12345., b = 67., c =0.; + //volatile int16_t a = 12345, b = 67, c =0; + //volatile int32_t a = 12345, b = 67, c =0; + volatile float a = 12345., b = 67., c =0.; + //int32_t erg = 0; + + digO.write(1); + //c = a +b; + pc.printf("Hello World %f",a); + digO.write(0); } }