Trying to fix tests in project, not done yet
This commit is contained in:
35
templates/weather/__name__/__name__.ino.tmpl
Normal file
35
templates/weather/__name__/__name__.ino.tmpl
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* {{PROJECT_NAME}}.ino -- TMP36 weather station
|
||||
*
|
||||
* Reads temperature from a TMP36 sensor every 2 seconds
|
||||
* and prints to Serial:
|
||||
*
|
||||
* Temperature: 23.5 C (74.3 F)
|
||||
*
|
||||
* All logic lives in lib/app/{{PROJECT_NAME}}_app.h which depends
|
||||
* on the HAL and TempSensor interfaces, making it fully testable
|
||||
* on the host without hardware.
|
||||
*
|
||||
* Wiring (TMP36, flat side facing you):
|
||||
* Pin 1 (left) -> 5V
|
||||
* Pin 2 (middle) -> A0 (analog input)
|
||||
* Pin 3 (right) -> GND
|
||||
*
|
||||
* Serial: 115200 baud
|
||||
*/
|
||||
|
||||
#include <hal_arduino.h>
|
||||
#include <{{PROJECT_NAME}}_app.h>
|
||||
#include <tmp36_analog.h>
|
||||
|
||||
static ArduinoHal hw;
|
||||
static Tmp36Analog sensor(&hw, A0);
|
||||
static WeatherApp app(&hw, &sensor);
|
||||
|
||||
void setup() {
|
||||
app.begin();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
app.update();
|
||||
}
|
||||
Reference in New Issue
Block a user