Sample code with BluePill STM32F103C8 and Oled SSD1306 and LCD1602 on same connect on DS18B20.

Dependencies:   TextLCD

Files at this revision

API Documentation at this revision

Comitter:
diltech
Date:
Sun May 29 18:40:06 2022 -0400
Parent:
0:47b4bbc994df
Commit message:
Etape1

Changed in this revision

.hgignore Show annotated file Show diff for this revision Revisions of this file
TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
ds18b20-single.lib Show annotated file Show diff for this revision Revisions of this file
ds18b20-single/.git/index Show annotated file Show diff for this revision Revisions of this file
ds18b20-single/.git/logs/HEAD Show annotated file Show diff for this revision Revisions of this file
ds18b20-single/.git/logs/refs/heads/master Show annotated file Show diff for this revision Revisions of this file
ds18b20-single/.git/logs/refs/remotes/mbed-studio-cache/master Show annotated file Show diff for this revision Revisions of this file
ds18b20-single/.git/logs/refs/remotes/origin/HEAD Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
diff -r 47b4bbc994df -r 27d0c6ee0e55 .hgignore
--- a/.hgignore	Sun May 29 16:30:05 2022 -0400
+++ b/.hgignore	Sun May 29 18:40:06 2022 -0400
@@ -1,3 +1,5 @@
 ^BUILD$
 ^.mbed$
 ^mbed-os$
+^TextLCD$
+^ds18b20-single$
diff -r 47b4bbc994df -r 27d0c6ee0e55 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Sun May 29 18:40:06 2022 -0400
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/kenjiArai/code/TextLCD/#f8e67a681560f45e645203c18c209d2d056871e1
\ No newline at end of file
diff -r 47b4bbc994df -r 27d0c6ee0e55 ds18b20-single.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ds18b20-single.lib	Sun May 29 18:40:06 2022 -0400
@@ -0,0 +1,1 @@
+https://github.com/LukasINA/DS18B20-single#dba54863bc386ece4a2d31093a6cd1c2a564ea6f
\ No newline at end of file
diff -r 47b4bbc994df -r 27d0c6ee0e55 ds18b20-single/.git/index
Binary file ds18b20-single/.git/index has changed
diff -r 47b4bbc994df -r 27d0c6ee0e55 ds18b20-single/.git/logs/HEAD
--- a/ds18b20-single/.git/logs/HEAD	Sun May 29 16:30:05 2022 -0400
+++ b/ds18b20-single/.git/logs/HEAD	Sun May 29 18:40:06 2022 -0400
@@ -1,2 +1,2 @@
-0000000000000000000000000000000000000000 dba54863bc386ece4a2d31093a6cd1c2a564ea6f rejean <rejean@acerrejean> 1653836608 -0400	clone: from /home/rejean/.config/Mbed Studio/library-cache/github.com/lukasina/ds18b20-single.git
-dba54863bc386ece4a2d31093a6cd1c2a564ea6f dba54863bc386ece4a2d31093a6cd1c2a564ea6f rejean <rejean@acerrejean> 1653836609 -0400	checkout: moving from master to dba54863bc386ece4a2d31093a6cd1c2a564ea6f
+0000000000000000000000000000000000000000 dba54863bc386ece4a2d31093a6cd1c2a564ea6f Diltech <redgemalt@gmail.com> 1653856777 -0400	clone: from /home/rejean/.config/Mbed Studio/library-cache/github.com/lukasina/ds18b20-single.git
+dba54863bc386ece4a2d31093a6cd1c2a564ea6f dba54863bc386ece4a2d31093a6cd1c2a564ea6f Diltech <redgemalt@gmail.com> 1653856779 -0400	checkout: moving from master to dba54863bc386ece4a2d31093a6cd1c2a564ea6f
diff -r 47b4bbc994df -r 27d0c6ee0e55 ds18b20-single/.git/logs/refs/heads/master
--- a/ds18b20-single/.git/logs/refs/heads/master	Sun May 29 16:30:05 2022 -0400
+++ b/ds18b20-single/.git/logs/refs/heads/master	Sun May 29 18:40:06 2022 -0400
@@ -1,1 +1,1 @@
-0000000000000000000000000000000000000000 dba54863bc386ece4a2d31093a6cd1c2a564ea6f rejean <rejean@acerrejean> 1653836608 -0400	clone: from /home/rejean/.config/Mbed Studio/library-cache/github.com/lukasina/ds18b20-single.git
+0000000000000000000000000000000000000000 dba54863bc386ece4a2d31093a6cd1c2a564ea6f Diltech <redgemalt@gmail.com> 1653856777 -0400	clone: from /home/rejean/.config/Mbed Studio/library-cache/github.com/lukasina/ds18b20-single.git
diff -r 47b4bbc994df -r 27d0c6ee0e55 ds18b20-single/.git/logs/refs/remotes/mbed-studio-cache/master
--- a/ds18b20-single/.git/logs/refs/remotes/mbed-studio-cache/master	Sun May 29 16:30:05 2022 -0400
+++ b/ds18b20-single/.git/logs/refs/remotes/mbed-studio-cache/master	Sun May 29 18:40:06 2022 -0400
@@ -1,1 +1,1 @@
-0000000000000000000000000000000000000000 dba54863bc386ece4a2d31093a6cd1c2a564ea6f rejean <rejean@acerrejean> 1653836609 -0400	fetch --tags -f --prune --progress mbed-studio-cache: storing head
+0000000000000000000000000000000000000000 dba54863bc386ece4a2d31093a6cd1c2a564ea6f Diltech <redgemalt@gmail.com> 1653856778 -0400	fetch --tags -f --prune --progress mbed-studio-cache: storing head
diff -r 47b4bbc994df -r 27d0c6ee0e55 ds18b20-single/.git/logs/refs/remotes/origin/HEAD
--- a/ds18b20-single/.git/logs/refs/remotes/origin/HEAD	Sun May 29 16:30:05 2022 -0400
+++ b/ds18b20-single/.git/logs/refs/remotes/origin/HEAD	Sun May 29 18:40:06 2022 -0400
@@ -1,1 +1,1 @@
-0000000000000000000000000000000000000000 dba54863bc386ece4a2d31093a6cd1c2a564ea6f rejean <rejean@acerrejean> 1653836608 -0400	clone: from /home/rejean/.config/Mbed Studio/library-cache/github.com/lukasina/ds18b20-single.git
+0000000000000000000000000000000000000000 dba54863bc386ece4a2d31093a6cd1c2a564ea6f Diltech <redgemalt@gmail.com> 1653856777 -0400	clone: from /home/rejean/.config/Mbed Studio/library-cache/github.com/lukasina/ds18b20-single.git
diff -r 47b4bbc994df -r 27d0c6ee0e55 main.cpp
--- a/main.cpp	Sun May 29 16:30:05 2022 -0400
+++ b/main.cpp	Sun May 29 18:40:06 2022 -0400
@@ -1,13 +1,12 @@
 #include "PinNames.h"
 #include "mbed.h"
 #include "TextLCD.h"  // Important d'avoir la bonne librairie 
