Author Topic: downloaded simple code to my robot finally!!!!!!!!  (Read 1930 times)

0 Members and 1 Guest are viewing this topic.

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,177
  • Helpful? 5
downloaded simple code to my robot finally!!!!!!!!
« 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
Robots are awesome!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: downloaded simple code to my robot finally!!!!!!!!
« Reply #1 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);

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,177
  • Helpful? 5
Re: downloaded simple code to my robot finally!!!!!!!!
« Reply #2 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. >:(
« Last Edit: February 03, 2008, 08:39:52 PM by Trumpkin »
Robots are awesome!

 


Get Your Ad Here