I'm playing with espeasy on an esp3 module.
I have an Arduino Nano connected and working as a ProMiniExtender (PME) . I am successfully reading a potentiometer value via the PME. I use the formula section of the device page to derive a 'Percent' of full rotation value from the returned raw 0 - 1023 adc value,
I also have a servo attached to GPIO14 of the same device and can alter its position with commands at the browser url line and at the espeasy 'tools' page for the device in question.
I'd like to have the Percent of full rotation value of the pot reflected in the servo's position as a perccent of 180 degrees. I have checked around the wiki and the forum but am not seeing the info I need. I surmise I need a rule to do the work but my attempts as yet haven't worked.
on LegoPME#Percent do
Servo,1,14,%LegoPME#Percent%
endon
Either I am asking the impossible or its a simple syntax issue.
Thoughts or advice please.
Thanks,
Brian H.
Potentiometer to servo ?
Moderators: grovkillen, Stuntteam, TD-er
Re: Potentiometer to servo ?
uxhamby wrote:I'm playing with espeasy on an esp3 module.
I have an Arduino Nano connected and working as a ProMiniExtender (PME) . I am successfully reading a potentiometer value via the PME. I use the formula section of the device page to derive a 'Percent' of full rotation value from the returned raw 0 - 1023 adc value,
I also have a servo attached to GPIO14 of the same device and can alter its position with commands at the browser url line and at the espeasy 'tools' page for the device in question.
I'd like to have the Percent of full rotation value of the pot reflected in the servo's position as a perccent of 180 degrees. I have checked around the wiki and the forum but am not seeing the info I need. I surmise I need a rule to do the work but my attempts as yet haven't worked.
on LegoPME#Percent do
Servo,1,14,%LegoPME#Percent%
endon
Either I am asking the impossible or its a simple syntax issue.
Thoughts or advice please.
Thanks,
Brian H.
Try
Code: Select all
Servo,1,14,[LegoPME#Percent]
http://www.letscontrolit.com/wiki/index ... rial_Rules
Code: Select all
On PIR#Switch do
if [LDR#Light]<500
gpio,16,[PIR#Switch]
endif
endon
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Potentiometer to servo ?
Yes, that seems to do it. I had tried brackets but not the square ones. Made all the difference. Thanks!
Brian H.
Brian H.
Re: Potentiometer to servo ?
Pleasureuxhamby wrote:Yes, that seems to do it. I had tried brackets but not the square ones. Made all the difference. Thanks!
Brian H.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Who is online
Users browsing this forum: Google [Bot] and 115 guests