|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
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 |
|
|
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 |