![](/media/cache/profiles/94aef38441efa3380a3bed3faf1f9d5d.50x50_q85.jpg)
AD-128160-UART制御用のライブラリ http://mbed.org/users/nucho/libraries/AD128160/m24mml を試してみるシンプルなプログラムです。 === image === {{http://farm8.staticflickr.com/7028/6496821539_333a08b551.jpg}} === circuit === {{http://farm8.staticflickr.com/7164/6498120233_a004e4fe29.jpg}}
Revision 1:edf1eade7570, committed 2011-12-13
- Comitter:
- nucho
- Date:
- Tue Dec 13 15:38:11 2011 +0000
- Parent:
- 0:4e906b12a024
- Commit message:
Changed in this revision
AD128160.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4e906b12a024 -r edf1eade7570 AD128160.lib --- a/AD128160.lib Mon Dec 12 03:09:32 2011 +0000 +++ b/AD128160.lib Tue Dec 13 15:38:11 2011 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/nucho/code/AD128160/#6f2db745808e +http://mbed.org/users/nucho/code/AD128160/#d15cda2a5e91
diff -r 4e906b12a024 -r edf1eade7570 main.cpp --- a/main.cpp Mon Dec 12 03:09:32 2011 +0000 +++ b/main.cpp Tue Dec 13 15:38:11 2011 +0000 @@ -3,26 +3,26 @@ AD128160 lcd(p9,p20); -int rgb565(int r, int g,int b) -{ +int rgb565(int r, int g,int b) { int rgb; - + rgb = (r & 0xF8) << 8; /* RRRRR----------- */ rgb |= (g & 0xFC) << 3; /* -----GGGGGG----- */ rgb |= b >> 3; /* -----------BBBBB */ - + return rgb; } int main() { - lcd.backgroudColor(rgb565(255,0,0)); + lcd.textBackground(1,rgb565(255,0,0)); + lcd.locate(2,lcd.rows()/2); lcd.printf("Hello World!\n"); - + lcd.color(rgb565(0,255,0)); lcd.box(12,76,116,100,0); lcd.box(8,120,124,146,1); - + lcd.color(rgb565(255,0,0)); lcd.circle(16,40,16,0); lcd.circle(48,40,16,1);