Hello, I am trying to interface a temperature sensor to the UART of Z8 Encore.
My problem is, how do I code it, I mean what command should I use in order to get data from the UART?
A simple diagram of my project is like this:
TEMPERATURE SENSOR (Tx Pin) --> Z8 Encore (Rx Pin)
and common ground.
I am also wondering. I am quite new in the world of microcontrollers, and I bought the sensor along with the Z8 Encore. The one who sold me the sensor told that in order to connect the Sensor to Z8, just tap the Sensor's T'X Pin to the Z8 Encore's R'x Pin, and their common ground. Is it possible to have only two connections in UART?
Also, how to get data from UART
I use this command:
ch = getch();?
However, the it does not respond as expected, in a way that no response at all. I know that in serial communications, it consist of 8 data bits, I'm thinking if the getch command would suffice here.
In summary here are my questions:
1. Is it alright to have only two pin connections in RS232 communications or the one who sold me the materials are just telling me fake? (T'x Pin of Sensor to R'x Pin of Z8 Encore and their common ground)
2. If the first question is possible, how do I get data from the sensor? I used getch() but it does not work.
Thanks to those who will answer.
My problem is, how do I code it, I mean what command should I use in order to get data from the UART?
A simple diagram of my project is like this:
TEMPERATURE SENSOR (Tx Pin) --> Z8 Encore (Rx Pin)
and common ground.
I am also wondering. I am quite new in the world of microcontrollers, and I bought the sensor along with the Z8 Encore. The one who sold me the sensor told that in order to connect the Sensor to Z8, just tap the Sensor's T'X Pin to the Z8 Encore's R'x Pin, and their common ground. Is it possible to have only two connections in UART?
Also, how to get data from UART
I use this command:
ch = getch();?
However, the it does not respond as expected, in a way that no response at all. I know that in serial communications, it consist of 8 data bits, I'm thinking if the getch command would suffice here.
In summary here are my questions:
1. Is it alright to have only two pin connections in RS232 communications or the one who sold me the materials are just telling me fake? (T'x Pin of Sensor to R'x Pin of Z8 Encore and their common ground)
2. If the first question is possible, how do I get data from the sensor? I used getch() but it does not work.
Thanks to those who will answer.