-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.c
60 lines (50 loc) · 1.1 KB
/
template.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiAP.h>
#include <WebServer.h>
#include <Wire.h>
#include <SPI.h>
//#### Screen SETUP ######
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
//###### MPU SETUP #######
#include "MPU9250.h"
#include "quaternionFilters.h"
MPU9250 IMU;
//###### RTC SETUP #######
#include "pcf8563.h"
PCF8563_Class rtc;
//###### ADC SETUP #######
#include "esp_adc_cal.h"
//########################
${EXTINC}
${VARIABLE}
${FUNCTION}
void setup()
{
Wire1.begin(SENSOR_SDA, SENSOR_SCL);
SPI.begin(_TFT_SCLK, _TFT_MISO, _TFT_MOSI, _TFT_CS);
pinMode(LED_PIN, OUTPUT);
pinMode(TP_PIN_PIN, INPUT);
pinMode(TP_PWR_PIN, PULLUP);
digitalWrite(TP_PWR_PIN, HIGH);
pinMode(CHARGE_PIN, INPUT_PULLUP);
rtc.begin(Wire1);
IMU.begin();
ledcAttachPin(_TFT_BL, BACKLIGHT_CHANNEL);
ledcSetup(BACKLIGHT_CHANNEL, 12000, 8);
ledcWrite(BACKLIGHT_CHANNEL, 128);
tft.init();
tft.setRotation(1);
tft.setTextSize(1);
tft.setSwapBytes(true);
tft.fillScreen(0xffff);
${SETUP_CODE}
${BLOCKSETUP}
}
void loop()
{
${LOOP_EXT_CODE}
${LOOP_CODE}
}