![]() |
Globe Motor
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?
|
Here's my suggestion:
Code:
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. :) |
Just a quick question -
Is PBASIC operand supportive? For example, would it work mathematically left to right, do exponents before subtraction, etc? |
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. :) |
| All times are GMT -5. The time now is 06:53. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi