What does NXShield.init( SH_HardwareI2C ); do?

I’m trying to recieve a serial.println back from pressing the Go button on a NXShield.
I was wondering what does NXShield.init( SH_HardwareI2C ); do?


#include <Wire.h>
#include <NXShield.h>
#include <PFMate.h>
NXShield NXShield;
PFMate PFMate;
void setup ()
char str[256];
Serial.begin(115200); // start serial for output
delay(500); // wait, allowing time to activate the serial monitor
Serial.println (“Press GO button to continue”);
Serial.println (“Go pressed”);
// Initialize the i2c sensors.
PFMate.init( &NXShield, SH_BBS2 );

void loop()
char aa[80];
char str[256];
int bb_us;
strcpy(aa, PFMate.getDeviceID() );
sprintf (str, “PFMate: DeviceID: %s”, aa);
strcpy(aa, PFMate.getVendorID() );
sprintf (str, “PFMate: VendorID: %s”, aa);
sprintf (str, “PFMate: loling: %d mm”, bb_us );

Serial Monitor Output:

Press GO button to continue
ERROR: Device-ID or Version mismatch. Device-ID: , Version:

ChromeSnow: I was wondering what does NXShield.init( SH_HardwareI2C ); do?

According to the following page, it initializes the protocol for the NXShield.


Okay so now I have everything working. I noticed that my Arduino's pins were not all the way in the Shield sockets causing the errors! I can now press the Go button which lets me get serial print back. Now it's just getting the PFMate to work. Although slow, I'm getting there!