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
- Committer:
- stefkpl
- Date:
- 2016-10-14
- Revision:
- 0:392956e976ae
- Child:
- 1:3a2023b0563c
File content as of revision 0:392956e976ae:
#include "mbed.h"
 // Test DUMP I2C
#define _ADDR     (0x43) 
 
I2C i2c(I2C_SDA, I2C_SCL);
 
DigitalOut myled(LED1);
 
Serial pc(SERIAL_TX, SERIAL_RX);
  
int main()
{
    int status = i2c.write(_ADDR);
    pc.printf("Begin Scan\r\n");
    
    // Read all register
    data_write[0] = LM75_REG_TEMP;
    i2c.write(LM75_ADDR, data_write, 1, 1); // no stop
    i2c.read(LM75_ADDR, data_read, 2, 0);
    while (1) {
        myled = !myled;
        wait(0.2);
 
}