#include "mbed.h" #include "rtos.h" #include "stdio.h" #include "C12832_lcd.h" C12832_LCD lcd; AnalogIn Ain(p20); Mutex lcd_mutex; void thread(void const *args) { int col, height; float ADCdata; while(1) { lcd_mutex.lock(); for(col=0; col<128; col++) { ADCdata = Ain*3.3; height=31-int(ADCdata*10); lcd.pixel(col, height, 1); } lcd.copy_to_lcd(); lcd_mutex.unlock(); Thread::wait(150); lcd.cls(); } } int main() { lcd.cls(); Thread t(thread); while(1); }