Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
Yea, you'll see this happen with all microcontrollers.I once lost a robot competition because I was accidentally reading the pin right next to the pin with the analog sensor. It seemed to work most of the time, but sometimes it wouldn't, or would be very flaky. The debugging drove me crazy. I didn't realize the dumb mistake until a month or so later . . . all from floating voltage.There was a moral to that story, somewhere, I think . . .
Yeah, try to declare all unused analog pins as outputs, then you won't have any floating voltage problem.
Quote from: Ro-Bot-X on April 05, 2010, 07:22:45 AMYeah, try to declare all unused analog pins as outputs, then you won't have any floating voltage problem. Nah, that would have caused a short - pin says 5V and sensor says 2.5V . . . something will give . . .
Hi,Quote from: Admin on April 05, 2010, 09:14:33 AMQuote from: Ro-Bot-X on April 05, 2010, 07:22:45 AMYeah, try to declare all unused analog pins as outputs, then you won't have any floating voltage problem. Nah, that would have caused a short - pin says 5V and sensor says 2.5V . . . something will give . . .Nothing will give, as the sensor reading from an unused pin is merely a Hi_Z reception of a neighbour pin.
Quote from: Soeren on April 05, 2010, 09:56:37 AMHi,Quote from: Admin on April 05, 2010, 09:14:33 AMQuote from: Ro-Bot-X on April 05, 2010, 07:22:45 AMYeah, try to declare all unused analog pins as outputs, then you won't have any floating voltage problem. Nah, that would have caused a short - pin says 5V and sensor says 2.5V . . . something will give . . .Nothing will give, as the sensor reading from an unused pin is merely a Hi_Z reception of a neighbour pin.But a pin set to output isn't floating, its either 0V to 5V . . .