### Author Topic: Smoother turning program for the \$50 robot  (Read 1300 times)

0 Members and 1 Guest are viewing this topic.

#### Selenaut-14

• Full Member
• Posts: 60
• Making the \$125 robot...
##### Smoother turning program for the \$50 robot
« on: July 06, 2010, 09:10:21 AM »
Okay, this may sound pretty darn stupid, but I haven't even seen the
normal code (broken leg, no access to a computer). So if you post the original code in a quote I can make a code where it takes the intensity of light in each of the photoresistors and continually converts this to a speed for the corresponding servo, required the servo can vary in speed. The trick is to find the max speed of your motor, a practical threshold for concentration of light, and making a good old fashioned graph that passes right through(0,0). You then find the slope and apply.

EDIT: okay. So the graph's x axis should be concentration of light, and the y axis should be motor/servo speed. X will always be %0-%100. Y will be 0-max rpm. The end algorithm should be n times (max rpm / 100), where n is the numerical form of the percentage of light times 100; in other words, if 25% light was getting through on the photoresistor, and your motor's max rpm was 500, the rpm output would be 125. I guess it would just be max rpm times light intensity.
« Last Edit: July 06, 2010, 02:50:38 PM by Selenaut-14 »
The answer is always yes if it is never no.
--------------
SKILLS:

Building- great
Coding/programming- good
circuitry- pitiful