View unanswered posts | View active topics It is currently Thu Jul 31, 2014 2:28 pm






Reply to topic  [ 4 posts ] 
2nd Remote Control Work 
Author Message
Rookie

Joined: Fri Oct 12, 2012 11:43 am
Posts: 4
Post 2nd Remote Control Work
I can't get two remote controls to work for the life of me.
Code:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Motor,  mtr_S1_C2_1,     motorD,        tmotorTetrix, openLoop)

#include "JoystickDriver.c" //Joystick is included in this program

task main()
{

  while(true) //infinite loop
  {
    getJoystickSettings(joystick); //retrieves data from the joystick
    motor[motorD] = joystick.joy2_y1;



   } //while
} //main


Here are the errors:
Code:
**Error**:'joy2_y1' is not a 'struct' element of struct reference 'joystick'
*Warning*:Invalid '=' operation for types 'word' and 'TPCJoystick'


Fri Oct 12, 2012 11:48 am
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 601
Post Re: 2nd Remote Control Work
This code compiles for me without issue with the latest version of ROBOTC (3.51) when set to the TETRIX platform.

Are you trying to use this code with the Virtual Worlds? I notice that it's referencing the "TPCJoystick" (key being PC) instead of "TJoystick" so this tells me you are currently in Emulator/Virtual Worlds mode. Unfortunately, the Virtual Worlds system only support a single joystick.

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Fri Oct 12, 2012 12:48 pm
Profile
Rookie

Joined: Fri Oct 12, 2012 11:43 am
Posts: 4
Post Re: 2nd Remote Control Work
Yes, I am using Virtual Words. Can you not use two joysticks in virtual worlds?


Fri Oct 12, 2012 12:57 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 558
Post Re: 2nd Remote Control Work
tfriez wrote:
This code compiles for me without issue with the latest version of ROBOTC (3.51) when set to the TETRIX platform.

Are you trying to use this code with the Virtual Worlds? I notice that it's referencing the "TPCJoystick" (key being PC) instead of "TJoystick" so this tells me you are currently in Emulator/Virtual Worlds mode. Unfortunately, the Virtual Worlds system only support a single joystick.


That is correct, at this time you cannot use two joysticks in the Virtual World system.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Mon Oct 15, 2012 4:24 pm
Profile
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.