X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=I2CScanner%2FI2CScanner.ino;h=f1b6fe70f0d1cc29b7a222a40c46c1b7dc4957e3;hb=HEAD;hp=f8fd38a97483ea65cc1acdcd4b9735676ce42b08;hpb=13f7d14ef6df3858304bed9c09d617eeb50652c2;p=Arduino diff --git a/I2CScanner/I2CScanner.ino b/I2CScanner/I2CScanner.ino index f8fd38a..f1b6fe7 100644 --- a/I2CScanner/I2CScanner.ino +++ b/I2CScanner/I2CScanner.ino @@ -31,27 +31,27 @@ void scanI2CBus(byte from_addr, byte to_addr, // (like adding I2C comm code to figure out what kind of I2C device is there) void scanFunc( byte addr, byte result ) { Serial.print("addr: "); - Serial.print(addr,DEC); + Serial.print(addr,HEX); Serial.print( (result==0) ? " found!":" "); Serial.print( (addr%4) ? "\t":"\n"); } -byte start_address = 1; -byte end_address = 100; +byte start_address = 0x01; +byte end_address = 0x7F; // standard Arduino setup() void setup() { Wire.begin(); - Serial.begin(19200); + Serial.begin(9600); Serial.println("\nI2CScanner ready!"); Serial.print("starting scanning of I2C bus from "); - Serial.print(start_address,DEC); + Serial.print(start_address,HEX); Serial.print(" to "); - Serial.print(end_address,DEC); + Serial.print(end_address,HEX); Serial.println("..."); // start the scan, will call "scanFunc()" on result from each address @@ -68,4 +68,4 @@ void loop() delay(300); digitalWrite(13,LOW); delay(300); -} \ No newline at end of file +}