Our teams robot design is rather complicated this year so our coach wants me to simplify as much as possible. I was thinking about using the Cypress I/O Module to incorporate some push switches for various functions on our robot. I will be using switches that act as light switches (on/off) and possibly some pushbutton switches. I was also thinking about incorporating analog inputs.
A. How do I connect these to the board.
B. How do I program them in c++.
C. How do I program them in the Cypress Coding application.
Hello, alright, well first of all, save this image as a reference:
http://www.chiefdelphi.com/forums/attachment.php?attachmentid=8352&d=1264090529
You need it to know what and where the inputs are on the Cypress. Next, make sure your cypress is plugged in, and download their firmware update (I believe from their website), and apply the latest firmware update to your Cypress through the Cypress PSoC Programmer. That is the last of their software that you will be needing. Next, lets take your limit switch as an example, you need to wire it to the cypress. There should be two outputs on your switch, a.k.a something along the lines of two screws, etc. Switches are digital inputs, they require absolutely no power, therefore the VDDIO on the cypress is useless to you for that purpose. Wire on output from the switch to a GND port on the cypress, and wire the other screw from the switch to port P4_4 (Digital Input 1) on the Cypress. Finally, in C++, you do the following anywhere you want your switch to be used:
DriverStation *ds = DriverStation::GetInstance();
int limitswitch = ds->GetDigitalInput(1);
To check whether the switch is on (1) or off (0), open up your driver station, go the IO tab and look at the digital inputs. If the button is green for Digital In 1, then your code will make limitswitch = 1, and if it is dull, it will make the variable 0. You can use this to make your robot switch functionalities. Good luck!
It was my understanding that updating the PSoC will make the Driver Station software fail to recognize it. The specific firmware supplied by FIRST is what you need to use. I haven’t actually verified this, because I have no desire to break what is now working.
I have been told to get the FIRST update that has the correct firmware too. But I was never able to locate the correct update that contains that firmware. Would somebody post a link to the update please? Thanks.
The FRC specific Cypress firmware gets installed with the Driver Station Update,
then you’ll find it on your computer:
C:\Documents and Settings\All Users\Documents\FRC\FRC_IO.v2.hex