Deexith Hasan
Advanced Member level 4
- Joined
- Oct 24, 2014
- Messages
- 111
- Helped
- 4
- Reputation
- 8
- Reaction score
- 3
- Trophy points
- 18
- Activity points
- 740
Arduino reading 0x00 for 1.25v? it shows 0xFF for 1.00v and again switches to 0x00 for 1.25v and starts increasing......i connected pot to 5v
but led blink rate is fine when pot is adjusted but serial port reads 0x00 for 1.25v y?
Code:
/*
int sensorPin = A0; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
Serial.write(sensorValue);
// turn the ledPin on
digitalWrite(ledPin, HIGH);
// stop the program for <sensorValue> milliseconds:
delay(sensorValue);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
// stop the program for for <sensorValue> milliseconds:
delay(sensorValue);
}
but led blink rate is fine when pot is adjusted but serial port reads 0x00 for 1.25v y?