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 #include "mbed.h" 00002 #include "MyLCD.h" 00003 00004 I2C i2c(dp5,dp27); // sda, scl <== LPC1114FN28 00005 MyLCD lcd(&i2c); 00006 DigitalOut led1(LED1); 00007 DigitalOut led2(LED2); 00008 00009 char osamru_bitmap[6][8] = 00010 { 00011 { 4, 3, 15, 7, 15, 18, 18, 14}, // おさる その1 00012 { 31, 31, 31, 31, 3, 0, 12, 18}, // おさる その2 00013 { 0, 24, 28, 30, 18, 2, 12, 18}, // おさる その3 00014 { 30, 15, 30, 12, 6, 2, 1, 0}, // おさる その4 00015 { 22, 12, 0, 17, 24, 30, 1, 30}, // おさる その5 00016 { 22, 12, 4, 18, 2, 4, 24, 0} // おさる その6 00017 }; 00018 00019 int main() { 00020 00021 // LCD の外字を登録 00022 for (int i=0; i < 6;i++) 00023 { 00024 lcd.saveCustomCharacter(i, osamru_bitmap[i]);// 00025 lcd.mapCustomCharacter(i,i); 00026 } 00027 00028 lcd.clear(); 00029 lcd.hideCursor(); 00030 00031 lcd.gotoCursor(0, 0); 00032 lcd.printChar(0); // おさる その1 00033 lcd.printChar(1); // おさる その2 00034 lcd.printChar(2); // おさる その3 00035 lcd.printStr(">Monkee LCD<"); 00036 00037 lcd.gotoCursor(0, 1); 00038 lcd.printChar(3); // おさる その4 00039 lcd.printChar(4); // おさる その5 00040 lcd.printChar(5); // おさる その6 00041 lcd.printStr("[\265\273\331\300\336 \263\257\267\267!]"); // 8進表記すればカタカナも表示可 00042 00043 led1 = 1; 00044 led2 = 0; 00045 while(1) { 00046 wait(1); 00047 led1 = !led1; 00048 led2 = !led2; 00049 } 00050 }
Generated on Thu Jul 14 2022 06:34:26 by
1.7.2