We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45500df commit 40d73b2Copy full SHA for 40d73b2
PiCowbell_Doubler/Arduino_PiCowbell_Doubler_Battery_Monitor/Arduino_PiCowbell_Doubler_Battery_Monitor/Arduino_PiCowbell_Doubler_Battery_Monitor.ino
@@ -0,0 +1,25 @@
1
+// SPDX-FileCopyrightText: 2024 Limor Fried for Adafruit Industries
2
+//
3
+// SPDX-License-Identifier: MIT
4
+
5
+#define LED LED_BUILTIN
6
7
+void setup() {
8
+ Serial.begin(115200);
9
+ // while (!Serial) delay(1); // wait for serial port
10
+ pinMode(LED, OUTPUT);
11
+ delay (100);
12
+ Serial.println("PiCowbell Doubler Battery Monitor");
13
14
+}
15
16
+void loop() {
17
+ digitalWrite(LED, HIGH);
18
+ // get the on-board voltage
19
+ float vsys = analogRead(A3) * 3 * 3.3 / 1023.0;
20
+ Serial.printf("Vsys: %0.1f V", vsys);
21
+ Serial.println();
22
23
+ digitalWrite(LED, LOW);
24
+ delay(5000);
25
0 commit comments