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
long duration, inches, cm;
pinMode(9, OUTPUT);// attach pin 3 to Trig
pinMode (8, INPUT);//attach pin 4 to Echo
duration = pulseIn(8, HIGH);
// convert the time into a distance
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
outtoezb += "D1=";
outtoezb += inches;
outtoezb += ":";
char tempout[outtoezb.length() + 1];
outtoezb.toCharArray(tempout,outtoezb.length() + 1);
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.