student project
Dependencies: mbed
Fork of myiot by
main.cpp@0:94c1a94c5a47, 2016-05-08 (annotated)
- Committer:
- ittraining
- Date:
- Sun May 08 02:49:10 2016 +0000
- Revision:
- 0:94c1a94c5a47
- Child:
- 1:e94d9dab0ef3
OLED for text and bmp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ittraining | 0:94c1a94c5a47 | 1 | #include "mbed.h" |
ittraining | 0:94c1a94c5a47 | 2 | #include "I2C_SSD1306Z.h" |
ittraining | 0:94c1a94c5a47 | 3 | |
ittraining | 0:94c1a94c5a47 | 4 | |
ittraining | 0:94c1a94c5a47 | 5 | I2C i2c(I2C_SDA, I2C_SCL); |
ittraining | 0:94c1a94c5a47 | 6 | |
ittraining | 0:94c1a94c5a47 | 7 | DigitalOut myled(LED1); |
ittraining | 0:94c1a94c5a47 | 8 | Serial pc(SERIAL_TX, SERIAL_RX); |
ittraining | 0:94c1a94c5a47 | 9 | |
ittraining | 0:94c1a94c5a47 | 10 | unsigned char BMP_Logo_ittraining[128*8] = { // IT Logo |
ittraining | 0:94c1a94c5a47 | 11 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
ittraining | 0:94c1a94c5a47 | 12 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
ittraining | 0:94c1a94c5a47 | 13 | 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xF8,0xF8,0xF8,0xC0,0xC0,0xC0,0x00,0xC0,0xC0,0xC0,0xF8,0xF8,0xF8,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0x78,0x78,0x70,0xE0,0xC0,0x00,0x60,0x60,0x60,0xE0,0xE0,0x60,0x78,0x78,0x70,0x60,0x60,0xE0,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xB0,0xB0,0x98,0x90,0x40,0xD0,0xF8,0x70,0x70,0xF0,0x58,0x10,0x00,0xB0,0xB0,0xB0,0xB0,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0x70,0x70,0x70,0xF0,0xF0,0x70,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xD8,0xF8,0xF0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
ittraining | 0:94c1a94c5a47 | 14 | 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x61,0xF1,0xE7,0x87,0x07,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x07,0x87,0xC7,0xF1,0x61,0x21,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x83,0x87,0x8F,0x8D,0xFC,0xFC,0x8C,0x8C,0x80,0x00,0xF0,0xF0,0xF1,0x37,0x3F,0x3E,0x30,0xF0,0xF0,0x38,0x3F,0x3F,0x33,0xF0,0xF0,0x00,0x00,0x00,0x00,0xC0,0xC0,0xFF,0xFF,0xED,0xCD,0xCD,0xCD,0xC0,0xF2,0xDB,0xDE,0xCE,0xDE,0xFF,0xD2,0xC0,0xCD,0xCD,0xCD,0xCD,0xFF,0xFF,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x10,0x7E,0xFF,0xC3,0x00,0x00,0x8F,0x8F,0x81,0xB9,0xB9,0xB9,0xB9,0xB9,0xB9,0xB9,0xB9,0x81,0x8F,0x8F,0x8F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
ittraining | 0:94c1a94c5a47 | 15 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x0F,0xBC,0xF8,0xF0,0xE0,0xF0,0xF8,0xBC,0x9E,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFD,0xF1,0x01,0xFF,0xFF,0x01,0x71,0x7D,0x0C,0x00,0xFE,0xFE,0xFE,0x06,0x06,0x06,0xFF,0xFF,0x06,0x06,0x06,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0xC7,0xC7,0xC7,0xC0,0xC0,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xF6,0xF6,0xFE,0xDE,0xDE,0xCE,0xCE,0xC6,0xC0,0xC0,0xC7,0xC7,0xC7,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x08,0x38,0x38,0x3D,0x3F,0x0F,0x00,0x03,0x83,0xC3,0xFF,0x7F,0x03,0x03,0x03,0xFF,0xFF,0x03,0x03,0x03,0xE3,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
ittraining | 0:94c1a94c5a47 | 16 | 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x1C,0x1C,0x0E,0x0E,0x0E,0x07,0x07,0x03,0x03,0x01,0x01,0x00,0x01,0x01,0x03,0x03,0x07,0x07,0x0E,0x0E,0x0E,0x1C,0x1C,0x0C,0x00,0x00,0x00,0x00,0x0C,0x0D,0x0C,0x0E,0x07,0x07,0x06,0x06,0x03,0x03,0x00,0x03,0x03,0x03,0x00,0x00,0x00,0x0F,0x0F,0x00,0x03,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x0E,0x0E,0x0E,0x0E,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,0x00,0x04,0x0C,0x0E,0x07,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x07,0x0F,0x0E,0x0E,0x0E,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
ittraining | 0:94c1a94c5a47 | 17 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
ittraining | 0:94c1a94c5a47 | 18 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
ittraining | 0:94c1a94c5a47 | 19 | }; |
ittraining | 0:94c1a94c5a47 | 20 | |
ittraining | 0:94c1a94c5a47 | 21 | int main() |
ittraining | 0:94c1a94c5a47 | 22 | { |
ittraining | 0:94c1a94c5a47 | 23 | |
ittraining | 0:94c1a94c5a47 | 24 | |
ittraining | 0:94c1a94c5a47 | 25 | printf("init oled\n"); |
ittraining | 0:94c1a94c5a47 | 26 | |
ittraining | 0:94c1a94c5a47 | 27 | Init_LCD(); |
ittraining | 0:94c1a94c5a47 | 28 | clear_LCD(); |
ittraining | 0:94c1a94c5a47 | 29 | |
ittraining | 0:94c1a94c5a47 | 30 | while (1) { |
ittraining | 0:94c1a94c5a47 | 31 | |
ittraining | 0:94c1a94c5a47 | 32 | |
ittraining | 0:94c1a94c5a47 | 33 | draw_LCD(BMP_Logo_ittraining); |
ittraining | 0:94c1a94c5a47 | 34 | wait(2.0); |
ittraining | 0:94c1a94c5a47 | 35 | clear_LCD(); |
ittraining | 0:94c1a94c5a47 | 36 | print_Line(0, "IT Maker Space"); |
ittraining | 0:94c1a94c5a47 | 37 | print_Line(1, "ARM mbed RTOS"); |
ittraining | 0:94c1a94c5a47 | 38 | print_Line(2, "ST Micro"); |
ittraining | 0:94c1a94c5a47 | 39 | print_Line(3, "ittraining.com"); |
ittraining | 0:94c1a94c5a47 | 40 | wait(2.0); |
ittraining | 0:94c1a94c5a47 | 41 | clear_LCD(); |
ittraining | 0:94c1a94c5a47 | 42 | |
ittraining | 0:94c1a94c5a47 | 43 | } |
ittraining | 0:94c1a94c5a47 | 44 | |
ittraining | 0:94c1a94c5a47 | 45 | } |
ittraining | 0:94c1a94c5a47 | 46 | |
ittraining | 0:94c1a94c5a47 | 47 |