View Full Version : Pneumatic Pressure Switch for EasyC
My programming group has a much easier time using EasyC Pro for FRC than MP Lab. I noticed and read about the "Pressure Switch" button in EasyC Pro which is found under Outputs and it seemed to be exactly what we were looking for to turn the compressor on and off. After messing around with just the pressure switch button we could never get it to work.
Then we went back to old code made by a previous programmer in MP Lab that had the default pressure switch code and it worked perfectly, turning the compressor on and off appropriately.
This is a really simple question really, I just want to know how people are successfully using "Pressure Switch" in their EasyC code. If someone could talk me through that that would be great. When I try it with EasyC , we can't even get the spike to work.
Francis-134
31-01-2007, 01:51
The easyC help file says that in order to get the pressure switch to work, you must place the block in the 'initilize' section of your FRC project. It should work if you put it there, but double check to make sure that the switch is connected to the digital input it is wired to, and that the spike is in the correct relay port.
Yeah we tried that over and over and it doesn't work. If you've gotten it to work, could you copy everything you have in "initialize"?
Kingofl337
31-01-2007, 19:27
While in easyC PRO hit F5 and check to make sure the digital port you have the switch connected to is defined as an input. The arrow will point towards the dot.
Right, we tried that. We've basically tried everything. This is really frustrating but any ideas are much appreciated.
It seems that we have even more of a basic problem now that we didn't even have a week ago. We abandoned the pneumatic pressure switch for now, just to see if we could just program a spike to work on a relay or a digital out and THAT doesn't even work. I mean I'm 99% sure I can program a simple spike but THAT doesn't even work.
So my question now is, just to make sure I'm doing this right, whats a very elementary program I can make to make sure that my spike can work through a program. I know the physical spike is okay, but running a program to it does nothing. Even the most basic program such as a Relay Out always being on. I'm starting to become very concerned because if it's not a programming issue then I don't know what it is. If someone could link me a good EasyC forum elsewhere or even right here on CD that would be helpful also.
Kingofl337
01-02-2007, 09:05
Have you tried the online window to see if you can fire your relays there?
while ( 1 )
{
OIToRelay ( 1 , 1 , 2 , 1 ) ; //Relay Port 2 FWD
OIToRelay ( 1 , 2 , 2 , 2 ) ; //Relay Port 2 REV
}
This will map the thumb and trigger to forward and reverse of the relay on port 1.
I have attached a precompiled program with the pressure monitoring function.
Plug the compressor relay into Relay Port 1,
Plug a Spare Relay into Port 2,
Plug the pressure switch into I/O port 7.
Joystick into port 1 on the OI
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.