2
$\begingroup$

Does anyone know if this is possible? It's just an i2c device right? I mean you would have to cut the cable and make it so you could plug into the pins on the Arduino but you should just be able to use the wire library and say something like.

Wire.beginTransmission(0x10);

the NXT hardware developers kit tells you what pins are which http://mindstorms.lego.com/en-us/support/files/default.aspx

Thanks

EDIT. Turns out this is very possible. The main problem was that HiTechnic says the address is 0x10 and it is actually 0x08 but here is a short sketch that reads and prints some into about the device, i.e. the manufacturer and version.

#include <Wire.h>

#define ADDRESS 0x08

void setup()
{
  Wire.begin();
  Serial.begin(9600);
}

void loop()
{
  readCharData(0, 7);
  Serial.println();    
  readCharData(8, 8);
  Serial.println();
  readCharData(16, 8);
  Serial.println();

  Serial.println("-----------------------------");

  delay(1000);
}

void readCharData(int startAddress, int bytesToRead)
{
  Wire.beginTransmission(ADDRESS);
  Wire.write(startAddress);
  Wire.endTransmission();

  Wire.requestFrom(ADDRESS, bytesToRead);

  while(Wire.available()) 
  {
     char c = Wire.read();
     Serial.print(c);  
  }
}
| improve this question | | | | |
$\endgroup$
4
$\begingroup$

Per the schematics of the UltraSonic Sensor the P1.3/SCL is DIGIAI0 or J1.5 and P3.0/SDA is DIGIAI1 or J1.6. And the developer Kit Manual states it is I2C as per philips original standard, detailing all the memory address's of the ESC015 chip and with all the recommended interfacing circuitry. The only note that I see is that they state the I2C's SCL is 9600. Kind of slow. But all very do-able for an Arduino. check out http://www.openelectrons.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=7 as they have a shield to directly connect and libraries for the Arduino.

| improve this answer | | | | |
$\endgroup$
  • $\begingroup$ Thanks! Two quick questions. Where did you find the schematics of the UltraSonic Sensor? I saw the PDF with the command protocols in it but no schematic. Also (Just for fun) I want to try hacking it directly into the Arduino - (although I am sure i will get a shield at some point). Shouldn't I just be able to use the wire library already in the Uno? $\endgroup$ – Kenn Feb 7 '13 at 15:18
  • $\begingroup$ you above provided link had a button for hardware developer kit and then a button for down load, which gets a HDK_Downloadzip, which contains all the PDF's of individual schematics and manual. cache.lego.com/Media/Download/Mindstorms2SupportFilesDownloads/… $\endgroup$ – mpflaga Feb 7 '13 at 15:50
  • $\begingroup$ I don't see a schematic. but the pictures show no extra chips. And I believe it should be straight up simple wiring. So it should be simple enough to just wire it up with out the shield. $\endgroup$ – mpflaga Feb 7 '13 at 16:03
  • $\begingroup$ I found on page 9 of the HDK where is explains pin 5 is the CLK and pin 6 is the DATA line, I am assuming the prototypeboard takes 5 volts? shrug guess I will find out, I will let you know if smokes :) and again, I don't think I even need to analog wire (pin 1) on page 6 of the HDK pdf. Thanks for you advice. $\endgroup$ – Kenn Feb 7 '13 at 16:54
1
$\begingroup$

According to the HiTechnic page for the prototype board it communicates with the NXT brick. As such it is possible for the Arduino to communicate with it. The one caveat would be whether they have correctly implement I2C. If they haven't then you likely could still use it but it would take additional work.

| improve this answer | | | | |
$\endgroup$
  • $\begingroup$ I can see from the NXT HDK that pin 5 and 6 are used for I2C communication anyone know which is clock and which is data? Also. I assume in this case I don't need pin 1, the analog input right? this is all coming from page 6 of the HDK pdf. $\endgroup$ – Kenn Feb 7 '13 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.