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.
Diff: Q1.cpp
- Revision:
- 0:921dabe69921
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Q1.cpp Sun Nov 18 14:16:59 2018 +0000
@@ -0,0 +1,30 @@
+#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);
+ }
+}