When you open up the serial monitor you’ll see the resistance values printed once per second. There will be two values, R2 and Vout. You can use any other analog pin though, just change the pin number in line 1, and wire the circuit accordingly. The program sets up analog pin A0 to read the voltage between the known resistor and the unknown resistor. Therefore, my line 5 should look like this: float R1 = 1000. In my case, I’m using a known resistor with a value of 1K Ohms (1000 Ohms). Now, enter this code into the Arduino IDE and upload it to your board: int analogPin = 0 Įnter the value of your known resistor (in Ohms) on line 5 of the code above.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |