|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Single Click On/Off Using the Trigger in EasyC
I've posted a few pictures of my senior project, and before my presentation I've been working with Easy C to get the cathodes that are attached to my robot to light up and stay lit after a single click of the left trigger. I then wanted the cathodes to turn off once the trigger was clicked again. The cathodes are connected to the RC using a Spike Relay. I have been using EasyC to program my robot. I do not have the laptop that is used for programing with me but I believe my current code is:
if(p1_sw_trig && n == 0) { OItoRelay(1,1,1,1); n = 1; } if(p1_sw_trig && n == 1) { n = 0; } This turns the light on with a single button click, but the cathodes do not always turn off with the next click. I was wondering if anyone knew how to make this work, rather than have it work half the time or using two buttons to turn it on and off. Thanks in advance! -Ira |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| multiple autonomous modes using easyc | cerberus170 | Programming | 3 | 20-02-2007 15:01 |
| Using printf() as UserCode in EasyC 2.0 | tacman1123 | Programming | 2 | 31-05-2006 10:01 |
| Using SMC Single Selenoid Valve from last year? | Sachiel7 | Pneumatics | 3 | 20-01-2005 21:31 |
| Is Anyone Using Motors to Hoist themselves off the platform on the bar? | xxlshortys | Motors | 36 | 25-02-2004 01:06 |
| using single solenoid like a double | SteveO | Programming | 14 | 02-02-2004 22:51 |