Go to Post you, sirs, are most definately gracious proffesionals. - Leav [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-05-2007, 20:53
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: Single Click On/Off Using the Trigger in EasyC

This how we did a click on click off
Code:
    if(CLAW_BUTTON == 1 && claw_toggle_state == 0)       // Code to handle toggle
    {
        CLAW_OPEN = !CLAW_OPEN;
        CLAW_CLOSED = !CLAW_CLOSED;
    }

    claw_toggle_state = CLAW_BUTTON;
  #2   Spotlight this post!  
Unread 30-05-2007, 21:24
IraJason IraJason is offline
In Search of "Bang Head Here" Sign
AKA: Ira Goldberg
FRC #3632 (D-Tecs); FRC #1712 (Dawgma)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Lower Merion, PA
Posts: 283
IraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant future
Send a message via AIM to IraJason Send a message via MSN to IraJason
Re: Single Click On/Off Using the Trigger in EasyC

Quote:
Originally Posted by bear24rw View Post
This how we did a click on click off
Code:
    if(CLAW_BUTTON == 1 && claw_toggle_state == 0)       // Code to handle toggle
    {
        CLAW_OPEN = !CLAW_OPEN;
        CLAW_CLOSED = !CLAW_CLOSED;
    }

    claw_toggle_state = CLAW_BUTTON;
It has been a few months since I've done computer programming, so from what I'm getting now, if the button is pressed and the claw_toggle_state = 0, and CLAW_OPEN and CLAW_CLOSED becomes not what it's previous state was. The claw_toggle_state then becomes 1 when it is pressed.

This means in my code I should have:
Code:
if(p1_sw_trig && cathode_toggle_state == 0)
{
    OItoRelay(1,1,1,1);
}

cathode_toggle_state = p1_sw_trig;
I think that should be right, but feel free to correct me.
__________________
Many respectable physicists said that they weren't going to stand for this - partly because it was a debasement of science, but mostly because they didn't get invited to those sort of parties."
-Douglas Adams The Hitchhiker's Guide to the Galaxy

2007 Galileo #6 seed, 5th Alliance Captain, Semi-finalist
2007 Philly Regional #4 Seed, Philly Regional GM Industrial Design Award Winner
2006 Philly Regional Highest Rookie Seed,Philly Regional Rookie All Star
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 11:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi