![]() ![]() Read analog value from potentiometer middle pin -> value=analogRead(potPin).In between, analogRead() returns a number between that is proportional to the amount of voltage being applied to the pin. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. ![]() Here's the 'Fade an LED with potentiometer' code, embedded using codebender!īy turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |