A class library for OLED on MARMEX_OB board. MARY拡張のMARMEX_OB基板のOLEDをmbed+MAPLE基板で動かすためのライブラリです.このサンプルではMAPLEに用意されているMARMEXスロットの1番に搭載したOLEDを制御するようになっています.詳細はCode&APIからソースやAPI詳細をご覧ください
Diff: main.cpp
- Revision:
- 1:a0ac2743f855
- Parent:
- 0:a19b70a76e66
--- a/main.cpp Thu Apr 07 07:39:06 2011 +0000 +++ b/main.cpp Thu Apr 07 23:32:35 2011 +0000 @@ -1,16 +1,16 @@ /** A sample app of MARMEX_OB OLED screen drawing library * * @author Tedd - * @version 0.5 - * @date 07-Apr-2011 + * @version 0.51 + * @date 08-Apr-2011 * * Released under the MIT License: http://mbed.org/license/mit * * MARMEX_OB_oled OLED screen drawing library for mbed * This code has been written based on sample code and advises * from Ochiai-san (Marutsu-Elec). Thank you! - * - * To build this code, "NokiaLCD" and "mbed" libraries are needed to be imported in a project. + * + * To build this code, "NokiaLCD" and "mbed" libraries are needed to be imported in a project. * NokiaLCD library : http://mbed.org/users/simon/libraries/NokiaLCD/ */ @@ -29,8 +29,10 @@ oled1.background( 0x000000 ); oled1.cls(); + int colorbar_width = MARMEX_OB_oled::WIDTH / 8; + for ( int i = 0; i < 8; i++ ) - oled1.fill( (MARMEX_OB_oled::WIDTH / 8) * i, 0, (MARMEX_OB_oled::WIDTH / 8), 128, ((i & 0x4) ? 0xFF0000 : 0x000000) | ((i & 0x2) ? 0x00FF00 : 0x000000) |((i & 0x1) ? 0x0000FF : 0x000000) ); + oled1.fill( colorbar_width * i, 0, colorbar_width, MARMEX_OB_oled::HEIGHT, ((i & 0x4) ? 0xFF0000 : 0x000000) | ((i & 0x2) ? 0x00FF00 : 0x000000) | ((i & 0x1) ? 0x0000FF : 0x000000) ); oled1.fill( 50, 50, 64, 64, 0xCCCCCC );; @@ -44,3 +46,8 @@ } } +/* + * history: + * 0.5 (2011-Apr-07) : initial published version + * 0.51 (2011-Apr-08) : minor modification to make the source more consistent (use " MARMEX_OB_oled::HEIGHT" instead of 128) + */