/*
We need your help to stop forest fires and bake tasty cookies!
See `requirements.md` for how to help.
Then check `notes.md`.
*/
#include "api.h"
void setup() {
Serial.begin(115200);
setup_api();
Serial.println("Elf oven 2000 starting up.");
serial_printf("Days without fire incident: %i\n", 0);
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// Some example code below to help show how to use API.
// Please delete it and replace with your own code.
uint16_t sensor_voltage = read_voltage(TEMPERATURE_SENSOR);
serial_printf("sensor_voltage %i\n", sensor_voltage);
set_output(GAS_VALVE, sensor_voltage > 2000);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
if (TEMPERATURE_SENSOR > 180) { //condition to check for the temperature sensor
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
delay(1000);
}