Change I2C Address SRF10
Change I2C Address of SRF10
| Address | Long Flash | Short flashes | |
| Decimal | Hex | ||
| 224 | E0 | 1 | 0 |
| 226 | E2 | 1 | 1 |
| 228 | E4 | 1 | 2 |
| 230 | E6 | 1 | 3 |
| 232 | E8 | 1 | 4 |
| 234 | EA | 1 | 5 |
| 236 | EC | 1 | 6 |
| 238 | EE | 1 | 7 |
| 240 | F0 | 1 | 8 |
| 242 | F2 | 1 | 9 |
| 244 | F4 | 1 | 10 |
| 246 | F6 | 1 | 11 |
| 248 | F8 | 1 | 12 |
| 250 | FA | 1 | 13 |
| 252 | FC | 1 | 14 |
| 254 | FE | 1 | 15 |
#include <Wire.h>
#define ADDRESS byte(0x72) //defines address
#define NEW_ADDRESS byte(0xEC) //defines address
#define CMD byte(0x00)
void setup() {
// put your setup code here, to run once:
Wire.begin(); //conects I2C
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
delay(5000);
Serial.println("Begin");
Wire.beginTransmission(ADDRESS);
Wire.write(CMD);
Wire.write(byte(0xA0));
Wire.endTransmission();
//delay(100);
Wire.beginTransmission(ADDRESS);
Wire.write(CMD);
Wire.write(byte(0xAA));
Wire.endTransmission();
//delay(100);
Wire.beginTransmission(ADDRESS);
Wire.write(CMD);
Wire.write(byte(0xA5));
Wire.endTransmission();
//delay(100);
Wire.beginTransmission(ADDRESS);
Wire.write(CMD);
Wire.write(NEW_ADDRESS);
Wire.endTransmission();
Serial.println("END");
delay(5000);
}
Comments
Post a Comment