120_robot_H_Bridge8835_UserButton_DIR_PWM_I2C_LCD

Dependencies:   LCD_i2C_JDS

main.cpp

Committer:
itbusch
Date:
2022-01-31
Revision:
0:3ace550537fc
Child:
1:821dba977886

File content as of revision 0:3ace550537fc:

/* mbed BuschA,   */ 
#include "mbed.h"
#include "LCD.h"
#include "LCD_Bua.h"
// Set the LCD address to 0x27 for a 16 chars and 2 line display

DigitalIn CableSwitch(D2); //PullUp auf Board, PA_10


int main()
{
    mylcd.clear();               // LCD löschen
    M1_PWM.period_ms(10);        // PWM-Periode
    
    while (true) 
    {
    if (CableSwitch == false)
        {
        M1_DIR = 1;
        M1_PWM = 0.5;           //Tastgrad 0-1 
        }
    else
        {
        M1_DIR = 1;
        M1_PWM = 0.95;
        }
    Ausgabe_LCD();
    thread_sleep_for(1000); //Sleep = Warten... 
    }
}