program for I2C master device

Dependencies:   mbed

Fork of I2C_HelloWorld_Mbed by mbed official

Committer:
marcus255
Date:
Tue Dec 01 22:16:18 2015 +0000
Revision:
4:1ec553356dcc
Child:
5:8dc6d7d81250
writing ok, reading in progress

Who changed what in which revision?

UserRevisionLine numberNew contents of line
marcus255 4:1ec553356dcc 1 #ifndef MAIN_H
marcus255 4:1ec553356dcc 2 #define MAIN_H
marcus255 4:1ec553356dcc 3
marcus255 4:1ec553356dcc 4 #include "mbed.h"
marcus255 4:1ec553356dcc 5 #define SLAVE_ADDR 0xA0
marcus255 4:1ec553356dcc 6 #define DATA_SIZE 256
marcus255 4:1ec553356dcc 7
marcus255 4:1ec553356dcc 8 I2C i2c(PTE0, PTE1);
marcus255 4:1ec553356dcc 9 Serial pc(USBTX, USBRX);
marcus255 4:1ec553356dcc 10 DigitalOut led(LED_GREEN);
marcus255 4:1ec553356dcc 11 Ticker i2c_ticker;
marcus255 4:1ec553356dcc 12 void writeNBytes(void);
marcus255 4:1ec553356dcc 13 void init(void);
marcus255 4:1ec553356dcc 14 char data[DATA_SIZE];
marcus255 4:1ec553356dcc 15
marcus255 4:1ec553356dcc 16
marcus255 4:1ec553356dcc 17 #endif