Author Topic: Complete Beginer questions  (Read 2717 times)

0 Members and 1 Guest are viewing this topic.

Offline michaelghayesTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Complete Beginer questions
« on: January 30, 2009, 04:11:40 PM »
I am a complete beginner, and I have VERY little programing experience and no robotics experience.
I have an axon controller 2 sharp IR sensors, and 2 continuous rotation servos.
what I want to do is build a simple robot that moves around until it detects a wall within 30cm and then have it turn, if the object/wall is on the right it would turn slightly left, or if the wall is on the left have it turn slightly right.  I have enough experience that if i could get the sensor data in the form of a distance in a standard variable I could program the rest, I have figured out how to define the wheels and make them spin, but I cant figure out how to get the sensor data into a usable format.  I found the converter in the sensors.c of the source code, but i don't know how to use it or how to define where the sensor is (what pins).

If i could get the sensor data in the corect form i would use a simple program that would be somthing like


while(1)
if left_sensor is less than 30 turn left wheel 800, right wheel 400
else if right_sensor is less that 30 turn left wheel 400, right wheel 800
else turn left wheel 600, right wheel 600
etc...

 will eventually make it much more complex, but for now this is all i am capable of...

another question i had is how do you hook up photo resistors as sensors for a photovore type application
thanks for your help, and im sorry if this is not clear or it has all already explained somewhere all the stuff i found on the forum seemed to be for much more advanced people.

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: Complete Beginer questions
« Reply #1 on: January 30, 2009, 04:17:16 PM »

Offline michaelghayesTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: Complete Beginer questions
« Reply #2 on: January 30, 2009, 04:20:02 PM »
thanks

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,704
  • Helpful? 173
    • Society of Robots
Re: Complete Beginer questions
« Reply #3 on: January 31, 2009, 07:17:01 AM »
The default source code for the Axon is a photovore. It compares to sensors, then moves the robot to the sensor getting the most light.

Just swap out the photoresistors for Sharp IR and it'll either avoid walls or aim itself toward walls, depending on how you position the Sharp IR. No coding required!

 

SMF spam blocked by CleanTalk