Hi,

 

I'm trying to help Ambroise to installing MRL, but impossible to compile the MRLComm.ino into his Arduino Mega board .

The problem is that Newping.h is missing . I've tried with my arduino duemilanove board and same problem .

So i've downloaded Newping library and add it in my arduino's IDE for install the .ino (copy/paste from MRL gui) with it and this worked, but it must be a problem in MRL wink

Or maybe i've forget something ..

I'm attaching the library Newping  if someone need it . Just extract it and put the folder in the "library" folder of your arduino install folder.

 

beetlejuice

10 years 5 months ago

Ok, Newping was for ultrasonic sensors,right ? so if you remove it, ultrasonic will stop to work ?

i'm talking about this script :

 

# variables dependent on your setup

boardType = "atmega2560"  # atmega168 | atmega328p | atmega2560 | atmega1280 | atmega32u4
comPort = "COM8" # com4 for atmega328 com8 for mega2560
trigPin = 22
echoPin = 23

# start Arduino service named arduino
arduino = Runtime.createAndStart("arduino", "Arduino")
arduino.setBoard(boardType) # atmega168 | mega2560 | etc
arduino.connect(comPort)
# Start UltrasonicSensor named sr04
sr04 = Runtime.createAndStart("sr04", "UltrasonicSensor")
sr04.attach(arduino, trigPin, echoPin)

# blocking examples
duration = sr04.ping()
print duration
range = sr04.range()
print range

# non blocking - event example
# sr04.startRanging()

GroG

10 years 5 months ago

In reply to by beetlejuice

Ya .. here is the history / evolution

1. tried Arduino's pulseIn - too slow interfered with servo movement
2. tried NewPing in the hope that it would have better performance .. it did not.
 

So right now I don't want to use either pulseIn or NewPing, but I might put pulseIn back in until I re-write it with a much faster method.

Your fix should work with the script for version 1.0.27 if you or Amby want to experiment with it.

ambroise

10 years 5 months ago

thank you for your help beetlejuice

i cheking if i can find a tuto for learn

sse you