-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain
More file actions
86 lines (60 loc) · 1.7 KB
/
main
File metadata and controls
86 lines (60 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET LED_BUILTIN
Adafruit_SSD1306 display(OLED_RESET);
void setup() {
Serial.begin(9600);
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC , 0x3C); // initialize with the I2C addr 0x3C (for the 128x32)
display.clearDisplay();
// draw rectangles
testdrawrect();
display.display();
delay(2000);
// display.clearDisplay();
// draw multiple rectangles
testfillrect();
display.display();
delay(2000);
//display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(35,0);
display.println("DUST BIN");
// Show the display buffer on the hardware.
// NOTE: You _must_ call display after making any drawing commands
// to make them visible on the display hardware!
display.display();
delay(2000);
//display.clearDisplay();
//display.setTextSize(1);
//display.setTextColor(WHITE);
//display.setCursor(0,0);
//display.println("Hello, world!");
//display.setTextColor(BLACK, WHITE); // 'inverted' text
//display.println();
display.setCursor(0,15);
display.setTextSize(2);
display.setTextColor(WHITE);
display.print("CHIP2CLOUD");
display.display();
delay(2000);
}
void loop() {
}
void testdrawrect(void) {
display.drawRect(100,0,22,7, WHITE);
display.display();
//delay(1);
}
void testfillrect(void) {
uint8_t color = 1;
// for (int16_t i=0; i<display.height()/2; i+=3) {
// alternate colors
display.fillRect(100,0,15,7,color%2);
display.display();
delay(1);
// color++;
}