Arduino OBD-II UART adapter questions and inquries by Feanur
[Today at 12:30:37 am]


Bluetooth Bee in Master Mode by actebay
[May 25, 2013, 11:48:52 pm]


Moisture Sensor SKU:SEN0114 by cheng
[May 25, 2013, 05:17:37 pm]


10 DOF Problems ?? by Giri
[May 25, 2013, 01:53:19 pm]


Problem tick value with Wheel encoder SEN0038 by Robotedh
[May 23, 2013, 07:37:58 pm]


GPS/GPRS/GSM simple code by Jose
[May 23, 2013, 06:30:02 pm]


0.3M pixel serial JPEG camera module by moonaab
[May 23, 2013, 02:40:32 pm]


Pan tilt kit Product Code: FIT0004 missing screws by Phoebe
[May 23, 2013, 09:41:51 am]


DFRduino L298p Shield Reverse Problems by jakfourie
[May 23, 2013, 12:01:38 am]

Sorry, this shoutbox does not exist.

Author Topic: Freeduino + URM04 + IO Expansion Shield For Arduino(V5) - not working  (Read 9495 times)

holmes.apprentice

  • Full Member
  • ***
  • Posts: 19
  • Karma: +1/-0
to Ricky and Hector.

it is correct to the COM12.i tried to upload the example sketch of blinking the 13th LED and it works fine.
now i can upload to the board,but on the description below the IDE it was written "avrdude: stk500_getsync(): not in sync: resp=0x00"..
and it is still showing the 13th LED blinking program eventhough I have uploaded the urmsample program after i got that avrdude error.
what does it mean?
and some more, the URM led now is not blinking anymore like usual,but it is still blinking 4 times at the start,but after blinking for 4 times,it does not show any lights anymore :(
does it mean that i already spoiled the URM?? :(
the serial monitor could be open but there is nothing shown.
i tried the urm and the shield on my duemilanove as well,and still it gets the same error,but after that i can open the serial monitor,but the unknown character appears.

i am sorry if i asked too much,i just curious but dont know what to do about it :(
thanks
« Last Edit: May 03, 2012, 10:36:37 pm by holmes.apprentice »

Hector

  • Not an
  • Hero Member
  • *****
  • Posts: 788
  • Karma: +21/-2
    • Follow us on Twitter for coupons and product updates!
Hi,


I'm not sure how you are connecting the URM sensor to the Arduino. But if you are using pins 0, and 1. These are the com pins which the USB uses to communicate with the Arduino. You need to unplug these every time you want to upload a new sample code to your arduino.


In the Serial monitor on the lower right side there is an option to select the BPS make sure it matches your settings in the sample code. This is why you get unknown characters.


In the "device manager" in the control panel you should re-set the com port to the default settings 9600 I believe.

-Hector

Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

holmes.apprentice

  • Full Member
  • ***
  • Posts: 19
  • Karma: +1/-0
Hi,


I'm not sure how you are connecting the URM sensor to the Arduino. But if you are using pins 0, and 1. These are the com pins which the USB uses to communicate with the Arduino. You need to unplug these every time you want to upload a new sample code to your arduino.


In the Serial monitor on the lower right side there is an option to select the BPS make sure it matches your settings in the sample code. This is why you get unknown characters.


In the "device manager" in the control panel you should re-set the com port to the default settings 9600 I believe.

I got the problem now..eveytime i want to upload the sketch, i have to take the shield out first and leave the mega only connected to the pc. now i can get the reading of the distance..my only problem now is i still have this unknown character of Uª keep on appearing on the serial monitor. I have reset the bps setting in the device manager back to default and i have set the serial monitor with the bps of 19200.but still i have this Uª character appearing on the monitor.
another question, anybody have the sketch of controlling two dc motor interfacing with the urm measurement?
which function of the urm that should i take to control the "if" statement of the motor control?

sorry if i asked too much.
thanks :D
« Last Edit: May 06, 2012, 03:00:30 pm by holmes.apprentice »

Hector

  • Not an
  • Hero Member
  • *****
  • Posts: 788
  • Karma: +21/-2
    • Follow us on Twitter for coupons and product updates!
Hi Holmes,


The unknown character, if it is appearing as the first character, it can be ignored. Its from the initialization of the serial monitor. You could try adding a small delay after the Serial.begin statement.
But it should not affect you if it appears only at the beginning.


I don't have a URM/motor sample code. If I come across one I will post it here.
-Hector

Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

Lauren

  • Administrator
  • Hero Member
  • *****
  • Posts: 216
  • Karma: +7/-0
    • Follow us on Twitter for coupons and product updates!
Hi,


I'm not sure how you are connecting the URM sensor to the Arduino. But if you are using pins 0, and 1. These are the com pins which the USB uses to communicate with the Arduino. You need to unplug these every time you want to upload a new sample code to your arduino.


In the Serial monitor on the lower right side there is an option to select the BPS make sure it matches your settings in the sample code. This is why you get unknown characters.


In the "device manager" in the control panel you should re-set the com port to the default settings 9600 I believe.

I got the problem now..eveytime i want to upload the sketch, i have to take the shield out first and leave the mega only connected to the pc. now i can get the reading of the distance..my only problem now is i still have this unknown character of Uª keep on appearing on the serial monitor. I have reset the bps setting in the device manager back to default and i have set the serial monitor with the bps of 19200.but still i have this Uª character appearing on the monitor.
another question, anybody have the sketch of controlling two dc motor interfacing with the urm measurement?
which function of the urm that should i take to control the "if" statement of the motor control?

sorry if i asked too much.
thanks :D


Hi,

1. Actually , there's a simple to upload the code to the Arduino. You could remove the one of three jumpers(which used to connect the RS485 chip to the Arduino) before uploading code. In this way the RS485 will not affect the communication between your computer and your Arduino board.

2. You know, the communication between the URM04 and the Arduino is also using the TTL pins. So some strange characters such as the "Uª" you got are just the commands you sent to the URM04. So don't worry about it

 ;)
Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

holmes.apprentice

  • Full Member
  • ***
  • Posts: 19
  • Karma: +1/-0
to HECTOR & LAUREN,

thanks guys,you guys really helped me so much in here. I got the URM works now despite i still have that unknown character, but i dont think it will affect the function in the code. thanks :)

anyway, if i want to integrate the URM measurement with the motor,which data that should i call from the urm code?
for example, i want to make my robot stop when the urm reads the distance between the robot and the obstacle for 20 cm. so my question is how to write the code so that when the measurement is 20 cm, it stop the robot?
I used 2 dc motors for the robot and used L298 for controlling the motor anyway.

thanks for the help guys :)

