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.
Fork of TextLCD_HelloWorld by
main.cpp
00001 #include "mbed.h" 00002 #include "TextLCD.h" 00003 00004 DigitalOut led1(LED1); 00005 00006 TextLCD lcd(D11,D10,D3,D2,D1,D0,TextLCD::LCD20x4); 00007 00008 DigitalIn sda(PTE0); 00009 DigitalIn scl(PTE1); 00010 I2CSlave slave(PTE0, PTE1); 00011 //AnalogIn vol(A0); 00012 00013 //const int addr = 0x90; 00014 char cmd[2]; 00015 //slave.address = addr; 00016 00017 00018 int main() { 00019 led1=1; 00020 sda.mode(PullUp); 00021 scl.mode(PullUp); 00022 cmd[0] = '?'; 00023 cmd[1] = '!'; 00024 slave.address(0x90); 00025 while(true) { 00026 led1=!led1; 00027 //float val = 3.3*vol; 00028 slave.read(cmd,2); 00029 lcd.printf("Toastboard!\n"); 00030 lcd.printf("%s\n",cmd); 00031 wait(1); 00032 } 00033 00034 }
Generated on Wed Jul 13 2022 04:46:11 by
1.7.2
