From fd7c017a6fab43eb1e6fbc39a36b716359a4dc29 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Thu, 15 Jan 2026 09:08:54 +0100 Subject: Initial test setup --- hello-t-energy-s3.ino | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 hello-t-energy-s3.ino (limited to 'hello-t-energy-s3.ino') diff --git a/hello-t-energy-s3.ino b/hello-t-energy-s3.ino new file mode 100644 index 0000000..fd0a05d --- /dev/null +++ b/hello-t-energy-s3.ino @@ -0,0 +1,21 @@ +// Minimal T-Energy-S3 test +// Reads battery voltage and prints to USB serial + +#define BATTERY_PIN 3 + +void setup() { + Serial.begin(115200); + delay(2000); // Wait for USB CDC to initialize + + Serial.println("Hello T-Energy-S3!"); + + pinMode(BATTERY_PIN, INPUT); + analogReadResolution(12); + analogSetPinAttenuation(BATTERY_PIN, ADC_11db); +} + +void loop() { + int mv = analogReadMilliVolts(BATTERY_PIN) * 2; // Voltage divider on board + Serial.printf("Battery: %d mV\n", mv); + delay(2000); +} -- cgit v1.3.1