Hello, alright, well first of all, save this image as a reference:
http://www.chiefdelphi.com/forums/at...2&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:
Code:
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!