File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,22 @@ void setup() {
8282void loop () {
8383
8484 Oled.setFont (u8x8_font_amstrad_cpc_extended_r);
85+
86+ // when using u8g8 instead of u8g2, cursor values
87+ // are in characters, not pixels
88+ Oled.setCursor (0 , 4 );
89+ // If accelerometer and altimeter are queried too close to one another
90+ // this causes a hang, so we read this first.
91+ Oled.print (" x:" );
92+ Oled.print (Accelerometer.readX ());
93+ Oled.print (" y:" );
94+ Oled.print (Accelerometer.readY ());
95+ Oled.setCursor (0 , 5 );
96+ Oled.print (" z:" );
97+ Oled.print (Accelerometer.readZ ());
98+ Oled.print (" T:" );
99+ Oled.print (Environment.readTemperature ());
100+ Oled.print (" C" );
85101
86102 Oled.setCursor (0 , 0 );
87103 Oled.print (" But:" );
@@ -114,20 +130,6 @@ void loop() {
114130 Oled.print (light_value);
115131 Oled.print (" " );
116132
117- // when using u8g8 instead of u8g2, cursor values
118- // are in characters, not pixels
119- Oled.setCursor (0 , 4 );
120- Oled.print (" x:" );
121- Oled.print (Accelerometer.readX ());
122- Oled.print (" y:" );
123- Oled.print (Accelerometer.readY ());
124- Oled.setCursor (0 , 5 );
125- Oled.print (" z:" );
126- Oled.print (Accelerometer.readZ ());
127- Oled.print (" T:" );
128- Oled.print (Environment.readTemperature ());
129- Oled.print (" C" );
130-
131133 Oled.setCursor (0 , 6 );
132134 Oled.print (" Hum: " );
133135 Oled.print (Environment.readHumidity ());
You can’t perform that action at this time.
0 commit comments