Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 I2C i2c(PB_9, PB_8); 00004 Serial debug(SERIAL_TX, SERIAL_RX); 00005 00006 char data [255]; 00007 int i; 00008 int main() 00009 00010 { 00011 debug.format(8,Serial::None,1); 00012 debug.baud(115200); 00013 debug.printf("started.. \n"); 00014 // Scan for I2C devices that reply with ack 00015 for (i=0; i<=254; i=i+2) { 00016 if (i2c.read(i, &data[0], 1) ==0) 00017 { 00018 debug.printf("I2C device detected at address=%2.2X\n\r", i); 00019 } 00020 } 00021 }
Generated on Fri Aug 26 2022 14:13:39 by
1.7.2