080_LED_SOS_UP_Strukturen_UserButton_PWM

main.cpp

Committer:
itbusch
Date:
2022-02-04
Revision:
1:2d785f9b9879
Parent:
0:ebd8e92b9d80

File content as of revision 1:2d785f9b9879:

/* mbed BuschA*/

#include "mbed.h"

PwmOut Boardled(LED1);           //PWM!
DigitalIn User_Button(PC_13); //PullUp auf Board, PC13

int main()
{
    Boardled.period_ms(10); //PWM-Periodendauer
    
    while (true) 
    {
        if (User_Button == false)
        {
        Boardled = 0.2;      //PWM Tastgrad 0-1
        }
    else
        {
        Boardled = 1.0;      //PWM Tastgrad 0-1
        }
    }
}