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.
main.cpp
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2019 ARM Limited 00003 * SPDX-License-Identifier: Apache-2.0 00004 */ 00005 00006 #include "mbed.h" 00007 #include "platform/mbed_thread.h" 00008 #include "LCD.h" 00009 #include <Callback.h> 00010 00011 // Blinking rate in milliseconds 00012 #define BLINKING_RATE_MS 500 00013 00014 BufferedSerial hc05(PB_10,PB_11,9600); 00015 DigitalOut links1(PC_0); 00016 DigitalOut links2(PC_2); 00017 DigitalOut rechts1(PC_1); 00018 DigitalOut rechts2(PC_3); 00019 lcd mylcd; 00020 char c; 00021 00022 00023 00024 int main() 00025 { 00026 char daten[6]; 00027 00028 mylcd.clear(); 00029 while (true) { 00030 if (hc05.readable()) 00031 { 00032 hc05.read(daten,1); 00033 mylcd.cursorpos(0x40); 00034 mylcd.printf("%d",daten[0]); 00035 switch(daten[0]) 00036 { 00037 case 'U':links1=1;links2=0;break; 00038 case 'X':links1=0;links2=0;break; 00039 case 'D':links1=0;links2=1;break; 00040 case 'V':rechts2=1;rechts1=0;break; 00041 case 'Y':rechts2=0;rechts1=0;break; 00042 case 'E':rechts2=0;rechts1=1;break; 00043 case 'W':links1=1;links2=0;rechts2=1;rechts1=0;break; 00044 case 'Z':links1=0;links2=0;rechts2=0;rechts1=0;break; 00045 case 'F':links1=0;links2=1;rechts2=0;rechts1=1;break; 00046 } 00047 } 00048 //thread_sleep_for(BLINKING_RATE_MS); 00049 } 00050 }
Generated on Thu Feb 9 2023 15:13:21 by
1.7.2