Commit 87cf858b authored by Erik Strand's avatar Erik Strand

Wiggle the line with a digital output

This makes it easier to sanity check what I'm reading.
parent e9207f05
#include "wiring_private.h"
#define LED_GREEN 23
#define CHARGE_LINE_0 14
#define SENSE_LINE_0 2
int value;
......@@ -46,9 +47,10 @@ uint32_t bm_analogRead( uint32_t pin )
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LED_GREEN, OUTPUT);
pinMode(CHARGE_LINE_0, OUTPUT);
digitalWrite(CHARGE_LINE_0, LOW);
// Initialize the ADC
initADC();
......@@ -63,8 +65,15 @@ void setup() {
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(CHARGE_LINE_0, LOW);
delay(1000);
value = bm_analogRead(SENSE_LINE_0);
Serial.println(value);
digitalWrite(CHARGE_LINE_0, HIGH);
delay(1000);
value = bm_analogRead(SENSE_LINE_0);
Serial.println(value);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment