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

Newbie coder working toward toggling buttons
http://robotc.net/forums/viewtopic.php?f=69&t=13321
Page 1 of 1

Author:  Geckser [ Wed Feb 03, 2016 7:46 pm ]
Post subject:  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);
            }
}


}

Author:  Bug of Doom [ Wed Feb 10, 2016 6:37 pm ]
Post subject:  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

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