ROBOTC.net forums
http://www.robotc.net/forums/

Potentiometer in not working with bumpswitch!
http://www.robotc.net/forums/viewtopic.php?f=11&t=5878
Page 1 of 1

Author:  aero13 [ Sat May 25, 2013 3:54 pm ]
Post subject:  Potentiometer in not working with bumpswitch!

I have a program in that turns a motor a certain direction depending on the reading from the Potentiometer. It works fine but when I try to add in a bumpSwitch or limitSwitch with the program, the Pontentiometer stops working. I have the Pot in analog 1 and the bumpSwitch in digital 1 and I am using a vex cortex microcontroller btw.

Author:  mightor [ Sat May 25, 2013 4:12 pm ]
Post subject:  Re: Potentiometer in not working with bumpswitch!

Without the actual program, there is no way to know what the issue could be. Could you please attach it or paste it into a post. Make sure to enclose it in [ code][/ code] tags (minus the spaces)

= xander

Author:  aero13 [ Sun May 26, 2013 7:13 am ]
Post subject:  Re: Potentiometer in not working with bumpswitch!

#pragma config(Sensor, in1, Pot, sensorPotentiometer)
#pragma config(Motor, port1, theMotor, tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{
while(1==1){
if(SensorValue[Pot] > 3000)
{
motor[theMotor] = 68;
}
if(SensorValue[Pot] < 50)
{
motor[theMotor] = -68;
}
}
} This actually works well oscillating the motor. The problem is when I do this

task main()
{
while(1==1){
if(SensorValue[bumpSwitch] == 1) /* I want the program to start only if I push the button*/
{
if(SensorValue[Pot] > 3000)
{
motor[theMotor] = 68;
}
if(SensorValue[Pot] < 50)
{
motor[theMotor] = -68; it compiles and download but then the Pot stops working

Author:  mightor [ Sun May 26, 2013 7:56 am ]
Post subject:  Re: Potentiometer in not working with bumpswitch!

This is not working code, it's incomplete. Also, please enclose in the code tags like I asked. Thanks!

- Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/