vusivus / Nextion-C-Library

The C Library version of the Nextion Arduino C++ Library
14 stars 3 forks source link

Implementation with Atmega2560 #1

Open vwgolf-3 opened 4 years ago

vwgolf-3 commented 4 years ago

Hello

I try to implement the C-code for my AtMega2560. What do I have to change, that it works?

Thank you very much Robin

ssastrukovs commented 2 years ago

Hello. In Serial.c you would have to change the receiving interrupt (for example, to ISR(USART1_RX_vect)), Serial_Init function (to learn how to configure hardware UART - you would have to read the datasheet) and implement a function "UART1_Write" (which is apparently native to PIC C libraries) - for example, for UART1:

while(!(UCSR1A&(1 << UDRE1))) {}; UDR1 = b;

where b is the byte that needs to be transmitted. Or you can get use of interrupts to send a byte, if you care about speed.