Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Installation & Troubleshooting / Re: Can´t upload any code. Help please. on: Today at 06:29:34 am
Hi,

The problem is back! So before I was just lucky but I didn´t solve the main problem. Now I want to follow all the steps on the link you sent me.

I need help please to do that as there are things that I don´t understand. First of all, I can´t see if my ArduinoUNO carries and ATmega8U2 chip or an ATmega16U2 as the Arduino doesn´t show on Device Manager. However, I bought this new Arduino a few days ago. Is it possible for it to carry stilll the older ATmega8U2 chip? What happens if I update the firmware but I have the updated ATmega16U2 chip version already?

In case I somehow determine that I have the ATmega8U2 chip which one of the following files do I need to download for my Arduino UNO?


arduino-usbdfu   Moving ATmegaXXU2 firmwares into subdirectory.   

arduino-usbserial   Moving ATmegaXXU2 firmwares into subdirectory.   

Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex   Moving ATmegaXXU2 firmwares into subdirectory.   

Arduino-COMBINED-dfu-usbserial-atmega16u2-MegaADK-Rev3.hex   Moving ATmegaXXU2 firmwares into subdirectory.   

Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex   Moving ATmegaXXU2 firmwares into subdirectory.   

MEGA-dfu_and_usbserial_combined.hex   Moving ATmegaXXU2 firmwares into subdirectory.   

UNO-dfu_and_usbserial_combined.hex   Moving ATmegaXXU2 firmwares into subdirectory.   


I'm not sure neither how to upload using Flip but I can have a look later when I know which file to upload. Sorry johnwasser for making so many questions. On my defense I can tell you that I read the README.txt but I don´t have enough knowledge to understand it. And sorry also vishnuX for not being able to help you so far.
2  Topics / Robotics / Re: Help please to improve this obstacle avoiding robot project. on: April 23, 2014, 09:08:18 pm
Thank you for the correction widbill. But I don´t know where to put the if statements either. I tried different ways to put them in but I haven´t been successful to make it work so far.
3  Topics / Robotics / Re: Help please to improve this obstacle avoiding robot project. on: April 23, 2014, 02:25:00 pm
I still can´t make the code  work on my robot. Any help is more than welcome.
4  Using Arduino / Installation & Troubleshooting / Re: Can´t upload any code. Help please. on: April 23, 2014, 10:01:09 am
Hi Johnwasser,

i am using an Arduino UNO which I bought a few days ago, so in theory it should be the newer version.

You were right and the problem now seems to be solved. But I am now puzzled because I only downloaded the DFU programmer. I didn´t down download however de firmware update and didn´t reset using 8u2.

Is there a way that by only downloading the DFU programmer the problem was solved?

Thanks!!!
5  Using Arduino / Installation & Troubleshooting / Can´t upload any code. Help please. on: April 23, 2014, 07:22:52 am
Hi,

my Arduino isn´t working any more. I can´t upload any new code and I can´t see the Arduino on the device manager. I have tried the troubleshooting: restarting the Arduino and the PC, unplug and plug the Arduino, taking off the PC power source, pressing the reset botton when uploading, etc. Nothings seems to be working.

I also tried with other Arduinos connected to my PC and they work propertly. So I don´t think this isn't a drivers problem.

My PC runs Windows 7. Help please. Thanks!
6  Topics / Robotics / Re: Help please to improve this obstacle avoiding robot project. on: April 22, 2014, 05:52:27 pm
The use of a variable that goes from 0 to 1 sounds very good to me. However, I´m doing something wrong with the way I implement the algorithm.

This is the new code with the counter:
Code:
#include <Servo.h>

int i=0;
Servo motorLeft;          // Define left motor
Servo motorRight;         // Define right motor
#define trigPin A2
#define echoPin A3

void setup() {
 Serial.begin (9600);
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);
 motorLeft.attach(A5);  // Set left motor to digital pin 4
 motorRight.attach(A4);  // Set right motor to digital pin 7
}