best regards,
holmes.apprentice

Hector

  • Not an
  • Hero Member
  • *****
  • Posts: 788
  • Karma: +21/-2
    • Follow us on Twitter for coupons and product updates!
Hi Holmes,


I'm not sure of the exact code you need to use, but here is some pseudo code, its only a suggestion.


You will need to take the data from urm and store it in a variable, then compare it to the value you are looking for (20cm) and if it is equal or lower then stop, or whatever action you need to take.


read.urm;
store urm.value;
compare urm.value, limit; //(20cm)
if (urm.value <= limit){ //if equal or less than
 whatever action you need to take here.






Remember, this is just pseudo code and will not work as is. You need to turn it into proper code. Just off the top of my head what you need to do.











-Hector

Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

holmes.apprentice

  • Full Member
  • ***
  • Posts: 19
  • Karma: +1/-0
Hector,

thanks,I'm trying to create the code now, actually the pseudo code that you gave just the same as what i was thinking before,but thanks anyway :D
I'm still trying to understand which function that the URM sample code used to store the measured data.

I have a question about the extension shield v5. If i want to use the 485 interface,as well as the xbee and the servo pin all at the same time, what will happen to the 3 jumper? I mean where should i put the jumper?
thanks :)

Hector

  • Not an
  • Hero Member
  • *****
  • Posts: 788
  • Karma: +21/-2
    • Follow us on Twitter for coupons and product updates!
Hi,


A regular Arduino only has 1 Serial communication port (also known as TTL, or UDP port). (Digital Pins 0 and 1: Tx,Rx). So you can only use this port to communicate with 1 item at a time.


There is a possibility to use a software serial port on a regular arduino, but this port from what I understand, is not as fast and also requires a library. Also, the Expansion shield is hardwired for the Xbee and the RS-485 to only use Serial port0, you would need to wire everything manually.


If you really need to use the 2 devices (Rs-485, Xbee) and size is not an issue, you should use a MEGA 2560 along with the MEGA Expansion shield V2.1 This shield has 3 Xbee slots, and you can also solder in the proto area the RS-485 circuit.




The mega has 4 Serial ports I believe.
-Hector

Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

arduinofish

  • Full Member
  • ***
  • Posts: 27
  • Karma: +0/-0
Re: Freeduino + URM04 + IO Expansion Shield For Arduino(V5) - not working
« Reply #39 on: June 03, 2012, 08:16:09 pm »
Is it possible to run the URM4 with an SerialEvent? I just got run in the loop-Loop but not with SerialEvent.

Thanks
Peter

 

SimplePortal 2.3.4 RC1 © 2008-2011, SimplePortal