120_robot_H_Bridge8835_UserButton_DIR_PWM_I2C_LCD
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 /* mbed BuschA, */ 00002 #include "mbed.h" 00003 #include "LCD.h" 00004 #include "LCD_Bua.h" 00005 // Set the LCD address to 0x27 for a 16 chars and 2 line display 00006 00007 DigitalIn User_Button(PC_13); //PullUp auf Board, PC13 00008 00009 00010 int main() 00011 { 00012 mylcd.clear(); // LCD löschen 00013 M1_PWM.period_ms(10); // PWM-Periode 00014 00015 while (true) 00016 { 00017 if (User_Button == false) 00018 { 00019 M1_DIR = 1; 00020 M1_PWM = 0.5; //Tastgrad 0-1 00021 } 00022 else 00023 { 00024 M1_DIR = 1; 00025 M1_PWM = 0.95; 00026 } 00027 Ausgabe_LCD(); 00028 thread_sleep_for(1000); //Sleep = Warten... 00029 } 00030 } 00031 00032
Generated on Fri Oct 13 2023 09:10:47 by
1.7.2