void loop() {
  int duration, distance;
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(1000);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
  if (distance >= 30 || distance <= 0){
    Serial.println("Out of range");
    motorLeft.write(20);
    motorRight.write(20);
  }
  else   
    if (i=0);{
    Serial.print(distance);
    Serial.println( "cm");     
    motorLeft.write(170);
    motorRight.write(10);
    }
    if (i=1);{
    Serial.print(distance);
    Serial.println( "cm");     
    motorLeft.write(10);
    motorRight.write(170);
    }   
    if (i++ == 2) i = 0;         
  }

The motors don´t run propertly but instead they kind of start and stop running continuously. 

Can you tell me what is wrong please?
7  Topics / Robotics / Re: Help please to improve this obstacle avoiding robot project. on: April 22, 2014, 02:24:10 pm
Hi Northof49,

That's right. I want for the robot to alternate the turns blindly as it carries only one ultrasonic sensor.

Thanks!
8  Topics / Robotics / Help please to improve this obstacle avoiding robot project. on: April 22, 2014, 10:52:55 am
Hi there,

I have made this simple code for an obstacle avoiding robot. When the ultrasonic sensor detects an obstacle the robot turns in one direction. The mod I need is a way to make the robot turn in one direction first and then in the other direction when it detects the next obstacle.

Code:
#include <Servo.h>

Servo motorLeft;           // Define left motor
Servo motorRight;         // Define right motor
#define trigPin A2
#define echoPin A3

void setup() {
 Serial.begin (9600);
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);
 motorLeft.attach(A5);          // Set left motor to  pin A5
 motorRight.attach(A4);      // Set right motor to pin A4
}

void loop() {
  int duration, distance;      // ultrasonic sensor routine
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(1000);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
  if (distance >= 30 || distance <= 0){  
    Serial.println("Out of range");
    motorLeft.write(85);      // robot go forward routine
    motorRight.write(85);
  }
  else
  {
    Serial.print(distance);  
    Serial.println( "cm");    
    motorLeft.write(170);     // robot turn right routine
    motorRight.write(10);  
  }
  delay(100);
}

The robot is controlled by an Arduino UNO R3 and uses two modified 360 continuous rotation servo motors.

Wiring to analog pins: Trig to A2, Echo to A3, left motor to A5 and right motor to A4.

I don´t know how to do this modification to the code miself so please help me. Thanks!
9  Topics / Robotics / Re: Can the Arduino save values in the EEPROM memory when they are generated? on: April 15, 2014, 04:51:07 pm
I do see the inconsistency on my knowledge. I have a lot to learn of course!!! I just wanted to point out that I had done a few simple Arduino projects in the past.

As I said before, thanks to you and CrossRoads now I know the basics about Arduino memories and how to interact with them. So I know your are not getting at but giving me good advise instead.

At the moment I have enough to start playing a bit with some code and keep on learning how to program correctly. Sure enough I will keep coming back to the forum for the great support.

Thanks!!!





10  Topics / Robotics / Re: Can the Arduino save values in the EEPROM memory when they are generated? on: April 15, 2014, 01:16:48 pm
Thanks for answering my questions.

Grumpy_Mike I agree with you in the fact that I am not an expert. However, I don´t consider myself a beginer either. I  build my own robots with Arduino and know how to make them avoid obstacules or follow lines,  interact with leds, how to drive them with infrared or radio signals, interact with visual programs like Scratch and some other things as well. So I did the "Hello World" of Arduino by lighting the led 13 and other tutorials a long time ago. All the codes I have written or adapted are available of course to prove what I´m saying.

