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_6,PB_7,9600); 00015 PortOut anzeige(PortC,0xFF); 00016 DigitalIn taste(PA_6); 00017 lcd mylcd; 00018 char c; 00019 00020 00021 int main() 00022 { 00023 char daten[6]="Hallo"; 00024 // Initialise the digital pin LED1 as an output 00025 DigitalOut led(PA_5); 00026 taste.mode(PullDown); 00027 mylcd.clear(); 00028 mylcd.cursorpos(0); 00029 mylcd.printf("Hallo"); 00030 while (true) { 00031 led = !led; 00032 daten[0]='*'; 00033 daten[1]='T'; 00034 daten[2]='x'; 00035 if (taste) daten[3]='y'; 00036 else daten[3]='z'; 00037 daten[4]='*'; 00038 00039 hc05.write(daten,4); 00040 if (hc05.readable()) 00041 { 00042 hc05.read(&c,1); 00043 mylcd.printf("%c",c); 00044 00045 } 00046 thread_sleep_for(BLINKING_RATE_MS); 00047 } 00048 }
Generated on Sat Dec 24 2022 12:38:29 by
1.7.2