-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVoltage_Reader.ino
40 lines (28 loc) · 955 Bytes
/
Voltage_Reader.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*Program Name: Sensors
This program measures the value in the sensor using the analog pin.
The value is monitored in the serial monitor and must concide with the voltage measurements in the multimeter
SETUP:
1)Arduino
2)Breadboard
3)USB Cable
4)560Ω resistor
5)10kΩ resistor
6)2.2kΩ resistor
7)>=3 jumper wires
8)Multimeter
February 13 ,2023
Student Name: Ian Jericho Pedeglorio
Student Number: 200450851
*/
//start of program
//declare the varibles and pins that will be used
const float aRead = A1;
void setup() {
pinMode(aRead, INPUT); //read input from A1
Serial.begin(9600); //initiate serial monitor
}
void loop() {
float pot_value = analogRead(aRead) / 1023.0 * 5.0; //formula to get the voltage measurements in decimal form
Serial.println(pot_value); //print values in serial monitor
}
//end of program