|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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:
Last edited by krudeboy51 : 04-05-2010 at 19:18. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
||||
|
||||
|
Re: Help with PSoC board programming please
Quote:
|
|
#4
|
|||
|
|||
|
Re: Help with PSoC board programming please
The GetDigitalIn would be somewhere in your Teleop loop (before you need the data of course)
|
|
#5
|
||||
|
||||
|
Re: Help with PSoC board programming please
what data?
|
|
#6
|
|||
|
|||
|
Re: Help with PSoC board programming please
The value of the switch...
|
|
#7
|
||||
|
||||
|
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:
|
|
#8
|
||||||
|
||||||
|
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?
|
|
#9
|
||||
|
||||
|
Re: Help with PSoC board programming please
Quote:
Quote:
(sorry for so much questions, but im just learning) Last edited by krudeboy51 : 05-05-2010 at 16:33. |
|
#10
|
|||
|
|||
|
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 |
|
#11
|
||||
|
||||
|
Re: Help with PSoC board programming please
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"??
|
|
#12
|
|||
|
|||
|
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);
...
}
Code:
Teleop() {
DriverStationEnhancedIO& dsio = DriverStation::GetInstance()->GetEnhancedIO();
...
switch = dsio.GetDigital(1);
...
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |