Devices & Components
Arduino Nano
Rotary Potentiometer, Hot Molded Carbon
General Purpose Single input Op amp
Hardware & Tools
Soldering kit
Software & Tools
Arduino IDE
Project description
Code
Code
cpp
...
1int charge = 0; 2 3void SendString(byte InstrNo, int MValue) { 4 Serial.print('#'); 5 Serial.print(InstrNo); 6 Serial.print('M'); 7 Serial.print(MValue); 8 Serial.print('<'); 9} 10 11 12// the setup routine runs once when you press reset: 13void setup() { 14 // initialize serial communication at 9600 bits per second: 15 Serial.begin(9600); 16} 17 18// the loop routine runs over and over again forever: 19void loop() { 20 // read the input on analog pin 0: 21 int sensorValue = analogRead(A0); 22 // print out the value you read: 23 Serial.println(sensorValue); 24 int charge = map(sensorValue,0,500,0,100); 25// Serial.println(charge); 26// delay(1000); 27 28 SendString(1,charge); // Instrument #01 29 SendString(2,charge); // Instrument #02 30 SendString(3,charge); // Instrument #03 31 delay(100); 32 }
Documentation
Schematic
...
Schematic.png

Comments
Only logged in users can leave comments