Go to Post The greatest reward you can give your mentors is to become one. - Ed Sparks [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
  #1   Spotlight this post!  
Unread 04-05-2010, 16:35
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
Help with PSoC board programming please

can any one please show me how to program a PSoC board with a switch
or give me a sample code??
Quote:
class:
???
public:
??????
Void operator control:
???

Last edited by krudeboy51 : 04-05-2010 at 19:18.
Reply With Quote
  #2   Spotlight this post!  
Unread 04-05-2010, 16:41
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,057
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Help with PSoC board programming please

http://www.virtualroadside.com/WPILi...r_station.html

I have linked the relevant API documents. You can use DriverStation::GetDigitalIn([number]) to get the value of the switch.

And PLEASE try to take a little more time writing your posts in the future.
__________________




.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-05-2010, 20:56
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

Quote:
Originally Posted by Andrew Schreiber View Post
http://www.virtualroadside.com/WPILi...r_station.html

I have linked the relevant API documents. You can use DriverStation::GetDigitalIn([number]) to get the value of the switch.

And PLEASE try to take a little more time writing your posts in the future.
the website doesnt show where in the code to put "DriverStation::GetDigitalIn"
Reply With Quote
  #4   Spotlight this post!  
Unread 04-05-2010, 23:34
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

The GetDigitalIn would be somewhere in your Teleop loop (before you need the data of course)
__________________

"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
  #5   Spotlight this post!  
Unread 05-05-2010, 06:12
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

Quote:
Originally Posted by Radical Pi View Post
The GetDigitalIn would be somewhere in your Teleop loop (before you need the data of course)
what data?
Reply With Quote
  #6   Spotlight this post!  
Unread 05-05-2010, 09:59
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

The value of the switch...
__________________

"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
  #7   Spotlight this post!  
Unread 05-05-2010, 12: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

how do you make the PSoC board communicate with the driver station, i plugged it in but the driver station says:
Quote:
"I/O unit not detected or not installed correctly."
Reply With Quote
  #8   Spotlight this post!  
Unread 05-05-2010, 13:12
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Help with PSoC board programming please

Did you follow the steps in section 2.11 of the control system manual for configuring the I/O module?
Reply With Quote
  #9   Spotlight this post!  
Unread 05-05-2010, 15:12
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

Quote:
Originally Posted by Joe Ross View Post
Did you follow the steps in section 2.11 of the control system manual for configuring the I/O module?
yes, the driver station sees it now but the driver station still shows:

Quote:
"I/O unit not detected or not installed correctly."
HOW DO YOU INTRODUCE THE PSoC BOARD TO THE PROGRAM

(sorry for so much questions, but im just learning)

Last edited by krudeboy51 : 05-05-2010 at 16:33.
Reply With Quote
  #10   Spotlight this post!  
Unread 05-05-2010, 18:46
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

Does the I/O light turn green in the Diagnostcs window?

Make sure you have the latest update to the DS software (1.2 I believe). You may need to uninstall and reinstall the Cypress software through the updater
__________________

"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
  #11   Spotlight this post!  
Unread 05-05-2010, 20:58
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

Quote:
Originally Posted by Radical Pi View Post
Does the I/O light turn green in the Diagnostcs window?

Make sure you have the latest update to the DS software (1.2 I believe). You may need to uninstall and reinstall the Cypress software through the updater
yes, it turns green now on the driver station, but im wondering, do i have to introduce it to the code in class and public, or just go ahead in teleoperated and put "DriverStation::GetDigitalIn"??
Reply With Quote
  #12   Spotlight this post!  
Unread 05-05-2010, 23:15
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

To use the DriverStation functions, you have to create a DriverStation pointer and set it with DriverStation::GetInstance(). You can then use GetDigitalIn only on the first 8 pins. The DS must also be set to Compatible I/O mode (through I/O screen). If you want to use any of the advanced functionality available through the PSoC board, the system is a bit different (will show with code)

Using DriverStation
Code:
public:
...
DriverStation *ds;
...
MyRobot() {
...
ds = DriverStation::GetInstance()
...
}

Teleop() {
...
switch = ds->GetDigitalIn(1);
...
}
Using DriverStationEnhancedIO:
Code:
Teleop() {
DriverStationEnhancedIO& dsio = DriverStation::GetInstance()->GetEnhancedIO();
...
switch = dsio.GetDigital(1);
...
}
IMO you should use the DriverStationEnhancedIO version since you can have more control over the PSoC (pulled high/pulled low, input/output, encoder support, LEDs)
__________________

"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
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 12:32.

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