The code that shows how it crashed is this.
It prints :
Blockquote DHTxx test!
get ram signal!
woop we are now in the loop
CO2eq C[]
The oled shows a white stripe, meaning it has crashed badly properly
The code I run is bewlo
Blockquote
#include <Arduino.h>
#include “sensirion_common.h” // co2
#include “sgp30.h” // co2
// #include “DHT.h” //humid
#include <U8x8lib.h> // oled
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
void setup(void) {
Serial.begin(9600);
Serial.println(“DHTxx test!”);
u8x8.begin();
u8x8.setPowerSave(0);
u8x8.setFlipMode(1);
// co2 code sgp30
s16 err;
u16 scaled_ethanol_signal, scaled_h2_signal;
/* Init module,Reset all baseline,The initialization takes up to around 15 seconds, during which
all APIs measuring IAQ(Indoor air quality ) output will not change.Default value is 400(ppm) for co2,0(ppb) for tvoc*/
while (sgp_probe() != STATUS_OK) {
Serial.println(“SGP failed”);
while (1);
}
/Read H2 and Ethanol signal in the way of blocking/
err = sgp_measure_signals_blocking_read(&scaled_ethanol_signal,
&scaled_h2_signal);
if (err == STATUS_OK) {
Serial.println(“get ram signal!”);
} else {
Serial.println(“error reading signals”);
}
err = sgp_iaq_init();
}
void loop(void) {
Serial.println(“woop we are now in the loop”);
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.setCursor(0,1);
u8x8.print(“Temp:”);
// u8x8.print(temp);
u8x8.print(“C”);
u8x8.setCursor(0,2);
u8x8.print(“Humidity:”);
// u8x8.print(humi);
u8x8.print("%");
s16 err = 0;
u16 tvoc_ppb, co2_eq_ppm;
err = sgp_measure_iaq_blocking_read(&tvoc_ppb, &co2_eq_ppm);
if (err == STATUS_OK) {
Serial.print(“CO2eq Concentration:”);
Serial.print(co2_eq_ppm);
Serial.println(“ppm”);
u8x8.setCursor(0,3);
u8x8.print(“tVOC :”);
u8x8.print(tvoc_ppb);
u8x8.print(“ppb”);
u8x8.setCursor(0,4);
u8x8.print(“Co2eq :”);
u8x8.print(co2_eq_ppm);
u8x8.print(“ppb”);
} else {
Serial.println(“error reading IAQ values\n”);
}
u8x8.refreshDisplay();
delay(1200);
}