|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
We have a globe motor set to a speed controller on the RC and we have two digital switches on the OI to control it. What do we set the PWM to in the Serout command?
|
|
#2
|
|||||
|
|||||
|
Here's my suggestion:
Code:
globe_motor VAR byte ' put this in the "declare variables" section ' Main Loop: globe_motor = 127 + (127*switch_one) - (127*switch_two) With this code, the motor will turn CW if switch_one is pressed, and CCW if switch_two is on. If both are pressed, nothing happens. Hope I helped, feel free to ask any question. ![]() |
|
#3
|
|||
|
|||
|
Just a quick question -
Is PBASIC operand supportive? For example, would it work mathematically left to right, do exponents before subtraction, etc? |
|
#4
|
|||||
|
|||||
|
It works from left to right, period.
For example: 3+2*6 In normal math, you would multiply 2 by 6 and then add 3, for a total of 15. In PBasic, you sum 2 to 3 and then multiply by 6, resulting in 30. You have to use parentheses if you want to give any operation priority over another. Hope I was clear. ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Globe Motor | archiver | 2000 | 4 | 06-24-2002 12:15 AM |
| Globe Motor | archiver | 2000 | 0 | 06-24-2002 12:15 AM |
| So you want to stall a Globe Motor... | archiver | 2000 | 1 | 06-24-2002 12:09 AM |
| Globe Motor and Thermal Protection | archiver | 1999 | 0 | 06-23-2002 10:03 PM |
| Help! Need a Globe Motor | Dodd | Motors | 0 | 07-24-2001 11:57 AM |