Markus Reiner
/
info_180917_pucher
von Lehrer
Revision 0:c8013eebb51e, committed 2018-11-15
- Comitter:
- mexx
- Date:
- Thu Nov 15 18:05:10 2018 +0000
- Commit message:
- von Lehrer
Changed in this revision
diff -r 000000000000 -r c8013eebb51e C12832.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Thu Nov 15 18:05:10 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/askksa12543/code/C12832/#990d5eec2ef6
diff -r 000000000000 -r c8013eebb51e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 15 18:05:10 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/aa5281ff4a02 \ No newline at end of file
diff -r 000000000000 -r c8013eebb51e pucher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pucher.cpp Thu Nov 15 18:05:10 2018 +0000 @@ -0,0 +1,144 @@ +//http://ec2-52-211-146-247.eu-west-1.compute.amazonaws.com:7829/#user_1538071876296 + +#include "mbed.h" +#include "C12832.h" + +#define DEBUG_LEVEL 1 + +C12832 lcd(p5, p7, p6, p11, p8); + +class DigitalAus : public DigitalOut +{ + + public: + DigitalAus(PinName Id) : DigitalOut(Id, 0) { + + #ifdef DEBUG_LEVEL + lcd.cls(); + lcd.locate(0,0); + lcd.printf("Debugging Information"); + #endif + } + + void schreibe(int value) + { + + write(value); + #ifdef DEBUG_LEVEL + lcd.locate(0,10); + lcd.printf("Value: %d\n",read() ); + #endif + + } + + int lesen() + { + return read(); + } + + int ist_verbunden() + { + return is_connected(); + } + + using DigitalOut::write; + + void write(int value , bool t) + { + printf("Aetsch"); + + } + + void blink10mal(int zeit, int anzahl) + { + //int i=0; + + + for (int i=0; i<anzahl;i++) + { + write(1); + printf("Blink:%i\n",i+1); + wait_ms(zeit); + write(0); + wait_ms(zeit); + } + /* + write(1); + printf("Blink:%i\n",i+1); + wait_ms(zeit); + write(0); + wait_ms(zeit); + i++; + */ + + } + + /* + void blink10mal() + { + for (int i=0; i<11;i++) + { + write(1); + wait_ms(500); + write(0); + wait_ms(500); + } + + + for (int i=0; i<11;i++) + { + write(1); + wait_ms(500); + write(0); + wait_ms(500); + } + int i=0; + while (i<11) + { + write(1); + wait_ms(500); + write(0); + wait_ms(500); + i++ + } + + + } + */ +}; + +DigitalAus led1(LED1); + + + +int main() + +{ + printf("test\n"); + + + printf("10blinker\n"); + led1.blink10mal(50,6); + printf("10blinker aus\n"); + + + int i=0; + + while(1) + { + led1.schreibe(1); + i= led1.lesen(); + //printf("is connected %i\n",led1.ist_verbunden()); + wait(1); + printf("Led1=%i\n",i); + led1.schreibe(0); + i= led1.lesen(); + wait(1); + printf("Led1=%i\n",i); + + + + + } + return 0; +} \ No newline at end of file