Go to Post Sometimes, it's all about the people. - nixiebunny [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #22   Spotlight this post!  
Unread 03-01-2003, 13:28
Animator Animator is offline
Registered User
#0120
 
Join Date: Dec 2002
Location: Cleveland
Posts: 11
Animator is an unknown quantity at this point
1 Sensor Code

Here is some code that will allow you to use 1 sensor to control your pump if you need to save on weight.

Keep in mind, if you keep your executable code length short, your serin and serout commands will occur more frequently making your robot respond quicker to inputs and outputs.

Also, debug commands slow down the code execution. Comment them out after you're done with testing. If you want proof, watch the Basic Run light when the debug code is in the program and when it is out. That LED is controlled by:

Toggle 7 'Basic Run LED on the RC is toggled ON/OFF every loop.

in the default program. Everytime the code is executed, the LED is toggled. The faster it blinks. The faster your code is executing.

Sorry to go off the topic. Below is the code:

I tested it in RoboEmu 1.07

------------------------------------------------------------------
' Variables

Counter VAR w10
LowPres VAR rc_swA.bit1
PumpMan VAR oi_swA.bit2 'Aux input,
Pump VAR RelayA.bit0
Pump_rev VAR RelayA.bit1
Counterbit VAR Counter.bit0
CounterMax CON 501 'This number needs to be odd
Counter = CounterMax

MainProgram:

Serin...

'Pump Code for 1 sensor

LowPres = ~LowPres
Counter = ((LowPres) * (Counter + 2)) max CounterMax
LowPres = ~LowPres
Pump = ((LowPres | ~Counterbit) & ~PumpMan)
Pump_rev = 0

Serout...

----------------------------------------------------------------
 


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
Does your team use the Default code. Jeff McCune General Forum 2 09-01-2003 14:46
What are pneumatics? Aignam Pneumatics 23 16-10-2002 21:17
Need help with 255 Variable Joseph F Programming 18 26-02-2002 14:49
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46
Pneumatics pump allowed on robot? bigqueue Pneumatics 5 06-01-2002 12:30


All times are GMT -5. The time now is 23:53.

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