Test code attempting to drive a Ebay SSD1306 128X65 LCD from STM F303K8. The chip responds my I2C address scanner but the LCD never turns on or displays anything.

Dependencies:   SSD1308_128x64_I2C mbed Adafruit_GFX

Fork of Nucleo-F303K8-ADC-TEST by Joseph Ellsworth

Update of sample using Adafruit library to drive a generic Ebay SSD1306 OLED display. On Nucleo-F303K8 it will display reading of first two ADC lines once every couple seconds. Should work with other CPU boards.

Files at this revision

API Documentation at this revision

Comitter:
joeata2wh
Date:
Sat Mar 19 02:18:42 2016 +0000
Child:
1:90d213185462
Commit message:
working version

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Mar 19 02:18:42 2016 +0000
@@ -0,0 +1,52 @@
+/* Example of Reading all the ADC pins available on the Nucleo_F303K8. 
+ by Joseph Ellsworth CTO A2WH -  Free for all but no warranty, no promises */
+
+#include "mbed.h"
+
+// Initialize a pins to perform analog input and digital output fucntions
+AnalogIn   aA7(PA_2);
+AnalogIn   aA6(PA_7);
+AnalogIn   aA5(PA_6);
+AnalogIn   aA4(PA_5);
+AnalogIn   aA3(PA_4);
+AnalogIn   aA2(PA_3);
+AnalogIn   aA1(PA_1); 
+AnalogIn   aA0(PA_0); 
+AnalogIn   aB0(PB_0); 
+AnalogIn   aB1(PB_1); 
+ 
+DigitalOut myled(LED1);
+const float voltMeterARef = 3.3;
+
+float readPrint(AnalogIn ain, char *label) {
+  float tval = ain.read();
+  float volts = tval * voltMeterARef;
+  float perc = tval * 100.0;  
+  unsigned short  tvalu16 = ain.read_u16 ();
+
+  printf("adc %s R=%3.3f V=%3.3f%% U16=%u\r\n",label, tval, volts, tvalu16);
+  
+  return tval;
+}
+    
+
+int main() {
+
+    while(1) {
+        myled = !myled; // toggle led 
+        readPrint(aA7, "PA_7");
+        readPrint(aA6, "PA_6");
+        readPrint(aA5, "PA_5");
+        readPrint(aA4, "PA_4");
+        readPrint(aA3, "PA_3");
+        readPrint(aA2, "PA_2");
+        readPrint(aA1, "PA_1");
+        readPrint(aA0, "PA_0");
+        
+        readPrint(aB0, "PB_0");
+        readPrint(aB1, "PB_1");
+        printf("\r\n\r\n");
+        wait(7.0);
+        
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Mar 19 02:18:42 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/c0f6e94411f5
\ No newline at end of file