Ja vielen Herzlichen Dank für diese tollen Informationen
Es läuft!
Hier mal nen Beispiel falls jemand das gleiche Prob hat.
C Code:
PHP-Code:
int index=0;
char ch[19];
c = uart_getc();
if ( c & UART_NO_DATA )
{
/*
* no data available from UART
*/
}
else
{
/*
* new data available from UART
* check for Frame or Overrun error
*/
if ( c & UART_FRAME_ERROR )
{
/* Framing Error detected, i.e no stop bit detected */
uart_puts_P("UART Frame Error: ");
}
if ( c & UART_OVERRUN_ERROR )
{
/*
* Overrun, a character already present in the UART UDR register was
* not read by the interrupt handler before the next character arrived,
* one or more received characters have been dropped
*/
uart_puts_P("UART Overrun Error: ");
}
if ( c & UART_BUFFER_OVERFLOW )
{
/*
* We are not reading the receive buffer fast enough,
* one or more received character have been dropped
*/
uart_puts_P("Buffer overflow error: ");
}
/*
* send received character back
*/
uart_putc( (unsigned char)c );
if((unsigned char)c!=13)
{
ch[index]=c;
index++;
}
else
{
ch[index]=0;
index = 0;
if (strcmp (ch,"TEMP1")==0)
{
// Temperatur soll angefragt werden
uart_puts("Temperatur1=..........\n");
}
if (strcmp (ch,"TEMP2")==0)
{
// Temperatur soll angefragt werden
uart_puts("Temperatur2=..........\n");
}
if (strcmp (ch,"PH")==0)
{
// Temperatur soll angefragt werden
uart_puts("PH=..........\n");
}
if (strcmp (ch,"HUMIDITY")==0)
{
// Temperatur soll angefragt werden
uart_puts("Humidityr=..........\n");
}
ch[0]=0;
}
Lesezeichen