49 #define SW_I2C_FREQUENCY 400 62 Serial.println(
"*****************************************************************");
63 Serial.println(
"* I2C Address Scan *");
64 Serial.println(
"* *");
65 Serial.println(
"* This program will scan all 128 I2C addresses and report those *");
66 Serial.println(
"* that acknowledge a address+!w command. *");
67 Serial.println(
"* *");
68 Serial.println(
"* Set the baud rate to 115200 select the newline terminator. *");
69 Serial.println(
"* *");
70 Serial.println(
"*****************************************************************");
86 unsigned char ack_count;
87 Serial.println(
"\nSend any character to start the I2C address scan. (Press enter in Arduino Serial Monitor.)");
90 for (address = 0; address < 128; address++)
98 Serial.print(
"Acknowledge received from address : 0x");
99 Serial.print(address, HEX);
100 Serial.print(
" (7 bit) 0x:");
101 Serial.print(address<<1, HEX);
102 Serial.println(
" (8-bit)");
105 if (ack_count == 0) Serial.println(
"No addresses acknowledged.");
Header File for Linduino Libraries and Demo Code.
void i2c_stop()
Write stop bit to the hardware I2C port.
int8_t i2c_start()
Write start bit to the hardware I2C port.
int8_t i2c_write(uint8_t data)
Send a data byte to hardware I2C port.
static void print_title()
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
void quikeval_I2C_connect(void)
Switch MUX to connect I2C pins to QuikEval connector.