I am sorry that You think that I ask "the most trivial questions". I haven´t got experience handling EEPROM memory as I mentioned. Regarding where to put the if statemen, I always put them on the loop part of the program. However, a few days ago you told me not to write in the EEPROM memory on a loop as I could damage the memory. Before that I always did this kind of things in SRAM memory also on a loop. So even if this was for reading values not writting, I just wanted to be sure that this if statement went as I thought on the loop part.
11  Topics / Robotics / Re: Can the Arduino save values in the EEPROM memory when they are generated? on: April 15, 2014, 06:26:09 am
The example code is very useful CrossRoads. However, I have a few question about it. Suppose that I'm doing a test for 255 (0xFF), which is the value read back if EEPROM hasn't been written to yet . Why then in the code you sent me shall I store data after the if statement? Why I have to put EEPROM.write (0,21) if I am just trying to know what values were already stored? And yet another question please: that if statement should go In the setup or in the loop?

I tried other retrieving code that I have used before, but now in an Arduino where I have never written anything in the EEPROM before:
Code:
#include <EEPROM.h>
void setup(){
Serial.begin(9600);
}
void loop(){
byte x;
for(int i=0; i<3; i++){
x = EEPROM.read(i);
Serial.println(x);
}
delay(800);
}
On serial monitor the values shown where like this:
105
255
255
105
255
255
......
......
Is the above the 255 (0xFF) message? If it´s not, why I don´t get it as I should?

Thanks your for all the help given so far.
12  Topics / Robotics / Re: Can the Arduino save values in the EEPROM memory when they are generated? on: April 14, 2014, 06:04:03 pm
I understand now that it´s possible to write in EEPROM from the loop but only when data needs to be written.

Regarding the way to test values, if you can give me an example it would help me a lot. I just don´t figure out the way to do it myself.





13  Topics / Robotics / Re: Can the Arduino save values in the EEPROM memory when they are generated? on: April 14, 2014, 03:26:24 pm
I have overwritten EEPROM data while trying that code. Is there a problem or risk for memory if I do so?

There is no way to erase all I have written in EEPROM to start from scratch?

Sorry CrossRoads but I don´t know how to do the test for 255 (0xFF). Can you tell me to do it please?

If I am not wrong you should never try to writte in EEPROM from loop as it would damage the memory. So it looks like a dead end for my project. Sure enough you know something that I don´t so it can be done. ¡Help please to understand this!

Sorry for so many things at once.





14  Topics / Robotics / Re: Can the Arduino save values in the EEPROM memory when they are generated? on: April 14, 2014, 02:43:33 pm
Thank you CrossRoads for the very useful link. I coudn´t find the 8.4 EEPROM Data Memory topic though. I found Memory Types on page 61 instead.

Please Grumpy_Mike and Cross Roads, tell me if the following reasoning is correct. Look at this code:

Code:
#include <EEPROM.h>   
void setup(){
EEPROM.write(0, 20);  //
EEPROM.write(1, 21);
EEPROM.write(2, 22);
}
void loop(){
//code for line follower maze solver in here
}

Let´s supose that in the loop I put the code for a line follower maze solver. At the end of the maze an array has all the right turns in it ( as the wrong turns had been eliminated ).  So lets say that the code I uploaded for the robot to solve the maze tells the Arduino that when the array with the right turns is completed the program has to go back to void setup and save those values in the EEPROM memory with EEPROM.write. Is this the right way to write in EEPROM memory while the sketch is running?

Thanks to you both.
15  Topics / Robotics / Can a sketch write to EEPROM while it is running.? on: April 14, 2014, 01:03:18 pm
Hi there,

I know now thanks to the help I was given in this forum that I can upload values to the EEPROM memory and then retrieve them by uploading another code. However, I would like to know if there is a way to store in the EEPROM memory in real time when the array values are generated.

What I am trying to do is a line follower maze solver. I would like for the robot to save the correct turns in an array directly to the EEPROM memory, so when the robot has finally solved the maze the correct turns remain stored even if the robots is switched off.

Any help or ideas are more than welcome.

Pages: [1] 2 3 ... 5