View unanswered posts | View active topics It is currently Wed Oct 01, 2014 4:17 am






Reply to topic  [ 2 posts ] 
No/erroneous readout from channels 3, 4, 5 
Author Message
Rookie

Joined: Wed Jun 19, 2013 10:50 pm
Posts: 2
Post No/erroneous readout from channels 3, 4, 5
After noticing some bad behavior from our motors I decided to test our joystick channels by printing their value out to the LCD. Only channel 1 gives me a reading of -127 to 127. Channel 2 gives me readings between 20 and 40. Channels 3 and 4 give no reading at all. I have uploaded the firmware for the cortex and the joystick and calibrated the joystick. I am testing over two different cortexs and two joysticks. Any ideas why our joysticks are not being recognized? Here is my code. Thanks for any help you can offer.

#pragma config(Motor, port2, rightMotor, tmotorNormal, openLoop, reversed)
#pragma config(Motor, port3, leftMotor, tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{

while(true)
{

if (vexRT[Btn5U] == 1)
{
clearLCDLine(0);
displayLCDString(0,0,"B5U");
}
else if (vexRT[Btn5D])
{
clearLCDLine(0);
displayLCDString(0,0,"B5D");
}
else if (vexRT[Btn6U] == 1)
{
clearLCDLine(0);
displayLCDString(0,0,"B6U");
}
else if (vexRT[Btn6D])
{
clearLCDLine(0);
displayLCDString(0,0,"B6D");
}
else if (vexRT[Btn7U] == 1)
{
clearLCDLine(0);
displayLCDString(0,0,"B7U");
}
else if (vexRT[Btn7D])
{
clearLCDLine(0);
displayLCDString(0,0,"B7D");
}
else if (vexRT[Btn7L] == 1)
{
clearLCDLine(0);
displayLCDString(0,0,"B7L");
}
else if (vexRT[Btn7R])
{
clearLCDLine(0);
displayLCDString(0,0,"B7R");
}
else if (vexRT[Btn8U] == 1)
{
clearLCDLine(0);
displayLCDString(0,0,"B8U");
}
else if (vexRT[Btn8D])
{
clearLCDLine(0);
displayLCDString(0,0,"B8D");
}
else if (vexRT[Btn8L] == 1)
{
clearLCDLine(0);
displayLCDString(0,0,"B8L");
}
else if (vexRT[Btn8R])
{
clearLCDLine(0);
displayLCDString(0,0,"B8R");
}
else if (vexRT[Ch1])
{
clearLCDLine(0);
displayLCDNumber(0,0,vexRT[Ch1]);
}
else if (vexRT[Ch2])
{
clearLCDLine(0);
displayLCDNumber(0,0,vexRT[Ch2]);
}
else if (vexRT[Ch3])
{
clearLCDLine(0);
displayLCDNumber(0,0,vexRT[Ch3]);
}
else if (vexRT[Ch4])
{
clearLCDLine(0);
displayLCDNumber(0,0,vexRT[Ch4]);
}
else
{
clearLCDLine(0);
displayLCDString(0,0,"None");
}
}
}


Thu Feb 27, 2014 1:32 pm
Profile
Rookie

Joined: Wed Jun 19, 2013 10:50 pm
Posts: 2
Post Re: No/erroneous readout from channels 3, 4, 5
Totally just realized I forgot to do vexRT[Ch1] != 0 for my conditionals. This might help.


Thu Feb 27, 2014 1:43 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.