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.
Diff: Bertl_Buttons_Leds.cpp
- Revision:
- 0:72dfc4f5ad33
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bertl_Buttons_Leds.cpp Thu Nov 15 17:27:11 2018 +0000 @@ -0,0 +1,38 @@ +#include "mbed.h" +#include "Serial_HL.h" +#include "Bertl14.h" +#include "BertlObjects.h" + +// main=2^0 LS ENC 2^2 +BusOut boardPow(p30, P1_6, P1_7); +BusOut leds1(LED1,LED2,LED3,LED4); + +// ls5 nur beim Betrl15 +// AnalogInHL ls1(p18), ls2(p16), ls3(p19), ls4(p17); // B14 + +AnalogInHL ls1(p18), ls2(p16), ls3(p20), ls4(p19), ls5(p17); // B15 + + + +int main(void) +{ + boardPow=3; wait_ms(10); // boardPow = 3! + InitBertl(); + + while(1) + { + pex.ReadButtons(); + if(ls1.Read()>600 && pex.IsButton(BTN_FLL)) + leds1 = 1; + if(ls2.Read()>600 && pex.IsButton(BTN_FL)) + leds1 = 2; + if(ls4.Read()>600 && pex.IsButton(BTN_FR)) + leds1 = 4; + if(ls5.Read()>600 && pex.IsButton(BTN_FRR)) + leds1 = 8; + else + leds1 = 0; + } + + return 1; +} \ No newline at end of file