|
|
oled无论怎么弄都无法亮,不知道是什么问题。我的程序是这样写的:
- #include "U8glib.h"
- U8GLIB_SSD1306_128X64 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
- const uint8_t rook_bitmap[] PROGMEM = {
- 0x00, // 00000000
- 0x55, // 01010101
- 0x7f, // 01111111
- 0x3e, // 00111110
- 0x3e, // 00111110
- 0x3e, // 00111110
- 0x3e, // 00111110
- 0x7f // 01111111
- };
- void draw(void) {
- // graphic commands to redraw the complete screen should be placed here
- u8g.drawBitmapP( 0, 0, 1, 8, rook_bitmap);
- }
- void setup(void) {
- pinMode(6, OUTPUT);
- digitalWrite(6, HIGH);
- }
- void loop(void) {
- // picture loop
- u8g.firstPage();
- do {
- draw();
- } while( u8g.nextPage() );
-
- // rebuild the picture after some delay
- delay(1000);
- }
复制代码 |
|