|
24 | 24 | * |
25 | 25 | */ |
26 | 26 |
|
27 | | -// Include the correct display library |
28 | | -// For a connection via I2C using Wire include |
29 | | -#include <Wire.h> // Only needed for Arduino 1.6.5 and earlier |
30 | | -#include "SSD1306.h" // alias for `#include "SSD1306Wire.h"` |
31 | | -// For a connection via I2C using brzo_i2c (must be installed) include |
32 | | -// #include <brzo_i2c.h> // Only needed for Arduino 1.6.5 and earlier |
33 | | -// #include "SSD1306Brzo.h" |
34 | | -// For a connection via SPI include |
35 | | -// #include <SPI.h> // Only needed for Arduino 1.6.5 and earlier |
36 | | -// #include "SSD1306Spi.h" |
37 | | - |
38 | | -// Use the corresponding display class: |
39 | | - |
40 | | -// Initialize the OLED display using SPI |
41 | | -// D5 -> CLK |
42 | | -// D7 -> MOSI (DOUT) |
43 | | -// D0 -> RES |
44 | | -// D2 -> DC |
45 | | -// D8 -> CS |
46 | | -// SSD1306Spi display(D0, D2, D8); |
47 | | - |
48 | | -// Initialize the OLED display using brzo_i2c |
49 | | -// D3 -> SDA |
50 | | -// D4 -> SCL |
51 | | -// SSD1306Brzo display(0x3c, D3, D5); |
52 | | - |
53 | | -// Initialize the OLED display using Wire library |
54 | | -SSD1306 display(0x3c, D3, D5); |
| 27 | + // Include the correct display library |
| 28 | + // For a connection via I2C using Wire include |
| 29 | + #include <Wire.h> // Only needed for Arduino 1.6.5 and earlier |
| 30 | + #include "SSD1306.h" // alias for `#include "SSD1306Wire.h"` |
| 31 | + // or #include "SH1106.h" alis for `#include "SH1106Wire.h"` |
| 32 | + // For a connection via I2C using brzo_i2c (must be installed) include |
| 33 | + // #include <brzo_i2c.h> // Only needed for Arduino 1.6.5 and earlier |
| 34 | + // #include "SSD1306Brzo.h" |
| 35 | + // #include "SH1106Brzo.h" |
| 36 | + // For a connection via SPI include |
| 37 | + // #include <SPI.h> // Only needed for Arduino 1.6.5 and earlier |
| 38 | + // #include "SSD1306Spi.h" |
| 39 | + // #include "SH1106SPi.h" |
| 40 | + |
| 41 | + // Use the corresponding display class: |
| 42 | + |
| 43 | + // Initialize the OLED display using SPI |
| 44 | + // D5 -> CLK |
| 45 | + // D7 -> MOSI (DOUT) |
| 46 | + // D0 -> RES |
| 47 | + // D2 -> DC |
| 48 | + // D8 -> CS |
| 49 | + // SSD1306Spi display(D0, D2, D8); |
| 50 | + // or |
| 51 | + // SH1106Spi display(D0, D2); |
| 52 | + |
| 53 | + // Initialize the OLED display using brzo_i2c |
| 54 | + // D3 -> SDA |
| 55 | + // D5 -> SCL |
| 56 | + // SSD1306Brzo display(0x3c, D3, D5); |
| 57 | + // or |
| 58 | + // SH1106Brzo display(0x3c, D3, D5); |
| 59 | + |
| 60 | + // Initialize the OLED display using Wire library |
| 61 | + SSD1306 display(0x3c, D3, D5); |
| 62 | + // SH1106 display(0x3c, D3, D5); |
55 | 63 |
|
56 | 64 | // Adapted from Adafruit_SSD1306 |
57 | 65 | void drawLines() { |
|
0 commit comments