![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
MARMEX_OB_oled_J sample
Dependencies: MARMEX_OB_oled_J mbed
Fork of Q_nolkiaJapanese_3_tryBaikaku by
main.cpp@0:4ef525e32ebc, 2011-07-18 (annotated)
- Committer:
- s_s_s
- Date:
- Mon Jul 18 01:30:20 2011 +0000
- Revision:
- 0:4ef525e32ebc
- Child:
- 1:5e0d5c8ade80
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
s_s_s | 0:4ef525e32ebc | 1 | #include "mbed.h" |
s_s_s | 0:4ef525e32ebc | 2 | #include "Moled.h" |
s_s_s | 0:4ef525e32ebc | 3 | DigitalOut myled1(LED1); |
s_s_s | 0:4ef525e32ebc | 4 | DigitalOut myled2(LED2); |
s_s_s | 0:4ef525e32ebc | 5 | |
s_s_s | 0:4ef525e32ebc | 6 | Moled oled (p5, p7, p8, p30 , p11); //( p5, p7, p26, p21, p17 ); //(p5, p7, p8, p30,p11); // mosi, sclk, cs, rst,power |
s_s_s | 0:4ef525e32ebc | 7 | |
s_s_s | 0:4ef525e32ebc | 8 | int main() { |
s_s_s | 0:4ef525e32ebc | 9 | |
s_s_s | 0:4ef525e32ebc | 10 | oled.cls(); |
s_s_s | 0:4ef525e32ebc | 11 | oled.locate(0,0); oled.fontsize(1,1);oled.foreground(0x00FFFFFF); oled.printf("ABC:123"); |
s_s_s | 0:4ef525e32ebc | 12 | oled.locate(0,1); oled.fontsize(2,1);oled.foreground(0x00FF0000); oled.printf("ABC:123"); |
s_s_s | 0:4ef525e32ebc | 13 | oled.locate(0,1); oled.fontsize(1,2);oled.foreground(0x0000FF00); oled.printf("Ø:123"); |
s_s_s | 0:4ef525e32ebc | 14 | oled.locate(0,2); oled.fontsize(2,2);oled.foreground(0x000000FF); oled.printf("Rì:123"); |
s_s_s | 0:4ef525e32ebc | 15 | oled.locate(0,2); oled.fontsize(3,3);oled.foreground(0x00FFFFFF); oled.printf("c¨:1"); |
s_s_s | 0:4ef525e32ebc | 16 | oled.fill(100,100,20,20,0x00FFFFFF); |
s_s_s | 0:4ef525e32ebc | 17 | oled.pixel(110,110,0x00FFFF00); |
s_s_s | 0:4ef525e32ebc | 18 | |
s_s_s | 0:4ef525e32ebc | 19 | while(1) { |
s_s_s | 0:4ef525e32ebc | 20 | myled1 = 1; |
s_s_s | 0:4ef525e32ebc | 21 | wait(0.25); |
s_s_s | 0:4ef525e32ebc | 22 | myled1 = 0; |
s_s_s | 0:4ef525e32ebc | 23 | wait(0.25); |
s_s_s | 0:4ef525e32ebc | 24 | } |
s_s_s | 0:4ef525e32ebc | 25 | } |