47 lines
821 B
C++
47 lines
821 B
C++
#include <SPI.h>
|
|
#include <Wire.h>
|
|
#include <Adafruit_GFX.h>
|
|
#include <Adafruit_ST7789.h>
|
|
|
|
#include "./include/display.h"
|
|
#include "./include/heightsensor.h"
|
|
#include "./lib/menu.h"
|
|
#include "./lib/vl53l0x.h"
|
|
|
|
|
|
Adafruit_ST7789 display = Adafruit_ST7789(DISPLAY_PORT_CS, DISPLAY_PORT_DC, DISPLAY_PORT_RST);
|
|
VL53L0X heightSensor = VL53L0X();
|
|
|
|
Menu menu = Menu(&display);
|
|
|
|
|
|
void setup()
|
|
{
|
|
display.init(DISPLAY_WIDTH, DISPLAY_HEIGHT, SPI_MODE3);
|
|
display.setRotation(DISPLAY_ROTATION);
|
|
display.fillScreen(ST77XX_BLACK);
|
|
|
|
menu.init();
|
|
|
|
// TODO draw "initializing" text
|
|
|
|
Wire.begin();
|
|
heightSensor.init(HEIGHTSENSOR_I2C_ADDRESS);
|
|
|
|
/*
|
|
Wire.begin();
|
|
if (!heightSensor.begin())
|
|
{
|
|
// TODO draw "height sensor error" text
|
|
|
|
while(1);
|
|
}
|
|
|
|
display.fillScreen(ST77XX_BLACK);
|
|
*/
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
// TODO
|
|
} |