View unanswered posts | View active topics It is currently Mon Jan 22, 2018 4:37 pm






Reply to topic  [ 2 posts ] 
Newbie coder working toward toggling buttons 
Author Message
Rookie

Joined: Wed Feb 03, 2016 7:42 pm
Posts: 1
Post Newbie coder working toward toggling buttons
It has of course not been functioning, and any help you can provide would be very useful. This is of course just a simple test code, and there are no compiler errors, we are simply not having any response when we try to move the robot using ch1 and 2. As well as this any information on getting this to work with a button, instead of the joystick.
Code:
 #pragma config(Motor,  port1,           Conva,         tmotorVex393_HBridge, openLoop, driveLeft)
#pragma config(Motor,  port2,           Fly1,          tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor,  port3,           Fly2,          tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor,  port4,           FlyA,          tmotorVex393_MC29, openLoop, driveLeft)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()

{

int Motorslock ;

int Motorclose;

while(1 == 1)
{
getJoystickSettings(joystick);


Motorslock = Ch1;
Motorclose = Ch2;
if(Motorslock == 1)
{
Motorslock = 3;
}
while(Motorslock == 3)
{
    motor[Conva] = 127;
       motor[Fly1] = 127;
          motor[Fly2] = 127;
             motor[FlyA] = 127;
wait1Msec(3000);
             }
if(Motorclose == 1)
{
   motor[Conva] = 0;
      motor[Fly1] = 0;
         motor[Fly2] =0 ;
            motor[FlyA] = 0;
wait1Msec(3000);
            }
}


}


Wed Feb 03, 2016 7:46 pm
Profile
Rookie

Joined: Thu Jan 28, 2016 1:26 pm
Posts: 6
Location: Virginia, USA
Post Re: Newbie coder working toward toggling buttons
Have you tried adding vexRT before the channel so that the cortex can more easily identify it? I haven't personally tried this type of coding, but it's a problem I've encountered before. I'm sorry if I didn't help. :|

Bug


Wed Feb 10, 2016 6:37 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.