go away spammer

Author Topic: Questions about the $50 dollar robot in programming section  (Read 2693 times)

0 Members and 1 Guest are viewing this topic.

Offline amadordTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Questions about the $50 dollar robot in programming section
« on: March 14, 2010, 03:00:51 PM »
I am about to create my own photovore robot. I bought an Arduino Duemilanove instead . My question is , in the programming section of the guide it tells to download photovore source code and compile it and upload it to the microcontroller, do you think this is compatible with the Arduino Duemilanove ???   Is there a risk in breaking a microcomputer when uploading incompatible code. Im just a beginner and need guidance. thanks

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: Questions about the $50 dollar robot in programming section
« Reply #1 on: March 14, 2010, 03:04:45 PM »
There is no risk in breaking the microcontroller - you can't upload "wrong" code because before the computer attempts to flash the microcontroller, the compiler checks to see if the code is ok. If the code is wrong, it will stop the upload and tell you what is wrong. Of course, if you change fuses you could do something but don't worry about that now since with Arduino it is tough to change them.

See http://www.societyofrobots.com/member_tutorials/node/240  for arduino compatible code.

Offline Xyver

  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 0
Re: Questions about the $50 dollar robot in programming section
« Reply #2 on: March 14, 2010, 04:16:57 PM »
I just finished my 50$ robot with my arduino as well.  Heres the code if you like:

// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

#include <Servo.h>

Servo leftservo;  // create servo object to control a servo
Servo rightservo;

int potpin0 = 0;  // analog pin used to connect the potentiometer
int left;    // variable to read the value from the analog pin
int potpin1 = 1;
int right;
void setup()
{
  leftservo.attach(7);  
  rightservo.attach(8);
  rightservo.write(90);
  leftservo.write(90);
  delay(1000);
}

void loop()
{
  left = analogRead(potpin0);  
  right = analogRead(potpin1);
  
  if(left < right)
  { leftservo.write(75);
  rightservo.write(90);}
  
  else if (left > right)
  { leftservo.write(90);
  rightservo.write(105);}
  
  else
  {leftservo.write(75);
  rightservo.write(105);}
 
}

Offline amadordTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Questions about the $50 dollar robot in programming section
« Reply #3 on: March 14, 2010, 08:16:00 PM »
thanks guys for clearing that up and thanks for the code xyver. I let you know how it goes

Offline amadordTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Questions about the $50 dollar robot in programming section
« Reply #4 on: March 15, 2010, 07:40:53 AM »
I got another question. Since the duemilanove comes with usb connection , I can just use a usb cable to program the microcontroller right? Or do I have to use an ICSP programmer?

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.
Re: Questions about the $50 dollar robot in programming section
« Reply #5 on: March 15, 2010, 07:57:25 AM »
You can use the Arduino IDE to program the microcontroller no need the ICSP programmer.
Here is the more complete code for Arduino IDE photovore robot.
http://www.societyofrobots.com/robotforum/index.php?topic=7759.msg59924#msg59924

Offline amadordTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Questions about the $50 dollar robot in programming section
« Reply #6 on: March 15, 2010, 08:03:14 AM »
You can use the Arduino IDE to program the microcontroller no need the ICSP programmer.
Here is the more complete code for Arduino IDE photovore robot.
http://www.societyofrobots.com/robotforum/index.php?topic=7759.msg59924#msg59924

thank you very much! I  will let you know how it goes

 


Get Your Ad Here

data_list