/*Header
Writing a code to measure the voltage
within an LED-resistor ciruit
With measured voltage we can use Ohms law (V = IR)
To calcualte
voltage drop across any component
And current through component/circuit
*/
//Global Variable and pin declaration
//pins we are using... are there any? 13
int LEDPin = 13; //power for LED pin is pin 13
// variable for my voltage reading
int VoltReading;
void setup() {
// put your setup code here, to run once:
// what pins are being used, and how they are being used
//LED --> 13 --> actuator or sensor and idgital or analog
// LED is an actuator --> Write
pinMode(LEDPin,OUTPUT);
// if we want to see values --> need to initialize serial monitor
//we want to serial print (plotter)
Serial.begin(9600); // always use 9600
}
void loop() {
// put your main code here, to run repeatedly:
//turn on LED --> WRITE
//digital
digitalWrite(LEDPin, HIGH);
//we want to read our voltage values
// want an analog
VoltReading = analogRead(A0);
//add wire to A0
// need to display value
//Serial.print(VoltReading);
//add text
//Serial.print(" | ");
Serial.println(VoltReading);
delay(100);
//not meant to replace hardware
}