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
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.
main.cpp
- Committer:
- joeata2wh
- Date:
- 2016-03-19
- Revision:
- 0:fa185766e039
- Child:
- 1:90d213185462
File content as of revision 0:fa185766e039:
/* 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); } }