Baixe o app para aproveitar ainda mais
Prévia do material em texto
char uart_rd; void main() { TRISB.RB0=1; // Configura Porta de entrada Botão 01 TRISB.RB1=1; // Configura Porta de entrada Botão 02 UART1_Init(9600); // Initialize UART module at 9600 bps Delay_ms(100); // Wait for UART module to stabilize UART1_Write_Text("Start"); UART1_Write(10); UART1_Write(13); while (1) { // Endless loop if (PORTB.RB0 == 1) { UART1_Write_Text("Chave 1 Pressionada"); // sends back text if (PORTB.RB1 == 1) { UART1_Write_Text("Chave 2 Pressionada"); // sends back text } } } }
Compartilhar