080_LED_SOS_UP_Strukturen_UserButton_PWM

Committer:
itbusch
Date:
Mon Jan 31 16:59:13 2022 +0000
Revision:
0:ebd8e92b9d80
Child:
1:2d785f9b9879
070_LED_SOS_UP_Strukturen_CableSwitch_PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
itbusch 0:ebd8e92b9d80 1 /* mbed BuschA
itbusch 0:ebd8e92b9d80 2 */
itbusch 0:ebd8e92b9d80 3
itbusch 0:ebd8e92b9d80 4 #include "mbed.h"
itbusch 0:ebd8e92b9d80 5
itbusch 0:ebd8e92b9d80 6 AnalogOut Boardled(LED1); //PWM!
itbusch 0:ebd8e92b9d80 7 DigitalIn CableSwitch(D2); //PullUp auf Board, PA_10
itbusch 0:ebd8e92b9d80 8
itbusch 0:ebd8e92b9d80 9 int main()
itbusch 0:ebd8e92b9d80 10 {
itbusch 0:ebd8e92b9d80 11
itbusch 0:ebd8e92b9d80 12 while (1)
itbusch 0:ebd8e92b9d80 13 {
itbusch 0:ebd8e92b9d80 14 if (CableSwitch == false)
itbusch 0:ebd8e92b9d80 15 {
itbusch 0:ebd8e92b9d80 16 Boardled = 8;
itbusch 0:ebd8e92b9d80 17 }
itbusch 0:ebd8e92b9d80 18 else
itbusch 0:ebd8e92b9d80 19 {
itbusch 0:ebd8e92b9d80 20 Boardled = 255;
itbusch 0:ebd8e92b9d80 21 }
itbusch 0:ebd8e92b9d80 22 }
itbusch 0:ebd8e92b9d80 23 }