Society of Robots - Robot Forum

General Misc => Misc => Topic started by: Trumpkin on February 03, 2008, 05:14:45 PM

Title: downloaded simple code to my robot finally!!!!!!!!
Post by: Trumpkin on February 03, 2008, 05:14:45 PM
  I finally got my servos to move backward and forwards. I'm really happy!!  ;D ;D can someone point me to the post or tutorial where it says how to read sensors? I know I saw it somewhere
Title: Re: downloaded simple code to my robot finally!!!!!!!!
Post by: Admin on February 03, 2008, 06:02:59 PM
not sure about the post . . .

but look around for 'ADC', 'analog to digital converter', and here is an example:

Code: [Select]
rangefinder=a2dConvert8bit(5);//sensor is on ADC port 5

//output message to serial (use hyperterminal)
rprintf("Hello, World! Read My Analog: %d\r\n", rangefinder);
Title: Re: downloaded simple code to my robot finally!!!!!!!!
Post by: Trumpkin on February 03, 2008, 06:04:15 PM
thx. there must not be a post. undortunately I just fried my Atmega eight because I was stupid  ::). I will get Atmega168 now and some female headers for Sharp IR sensor......more waiting. >:(