![]() |
Java in RobotC for FTC TeleOp
I need help with programming. I found that you can use certain Java commands in RobotC. So I thought that I could use the Switch command which worked for some things but I have no idea how to make it work for the buttons in the TeleOp phrase.
The syntax for the Switch command is Code:
switch (variable)http://www.youtube.com/watch?v=RVRPmeccFT0 This is my proof of concept code for Java in RobotC. It is supposed to display what button is being pressed on the NXT screen. Since this was only a proof of concept, only wrote code for Buttons 1-4 on Game controller #1(Logitech Dual action). The purpose of using the Switch command was to shorten up the code and make it less massive instead of using an IF and ELSE command for every button that will be used. Code:
#pragma config(Hubs, S1, HTMotor, HTMotor, HTMotor, HTServo)Mason Tran FTC Team 3385 Lead Programmer |
Re: Java in RobotC for FTC TeleOp
The switch statement is and has always has been a C syntax... Java followed C and has a lot of C syntax incorporated in it. RobotC is just an IDE and user library. It also uses a small executive in the processor.
|
Re: Java in RobotC for FTC TeleOp
Quote:
|
Re: Java in RobotC for FTC TeleOp
Quote:
Probable? No... What variable are you gonna switch on? |
| All times are GMT -5. The time now is 09:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi