Compare commits

...

1 Commits

Author SHA1 Message Date
mattbk
ab7020f718 Simple test of voltage measurement. 2023-10-09 20:43:52 -05:00

View File

@ -31,6 +31,11 @@ AsyncWebServer server(80);
const int keyer = 32;
const int blinker = LED_BUILTIN;
// Battery voltage monitor
const int voltage_pin = 33;
int voltage_pin_value = 0;
// RTC connections
RTC_DS3231 rtc; // set up RTC
const int alarmPin = 4; // pin to monitor for RTC alarms
@ -616,6 +621,13 @@ void setup() {
void loop() {
// For testing, print the value returned from the voltage circuit.
// This is not voltage, and needs to be scaled to the battery. See KB1OIQ's solution.
voltage_pin_value = analogRead(voltage_pin);
Serial.println(voltage_pin_value);
// This statement from https://github.com/garrysblog/DS3231-Alarm-With-Adafruit-RTClib-Library/blob/master/DS3231-RTClib-Adafruit-Alarm-Poll-alarmFired/DS3231-RTClib-Adafruit-Alarm-Poll-alarmFired.ino
// Check if alarm by polling SQW alarm pin
if((yourInputSend == 2) & (digitalRead(alarmPin) == LOW)) {