Previous Next

Display Task:

The job of this task is to send the capacitance message to the UART. First, it copies the message from the program memory to the SRAM, since that is where OSUARTWait needs it to be. It sets the character count and begins transmission. The final step is to format the value of the capacitance as ASCII characters instead of a hexadecimal number, and then display that to the UART.

 char DisplayTask(void)
 begin
 	char Cap[5];
 	char nf[]="nf";
 	putsf("Capacitance: \r\n"); 
 	sprintf(Cap,"%-i\n",temp);
 	OSUARTTransmitBytes(Cap,4); 
 	OSUARTTransmitBytes(nf,2); 
 	OSSendAck(0); //turn on the debounce state machine
 	return 0;
 end

Previous Next