Harisha
Hi,
I am using OpenPLC with an Arduino-based board.(seeduino arch mix)
see this board i added to the openplc editor .
I have already verified digital input and output. Now I want to use analog input and output.
For example, I am using a temperature sensor which gives voltage. I want to read that analog value and based on temperature turn ON an LED.
I am not clear about one thing:
When we use analogRead, will it give ADC count values or voltage?
How exactly do analog inputs work in OpenPLC?
how we simply give input from sensor to the analog pin which we used in openplc will give the automatically values in the range 0 -65536 or should we use any hardware adc than that adc vales do we need to give input to that pin how?
What is the minimal setup required to read analog input and control output?
Thanks.
Reply 1 0
thiagoralves
On the pin mapping screen, put your analog input pin and select “analog input” as type. The editor will give you an address associated with that pin, such as %IW0 for example. Then you can simply create a UINT variable in your program and set its location to the %IW address mapped to the pin. This variable will contain the raw analog input reading from the pin in the 0-65535 range
Reply 1 0
Reply