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.
main.cpp
00001 #include "mbed.h" 00002 00003 00004 DigitalOut doMyled_1(LED1); 00005 DigitalOut doMyled_4(LED4); 00006 DigitalIn diJaUp(p15); 00007 BusOut doBlueLeds (LED1,LED2,LED3,LED4); 00008 00009 uint8_t ledZustand; // Zustandvar für eine LED 00010 00011 void activate() 00012 { 00013 00014 00015 wait(0.2); 00016 doMyled_1 = 0; 00017 wait(0.2); 00018 doMyled_1 = 1; 00019 wait(0.1); 00020 doMyled_4 = !doMyled_4; // toogle 00021 printf("Zustand von LED4 = %d/r/n", (int)doMyled_4); // Ausgabe in der HTerm Software 00022 } 00023 int main() { 00024 doMyled_1.write(1); 00025 ledZustand = doMyled_1.read(); 00026 //ledZustand = doMyled_1; // same as line above 00027 00028 while(1) { 00029 if(diJaUp) 00030 { 00031 activate(); 00032 } 00033 else 00034 { 00035 printf("Bitte Joystick UP druecken\r\n"); 00036 for(int i=0; i<16;i++) 00037 { 00038 doBlueLeds = i; 00039 //doMyled_1 = doMyled_4 = 0; 00040 wait(0.1); 00041 } 00042 doBlueLeds =0; 00043 } 00044 } 00045 }
Generated on Sat Jul 23 2022 06:16:37 by
