View Single Post
  #24   Spotlight this post!  
Unread 20-02-2005, 01:53
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,825
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Programming - Getting Started

Quote:
Originally Posted by Matt_Kitts
can anyone help me out with programming the buttons on the joy sticks`
Each OI joystick port has the 2005 KoP joystick buttons available in the default code as follows:
For Joystick Port 1:
  • p1_sw_top - thumb button
  • p1_sw_trig - trigger button
  • p1_sw_aux1 - button to the left of the "hat" switch on the front face
  • p1_sw_aux2 - button to the right of the "hat" switch on the front face
The other Port buttons follow the same naming convention, e.g.,
p2_sw_top would be on joystick Port 2, p3_sw_top on Port 3, etc.

They are used in your code like this:
Code:
if (p2_sw_top == 1)
printf("Hello FIRST\r");
else
printf("Goodbye cruel world\r");
There are also two analog inputs unused by the KoP joystick and the analog "hat" switch (that returns odd values).
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 20-02-2005 at 01:59.