Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 9 months ago.
Using UART together with Touchscreen
Hi Guys,
I am working on a project where I am receiving serial data on UART6_RX. This works perfectly fine.
However, when I add a touchscreen button to the screen and in the main while loop check if it is touched, the UART_RX doesn't receive any data anymore. I've got the feeling that it has something to do with interrupts.
I currently have the following code:
my main() function
int main() { device.baud(31250); lcd.Clear(BACK_COLOR); Button firstButton(lcd, ts, 10, Y0, btnWidth, btnHeight,LCD_COLOR_RED, BACK_COLOR, "My First Button", Font24); while(1) { if (firstButton.Touched()) //If I remove this if statement, everything works perfectly. { int n = 10; } // __disable_irq(); //Tried this, but without succes if (device.readable()) { char cReceivedByte = device.getc(); unsigned long result= doSomethingAmazing(cOntvangenByte); char buf[10]; sprintf(buf, "%05lu\r\n", result); lcd.SetBackColor(LCD_COLOR_GREEN); lcd.SetTextColor(LCD_COLOR_WHITE); lcd.SetFont(&Font24); lcd.DisplayStringAt(270, LINE(5), (uint8_t *)buf, LEFT_MODE); } // __enable_irq(); } }
Which LCD driver are you using?
posted by Jan Jongboom 26 Mar 2016Hi Jan, I am using the LCD_DISCO_F746NG.h and the TS_DISCO_F746NG.h..
posted by ron de Koster 26 Mar 2016