hi. i got a signal that goes from 2volt(high) to around 0,2v(low) in 10ms and repeats with a span around 50ms.. First i thought use a gpio but according to docs but the signal is to weak, got the suggestion to use a level shifter but im not sure how to pick the right one... so now im using the analog input with a voltage divider to lower the voltage to max 1v and now i get readings between 10ms with voltagedrop between 0,4v (high) and 0,2v(low)
now im thinking of using rules to calculate high and low and put the state to a dummy device... and then make a counter out of that.
will this even work?
convert analog signal to digital using rules?
Moderators: grovkillen, Stuntteam, TD-er
Re: convert analog signal to digital using rules?
Triggered by your description of the voltage divider, what configuration of processor & board?
Re: convert analog signal to digital using rules?
using esp8266-12f chip.. this is my data.. https://i.imgur.com/blP1eFc.png
trying to figure out how i can set rule to count 1 or 0 from the analog value and use another rule to set counter, cant find any example in docs about counters...
on dummy#var1=1 do
if [analogINPUT#value]<500
gpio,16,[dummy#var1]
endif
endon
trying to figure out how i can set rule to count 1 or 0 from the analog value and use another rule to set counter, cant find any example in docs about counters...
on dummy#var1=1 do
if [analogINPUT#value]<500
gpio,16,[dummy#var1]
endif
endon
Re: convert analog signal to digital using rules?
tried this code with no success
going to check for a suitable npn or pnp transistor to amplify the signal....
Code: Select all
On System#Boot do //When the ESP boots, do
TaskValueSet 3,1,0 //set [DummyCounter#counts]=0
endon
On DummyCounter#counts do
if [feedback#state]<700 //if analog less than 700, add +1 to counter
TaskValueSet 3,1,[DummyCounter#counts]+1
endif
endon
Who is online
Users browsing this forum: No registered users and 49 guests