So, if the stick is moved on X axis from one end to the other, the X values will change from 0 to 1023 and similar thing happens when moved along the Y axis. This change can be read by an Arduino analog pin using ADC.Īs the Arduino board has an ADC resolution of 10 bits, the values on each analog channel (axis) can vary from 0 to 1023. In order to read the joystick’s physical position, we need to measure the change in resistance of a potentiometer. In other words, if you push the stick all the way forward, it will turn the potentiometer contact arm to one end of the track, and if you pull it back toward you, it will turn the contact arm the other way. Moving the slotted shafts rotates the contact arm of the potentiometer. A potentiometer is connected to each joystick shaft that interprets the position of the rod as analog readings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |