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.
Q1.cpp
- Committer:
- louisverzellesi
- Date:
- 2018-11-18
- Revision:
- 0:921dabe69921
File content as of revision 0:921dabe69921:
#include "mbed.h"
#include "C12832.h"
I2C ansarnia(p28,p27); //CONNEXION BUS I2C
const int adresse = 0x90;
char octet_ecriture[1];
char octet_lecture[2];
C12832 lcd(p5, p7, p6, p8, p11);
int L,M;
float temp;
int main(){
//ansarnia.frequency(50000];
octet_ecriture[0] =0x00;
while(true){
ansarnia.write(adresse,octet_ecriture,1);
ansarnia.read(adresse,octet_lecture,2);
M=octet_lecture[0];
L=octet_lecture[1];
lcd.cls();
lcd.locate(0,3);
//lcd.printf("la valeur de temperature est :");
//lcd.locate(0,15);
temp = ((256.0*M+L)/32.0)*0.125;
lcd.printf("degrees %f\n\r",temp);
wait(0.5);
}
}