-#include "Adafruit_SSD1306.h"
 #include "DS18B20.h"
 
 I2C i2c_pin(I2C_SDA, I2C_SCL);
 DigitalOut myLed(PC_13);
 TextLCD_I2C lcd(&i2c_pin, 0x4E);
-Adafruit_SSD1306_I2c oled(i2c_pin, PA_4, 0x78, 64, 128);
+
 
 
 
@@ -19,13 +18,7 @@
 int main()
 {
   // *********** Oled 128 x 64 *********
-  int tickTime = 1000;
-  oled.begin(SSD1306_SWITCHCAPVCC);
-  HAL_Delay(200);
-  oled.splash();
-  oled.display();
-  HAL_Delay(2000);
-  oled.clearDisplay();
+  
 
   // ******* LCD 1602 *************
   //lcd.locate(0, 0); //    Position initial
@@ -35,7 +28,7 @@
   lcd.printf("  Thermal sonde\n");
 
   while (true) {
-    oled.clearDisplay();
+    
     myLed = !myLed;
     float temperature = sensor.readTemp();
     // ***** LCD 1602 ***
@@ -52,21 +45,10 @@
     }
     
     // ******* Oled 128 x 64 *******
-    oled.setTextSize(2);
-    oled.setTextCursor(0, 30);
-    oled.printf("Temp: %0.1f\r", temperature);
-    oled.display();
+    
 
-    for (int i = 0; i < 10; i++) {
-      oled.setTextSize(2);
-      oled.setTextCursor(col, 0);
-      oled.putc(175);
-      oled.display();
-      col = col + 12;
-      if (col > 118) {
-        col = 0;
-      }
+    
       HAL_Delay(50);
-    }
+    
   }
 }
\ No newline at end of file
diff -r 47b4bbc994df -r 27d0c6ee0e55 mbed-os.lib
--- a/mbed-os.lib	Sun May 29 16:30:05 2022 -0400
+++ b/mbed-os.lib	Sun May 29 18:40:06 2022 -0400
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os.git#2eb06e76208588afc6cb7580a8dd64c5429a10ce
\ No newline at end of file
+https://github.com/ARMmbed/mbed-os.git#dfcb61e052d1192d99a07dca6fb4970281afc8e4
\ No newline at end of file
diff -r 47b4bbc994df -r 27d0c6ee0e55 mbed_app.json
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_app.json	Sun May 29 18:40:06 2022 -0400
@@ -0,0 +1,7 @@
+{
+    "target_overrides": {
+        "*": {
+            "target.printf_lib": "std"
+        }
+    }
+}
\ No newline at end of file