Trying to push the limits of App Inventor!
Snippets,
Tutorials and
Extensions from
Pura Vida Apps by
Taifun.

void uart_putc( char data ) { /* Wait for empty transmit buffer */ while ( !( UCSRA & (1<<UDRE)) ); /* Put data into buffer, sends the data */ UDR = data;}
void uart_puts( char * s ) { while( *s ) uart_putc( *s++ );}
void uart_putlong( uint32_t liczba, uint8_t radix) { char buf[17]; ltoa( liczba, buf, radix ); uart_puts(buf); }
Define a result procedure called Tail(s) as returning
if length(s) > 1 then
segment(s,2,length(s)-1)
else
empty string
and use Tail(nth piece of your message) one by one in your label assignments.Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by
Taifun.
Is it possible now to take segmented numbers(which are strings) and make arithmetic operation on it?
sprintf(wynik,"?Vout:%1.2f [V], ",adc1*VREF*2.2); uart_puts(wynik);
sprintf(wynik,"?Iout:%1.2f [A], ",adc2*0.0050); uart_puts(wynik);
sprintf(wynik,"?Uvcc:%1.2f [V], ",adc3*VREF*2); uart_puts(wynik);
sprintf(wynik,"?Ubat:%1.2f [V]",adc4*VREF*2); uart_puts(wynik);About percentage of battery, I did it, but result is presented with too much precision :/
sprintf(wynik,"{Vo:%1.2f,",adc1*VREF*2.2); uart_puts(wynik);
sprintf(wynik,"Io:%1.2f,",adc2*0.0050); uart_puts(wynik);
sprintf(wynik,"Vb:%1.2f,",adc3*VREF*2); uart_puts(wynik);
sprintf(wynik,"Vu:%1.2f}\n\r",adc4*VREF*2); uart_puts(wynik);
sprintf(wynik1,"{Vo:%1.2f,",adc1*VREF*2.2);
sprintf(wynik2,"Io:%1.2f,",adc2*0.0050);
sprintf(wynik3,"Vb:%1.2f,",adc3*VREF*2);
sprintf(wynik4,"Vu:%1.2f}\n",adc4*VREF*2);
strcat(wynik1,wynik2); strcat(wynik1,wynik3);
strcat(wynik1,wynik4);
uart_puts(wynik1);
The first letters have to be xyz?
any JsonTextDecode(text jsonText)uart_puts("A\n");uart_puts("B\n");uart_puts("C\n");
sprintf(wynik,"{Vout:%1.2f,",adc1*VREF*2.2); uart_puts(wynik);
sprintf(wynik,"Uvcc:%1.2f,",adc3*VREF*2); uart_puts(wynik);
sprintf(wynik,"Ubat:%1.2f,",adc4*VREF*2); uart_puts(wynik);
sprintf(wynik,"Iout:%1.2f}\n",adc2*0.0050); uart_puts(wynik);
_delay_ms(300);