Author Topic: Arduino Code  (Read 8093 times)

0 Members and 1 Guest are viewing this topic.

Offline JSH21Topic starter

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Arduino Code
« on: August 22, 2008, 02:06:02 PM »
OK, i am making a wall avoiding robot being driven by 2 continuous rotation servo motors, with a Sharp GP2D12 IR sensor and was wondering if anyone had a code for doing such task. It is using an Arduino Diecimila board, and i have checked several posts and sites for a code but most of them use ultrasonic sensors or are driven by motors instead of servos. So any help would be appreciated

and also, is this the correct way to connect the sensors and servo's to the board?
http://www.societyofrobots.com/robotforum/index.php?action=dlattach;topic=3653.0;attach=1420;image
« Last Edit: August 22, 2008, 02:11:14 PM by JSH21 »

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Arduino Code
« Reply #1 on: August 22, 2008, 04:49:15 PM »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline JSH21Topic starter

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: Arduino Code
« Reply #2 on: August 22, 2008, 09:34:43 PM »
This tutorial uses motors to move the robot, but my robot is using continuous rotation servos

Offline JSH21Topic starter

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: Arduino Code
« Reply #3 on: August 22, 2008, 09:36:04 PM »
and an ultrasonic sensor not IR

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Arduino Code
« Reply #4 on: August 23, 2008, 05:56:17 AM »
Ok, to use the servo motors with Arduino, you have to download and install the Servo.h library from here: http://www.arduino.cc/playground/uploads/ComponentLib/servo.zip and read about using it here: http://www.arduino.cc/playground/ComponentLib/Servo

You can read about using a GP2D12 sensor here: http://www.arduino.cc/playground/Main/ReadGp2d12Range

Good luck!

Edit: Yes, the image shows the correct way to connect the servos and the sensor to Arduino board. There is a page that shows the way to connect different things to Arduino here: http://wiring.org.co/learning/tutorials/diagrams.html
« Last Edit: August 23, 2008, 06:03:53 AM by Ro-Bot-X »
Check out the uBotino robot controller!

Offline JSH21Topic starter

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: Arduino Code
« Reply #5 on: August 23, 2008, 09:14:11 AM »
Thank you very much!:) that helped A LOT
but just one more question, how do you get the servo library from the file from the first link?
Is it actually a software that controls servo's or is it somehting you have to add on and to where?
and do i still write all my codes into the "blink" software that i used to test the flashing LED?
or is there another program i use?
« Last Edit: August 23, 2008, 09:37:53 AM by JSH21 »

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Arduino Code
« Reply #6 on: August 24, 2008, 06:33:09 AM »
Quote from the second link:
Quote
You can find the code in http://www.arduino.cc/playground/uploads/ComponentLib/servo.zip. Unpack that into your lib/targets/libraries folder to add the library.

Everything you need is explained there. Take some time to read through and use the links on the left to see other code samples, even if they are not related to what you need to do. It will help you understand how things are working in the Arduino software.
Check out the uBotino robot controller!

Offline JSH21Topic starter

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: Arduino Code
« Reply #7 on: August 24, 2008, 10:23:27 AM »
I cant seem to find the location where you are suipposed to unpack the files

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Arduino Code
« Reply #8 on: August 28, 2008, 07:51:39 PM »
This uses the same microcontroller as the Arduino:
http://www.societyofrobots.com/robot_50_robot_sharpIR.shtml

 


Get Your Ad Here

data_list