Go to Post Monkeys with typewriters will eventually create shakespeare, and spam bots will eventually create a thread title that fits the rumor mill. - ATannahill [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 12-10-2010, 15:59
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
Re: Help with PSoC board programming please

another problem is when i use

Quote:
DriverStationEnhancedIO &dsio = DriverStation::GetInstance()->GetEnhancedIO();
i get the warning that "dsio" is an undeclared variable

any one knows how to fix this problem?
Reply With Quote
  #17   Spotlight this post!  
Unread 12-10-2010, 16:08
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Help with PSoC board programming please

Try it without the "&" character.
Reply With Quote
  #18   Spotlight this post!  
Unread 12-10-2010, 16:22
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
Re: Help with PSoC board programming please

i did that but I build it, i get an error this time
Reply With Quote
  #19   Spotlight this post!  
Unread 13-10-2010, 17:40
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Help with PSoC board programming please

You're probably trying to use the variable outside of the scope it was declared. Is that code from your init function?
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #20   Spotlight this post!  
Unread 14-10-2010, 22:30
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
Re: Help with PSoC board programming please

I do not know what do you mean by init code?, I put it under teleoperated
Reply With Quote
  #21   Spotlight this post!  
Unread 15-10-2010, 16:45
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Help with PSoC board programming please

init as in the constructor function (possibly called RobotDemo)

Can you post your full code? Also does it say the error is on the same line as the line you posted?
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #22   Spotlight this post!  
Unread 20-10-2010, 11:20
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
Re: Help with PSoC board programming please

#include "WPILib.h"
#include "DriverStation.h"
//#include "Vision/HSLImage.h"
//#include "Vision/AxisCamera.h"

/*
* This is a demo program showing the use of the RobotBase class.
* The SimpleRobot class is the base of a robot application that will automatically call your
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
* the driver station or the field controls.
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////
/// CLASS ///

class RobotDemo : public SimpleRobot
{
Victor *VictorPair1, *VictorPair2;
RobotDrive *myRobot; // robot drive system
Joystick *RightStick, *LeftStick, *ThirdStick; // only joystick
DriverStation *ds, *dsio; // driver station
Servo *Left_GearServo, *Right_GearServo;
Victor *Dribbler, *CamKicker, *Winch;
DigitalInput *limitSwitchB, *AutoSwitch1, *AutoSwitch2, *AutoSwitch3, *Swltch;
Relay *ArmRelease;
// AxisCamera *camera;

//////////////////////////////////////////////////////////////////////////////////////////////////////
/// PUBLIC ///

public:

RobotDemo(void)
{
VictorPair1 = new Victor(1);
VictorPair2 = new Victor(2);
ds = DriverStation::GetInstance();
myRobot = new RobotDrive(VictorPair1, VictorPair2); // create robot drive base


RightStick = new Joystick(1);// create the joysticks
LeftStick = new Joystick(2);
ThirdStick = new Joystick(3);


AutoSwitch1 = new DigitalInput(1);
AutoSwitch2 = new DigitalInput(2);
AutoSwitch3 = new DigitalInput(3);
limitSwitchB = new DigitalInput(7);



Left_GearServo = new Servo(3);
Right_GearServo = new Servo(4);


Dribbler = new Victor(5);
CamKicker = new Victor(6);
Winch = new Victor(7);


ArmRelease = new Relay(1);



GetWatchdog().SetExpiration(100);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
/// AUTONOMOUS FIRST ZONE ///

void Autonomous(void)
{
GetWatchdog().SetEnabled(false);

{
{
Right_GearServo->Set(127);
Left_GearServo->Set(127);
}


if (AutoSwitch1->Get()== 1)
{
{
myRobot->Drive(-0.5, 0.0);
Dribbler->Set(1.0);
Wait(1.5);
myRobot->Drive(0.0, 0.0);
CamKicker->Set(-1.0);
Wait(1.0);
CamKicker->Set(0.0);
Dribbler->Set(0.0);
while(limitSwitchB->Get()== 0)
{
CamKicker->Set(-1.0);
}
}
if (limitSwitchB->Get()== 1)
{
CamKicker->Set(0.0);
}
};
////////////////////////////////////////////////////////////////////////////////////////
//////SECOND ZONE/////

if (AutoSwitch2->Get()==1)
{
{
myRobot->Drive(-0.30, 0.0);
Dribbler->Set(1.0);
Wait(2.6);
myRobot->Drive(0.0, 0.0);
CamKicker->Set(-1.0);
Wait(1.0);
CamKicker->Set(0.0);
Dribbler->Set(0.0);
while(limitSwitchB->Get()== 0)
{
CamKicker->Set(-1.0);
}
}
if (limitSwitchB->Get()== 1)
{
CamKicker->Set(0.0);
}
{
myRobot->Drive(-0.30, 0.0);
Dribbler->Set(1.0);
Wait(1.2);
myRobot->Drive(0.0, 0.0);
CamKicker->Set(-1.0);
Wait(1.0);
CamKicker->Set(0.0);
Dribbler->Set(0.0);
while(limitSwitchB->Get()== 0)
{
CamKicker->Set(-1.0);
}
}
if (limitSwitchB->Get()== 1)
{
CamKicker->Set(0.0);
}

};
////////////////////////////////////////////////////////////////////////////////
//////THIRD ZONE//////
if (AutoSwitch3->Get()== 1)
{
{
myRobot->Drive(-0.30, 0.0);
Dribbler->Set(1.0);
Wait(1.3);
myRobot->Drive(0.0, 0.0);
CamKicker->Set(-1.0);
Wait(1.0);
CamKicker->Set(0.0);
Dribbler->Set(0.0);
while(limitSwitchB->Get()== 0)
{
CamKicker->Set(-1.0);
}
}
if (limitSwitchB->Get()== 1)
{
CamKicker->Set(0.0);
}
{
myRobot->Drive(-0.30, 0.0);
Dribbler->Set(1.0);
Wait(1.2);
myRobot->Drive(0.0, 0.0);
CamKicker->Set(-1.0);
Wait(1.0);
CamKicker->Set(0.0);
Dribbler->Set(0.0);
while(limitSwitchB->Get()== 0)
{
CamKicker->Set(-1.0);
}
}
if (limitSwitchB->Get()== 1)
{
CamKicker->Set(0.0);
}
{
myRobot->Drive(-0.30, 0.0);
Dribbler->Set(1.0);
Wait(1.3);
myRobot->Drive(0.0, 0.0);
CamKicker->Set(-1.0);
Wait(1.0);
CamKicker->Set(0.0);
Dribbler->Set(0.0);
while(limitSwitchB->Get()== 0)
{
CamKicker->Set(-1.0);
}
}
if (limitSwitchB->Get()== 1)
{
CamKicker->Set(0.0);
}
{
myRobot->Drive(1.0, 0.0);
Wait(0.5);
myRobot->Drive(0.0, 0.0);
}




}

};
};



//////////////////////////////////////////////////////////////////////////////////////////////
/// OPERATOR CONTROL ///
void OperatorControl(void)
{

GetWatchdog().SetEnabled(false);
//GetWatchdog().Feed();
DriverStationEnhancedIO &dsio = DriverStation::GetInstance()->GetEnhancedIO();





/* while (IsOperatorControl())
{
AxisCamera &camera = AxisCamera::GetInstance();
camera.WriteResolution(AxisCamera::kResolution_640 x480);
camera.WriteCompression(20);
camera.WriteBrightness(0);
}*/
// Assume that the THIRDSTICK THROTTLE is initially set at 100% (max)
// float Max_DribblerSpeed = ThirdStick->GetThrottle();

/////////////////////////////////////////////////////////////////////////////////////////////
/// Robot Drive ///

while (IsOperatorControl())
{
myRobot->TankDrive(RightStick, LeftStick);

///////////////////////////////////////////////////////////////////////////////////////////
/// Dribbler Control ///

if (ThirdStick->GetRawButton(2))
{
Dribbler->Set(1.0);
};


//////////////////////////////////////////////////////////////////////////////////////////
/// ARM CONTROL ///

/// ARM RELEASE ///

if (ThirdStick->GetRawButton(6))
{
ArmRelease->Set(Relay::kForward);
Winch->Set(0.0);
Dribbler->Set(0.0);
CamKicker->Set(0.0);
}
else if (ThirdStick->GetRawButton(7))
{
ArmRelease->Set(Relay::kReverse);
Winch->Set(0.0);
Dribbler->Set(0.0);
CamKicker->Set(0.0);
}
else
{
ArmRelease->Set(Relay::kOff);
}

/// WINCH ///

if (ThirdStick->GetRawButton(11))
{
Winch->Set(1.0);
CamKicker->Set(0.0);
Dribbler->Set(0.0);
ArmRelease->Set(Relay::kOff);
}
else if (ThirdStick->GetRawButton(10))
{
Winch->Set(-1.0);
CamKicker->Set(0.0);
Dribbler->Set(0.0);
ArmRelease->Set(Relay::kOff);
}
else
{
Winch->Set(0.0);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////
/// CAMKICKER && LIMITSWITCH-B ///

if(ThirdStick-> GetRawButton(4))
{
while (limitSwitchB->Get()== 0)
{
CamKicker->Set(-1.0);
Dribbler->Set(0.0);
Winch->Set(0.0);
ArmRelease->Set(Relay::kOff);
}
CamKicker->Set(0.0);
}


if (ThirdStick->GetTrigger() && (limitSwitchB->Get()== 1))
{
CamKicker->Set(-1.0);
Winch->Set(0.0);
Dribbler->Set(0.0);
ArmRelease->Set(Relay::kOff);

if (limitSwitchB->Get() == 0)
{
CamKicker->Set(0.0);
}
}


/////////////////////////////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////////////////////////
/// GEAR CONTROL ///

if ( (LeftStick->GetTrigger()) )
{
Left_GearServo -> Set(127);
Right_GearServo -> Set(127);
};

if ( (RightStick->GetTrigger()) )
{
Left_GearServo ->Set(-127);
Right_GearServo ->Set(-127);
};

};
};
};


START_ROBOT_CLASS(RobotDemo);
Reply With Quote
  #23   Spotlight this post!  
Unread 20-10-2010, 17:19
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Help with PSoC board programming please

You're defining dsio twice in your program. At the top of the file it is declared as a DriverStation*. Remove that (leave ds in there though) at it should build.
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #24   Spotlight this post!  
Unread 21-10-2010, 19:54
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
Re: Help with PSoC board programming please

Yea, but even when I take it out of class, i get the same warning
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with PSoC board wiring please krudeboy51 Electrical 1 04-05-2010 16:17
Attaching Psoc Board to breadboard nickcvet89 FRC Control System 2 10-03-2010 12:27
Windows "Malfunctioning USB Device" error with Psoc IO Board WarrenPW FRC Control System 2 11-02-2010 18:53
Wiring Switches to the PSoC board Raj1977 Electrical 13 07-02-2010 23:24
Help with programming new controllers, please. Oumonkey Programming 6 30-11-2006 21:53


All times are GMT -5. The time now is 13:38.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi