Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
joystick [2017/02/23 03:54]
99.174.81.42 [Mapping Voltage to Position]
joystick [2017/03/17 01:24]
99.174.81.42 [Connections]
Line 58: Line 58:
 For a joystick, you will need to connect each wiper (the left/right and up/down) to different analog pins (e.g. 1.30 and 1.31). For a joystick, you will need to connect each wiper (the left/right and up/down) to different analog pins (e.g. 1.30 and 1.31).
  
-(image of joystick connection)+{{:​joystick:​joystick_connections.png?​nolink&​400 |image of joystick connection}}
  
 == Configuration == Configuration
Line 67: Line 67:
 The way the Joystick module performs this conversion is to first measure the voltage coming in. The module then subtracts off an offset, called <​kbd>​zero_offset</​kbd>​. The module then scales the voltage reading so that the <​kbd>​zero_offset</​kbd>​ voltage becomes 0, and the <​kbd>​endpoint</​kbd>​ voltage becomes 1 or -1 (depends on if <​kbd>​endpoint</​kbd>​ is greater or less than <​kbd>​zero_offset</​kbd>​). Any values which end up outside the -1 to 1 range are fixed to be at +/- 1. The way the Joystick module performs this conversion is to first measure the voltage coming in. The module then subtracts off an offset, called <​kbd>​zero_offset</​kbd>​. The module then scales the voltage reading so that the <​kbd>​zero_offset</​kbd>​ voltage becomes 0, and the <​kbd>​endpoint</​kbd>​ voltage becomes 1 or -1 (depends on if <​kbd>​endpoint</​kbd>​ is greater or less than <​kbd>​zero_offset</​kbd>​). Any values which end up outside the -1 to 1 range are fixed to be at +/- 1.
  
-<WRAP center round box 50%>+<WRAP center round box 80%>
 {{ :​joystick:​joystick_mapping_diagram.png?​1000 |}} {{ :​joystick:​joystick_mapping_diagram.png?​1000 |}}