Go to Post I think this just hit the nail in the head with a sledgehammer. - Yan Wang [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
  #1   Spotlight this post!  
Unread 19-02-2004, 15:06
MisterX's Avatar
MisterX MisterX is offline
Alumni
AKA: Mr. X
FRC #0521
Team Role: College Student
 
Join Date: Feb 2003
Rookie Year: 2000
Location: Around
Posts: 486
MisterX is a splendid one to beholdMisterX is a splendid one to beholdMisterX is a splendid one to beholdMisterX is a splendid one to beholdMisterX is a splendid one to beholdMisterX is a splendid one to behold
Thumbs down line seeking help needed

I have this and i know it works but i have 3 digital ins that are set as inputs
rc_dig_in01
rc_dig_in02
rc_dig_in03
they are all optical sensors, i know the optical sensors are working properly becuase i get on and off lights on the operator interface. I just cant seem to "word" the way to get all 3 sensors to work together.
roughly i want tit to work like this

if dig in 1 is on then it should turn left
if dig in 2 is on both motors should dturn equally
if dig in 3 is on then it should turn right

PWM01= left side drive
PWM02= right side drive

... but how do i get the sesors to all work together.
I cant seem to think on how to get them to all work together i tried a switch statement and stacking else if 's i just cant think of how to get it to work.

Code:
if (rc_dig_in02 == 1) {
    pwm01= 200;
    pwm02= 200; 
}
else {
    pwm01= 127;
    pwm02= 127;
}
 


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
Sprockets and Roller Chain Models Madison Inventor 3 04-02-2003 11:51
Q&A Discuss: Does the line continue up the ramp? CD47-Bot Extra Discussion 5 18-01-2003 01:01
iParts on firstcadlibrary.com Ed Sparks Inventor 3 08-01-2003 23:30
approach to autonomy Mike375 Programming 32 08-01-2003 14:04
emulationFIRST v0.04 Matt Leese Programming 7 09-07-2002 08:54


All times are GMT -5. The time now is 04:19.

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