Hello everyone,
I am not really good with coding and programming stuff, so I need to convert this code into C code:
---------------------------------------------------------------------------------------------------------------------------------
Main
Unsigned int temp_res
Unsigned char result [7]
Initialize ADC
TRISA ==> R0 is Input (Channel 0 Analog)
TRISC ==> RC7 is Input (Rx)
==> RC6 is Output (Tx)
Initialize Baud Rate // 9600 bps
Delay 1000 ms for stabilization
While (1)
{
Read from ADC to temp_res
temp_res = temp_res / 200
Write TEXT to UART1 ("The voltage is: ")
IntToStr(result, temp_res) // This is the name of this method exactly in MikroC (Integer to
String conversion)
Write TEXT to UART1 (result)
Write TEXT (" ")
Delay 1000 ms to ensure transmission
}
---------------------------------------------------------------------------------------------------------------------------------
Thanks !
I am not really good with coding and programming stuff, so I need to convert this code into C code:
---------------------------------------------------------------------------------------------------------------------------------
Main
Unsigned int temp_res
Unsigned char result [7]
Initialize ADC
TRISA ==> R0 is Input (Channel 0 Analog)
TRISC ==> RC7 is Input (Rx)
==> RC6 is Output (Tx)
Initialize Baud Rate // 9600 bps
Delay 1000 ms for stabilization
While (1)
{
Read from ADC to temp_res
temp_res = temp_res / 200
Write TEXT to UART1 ("The voltage is: ")
IntToStr(result, temp_res) // This is the name of this method exactly in MikroC (Integer to
String conversion)
Write TEXT to UART1 (result)
Write TEXT (" ")
Delay 1000 ms to ensure transmission
}
---------------------------------------------------------------------------------------------------------------------------------
Thanks !