PARTYYYY

Dependencies:   mbed MMA8452

Committer:
ThierryLeonard
Date:
Mon Sep 04 22:57:54 2017 +0000
Revision:
2:3576839565ae
Parent:
0:c2282db9d19e
Child:
5:70db90b673b9
Afficheur Spi

Who changed what in which revision?

UserRevisionLine numberNew contents of line
evrast 0:c2282db9d19e 1 #include "Accelerometre.h"
evrast 0:c2282db9d19e 2
ThierryLeonard 2:3576839565ae 3 /*
evrast 0:c2282db9d19e 4
evrast 0:c2282db9d19e 5
evrast 0:c2282db9d19e 6 int Accelerometre::readSingleByte(int regis){
evrast 0:c2282db9d19e 7 char cmd[8];
evrast 0:c2282db9d19e 8 int c;
evrast 0:c2282db9d19e 9 pc.printf("Reading single byte\n");
evrast 0:c2282db9d19e 10 i2c.start();
evrast 0:c2282db9d19e 11 int a=i2c.write(0x38); // A write to device
evrast 0:c2282db9d19e 12 i2c.write(regis); // Register to read from (acceleration in X)
evrast 0:c2282db9d19e 13 i2c.start(); // Need to send start condition here
evrast 0:c2282db9d19e 14 i2c.write(0x39); // tell devide you want to read
evrast 0:c2282db9d19e 15 c=i2c.read(0);
evrast 0:c2282db9d19e 16 i2c.stop();
evrast 0:c2282db9d19e 17 pc.printf("value is %d\n", c);
evrast 0:c2282db9d19e 18 pc.printf("end\n");
evrast 0:c2282db9d19e 19 return c;
ThierryLeonard 2:3576839565ae 20 }*/