Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
Make some encoders This seems like a great idea, I will work on this soon. Do you know how to code in C/C++, and are you familiar with the Arduino IDE/toolchain (or whatever you're using)? I would say that I am an intermediate at c, but I don't know too much about c++. But I keep on learning\ and looking at examples.You will also want to clarify your goals - wavefront isn't as easy as, say, obstacle avoidance, and depends partially on being able to get a decent angular resolution for each distance measured (this means that your sonar is probably not going to work out too well, as its field of view is huge as compared to a Sharp IR rangefinder).
// ... read the sonar codesonar_reading_cm; // store the sonar value hereif (sonar_reading_cm < THRESHOLD) { setLeftMotorSpeed(-speed); // causes a leftward turn setRightMotorSpeed(speed);} else { setLeftMotorSpeed(speed); // causes it to drive straight setRightMotorSpeed(speed);}