View unanswered posts | View active topics It is currently Fri Apr 18, 2014 9:11 am






Reply to topic  [ 4 posts ] 
Potentiometer in not working with bumpswitch! 
Author Message
Rookie

Joined: Sat May 25, 2013 3:01 pm
Posts: 3
Post 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.


Sat May 25, 2013 3:54 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat May 25, 2013 4:12 pm
Profile WWW
Rookie

Joined: Sat May 25, 2013 3:01 pm
Posts: 3
Post 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


Sun May 26, 2013 7:13 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun May 26, 2013 7:56 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 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.