Hello all,
I wail back I posted some information on using an Arduino as a I2C Sensor controller to use with the EZB3&4
I will post this in 3 stages ..
Stage one.. right here right now.
In this video you can see how im using the arduino to read the ultrasonic sensor . that in turn is being read by the EZB board via I2C.
This is the only code needed to read the ping for the EzBuilder script
print(I2CRead(0, 2,6 ))
The code for the Arduino is
#include
void setup()
{
Wire.begin(2);
Wire.onRequest(requestEvent);
}
void loop()
{
delay(100);
}
void requestEvent()
{
long duration, inches, cm;
pinMode(9, OUTPUT);// attach pin 3 to Trig
digitalWrite(9, LOW);
delayMicroseconds(2);
digitalWrite(9, HIGH);
delayMicroseconds(5);
digitalWrite(9, LOW);
pinMode (8, INPUT);//attach pin 4 to Echo
duration = pulseIn(8, HIGH);
// convert the time into a distance
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
String outtoezb;
outtoezb += "D1=";
outtoezb += inches;
outtoezb += ":";
char tempout[outtoezb.length() + 1];
outtoezb.toCharArray(tempout,outtoezb.length() + 1);
Wire.write(tempout);
}
long microsecondsToInches(long microseconds)
{
return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds)
{
return microseconds / 29 / 2;
}
Phase two will be adding the 3 other ping sensors and a temp sensor to the arduino . I hope to have it all encased together will plugs and off the project board.
I will follow up on this thread as the next phase is done I will provide the code for EzBuilder as well as the arduino code.
Hope yall can use it.
By Luis Vazquez
— Last update
Other robots from Synthiam community
Steve's Marcus The Expressive Android
Marcus the Android with life like expressions and movements modified from a Wow Wee Elvis robot. The robot gets a...
Jeremie's Fridgebot
This isnt a new robot but rather a remix of an old idea I had. Its based off of a robot that I built for a 555 timer...
M's Haw To Make Ez-Bv4 Controller Communicating Via Usb...
dear friends we are working on (non profitable) agricultural robot to combat desertification in Africa pleas see...

Any updates for using more then 1 ping sensor?
This is a very old deprecated thread. You can use as many ping sensors as the hardware supports. The ARC software supports arduino connections directly. Check the getting started guide (link on top of this website) for information.