Simple problem: blink LED

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
WilliButz
New user
Posts: 5
Joined: 24 Feb 2016, 11:15

Simple problem: blink LED

#1 Post by WilliButz » 20 Feb 2017, 20:50

I’m using Firmware R147_RC8.
Measuring Temperature, Humidy, Controlling Relais and reading Switches with fhem.
Working very good.

But I have a simple problem: write a rule letting a LED blink with 1Hz.

With PWM I can’t control the frequency.

I tried this:

Code: Select all

On System#Boot do    	
  gpio,13,1		
  timerSet,1,1	
endon
On Rules#Timer=1 do  
 gpio,13,0
 timerSet,2,1
endon
On Rules#Timer=2 do  
 gpio,13,1
 timerSet,1,1  
endon
Is working well, low CPU load, fast Web response. But slow blinking.
‘timerSet’ with times lower 1 seems not to work.

My next try:

Code: Select all

On System#Boot do    	
  pulse,13,1,500
  timerSet,1,3	
endon
On Rules#Timer=1 do  
 pulse,13,1,500
 pulse,13,0,500
 pulse,13,1,500
 pulse,13,0,500
 pulse,13,1,500
 pulse,13,0,500
 pulse,13,1,500
 pulse,13,0,500
 pulse,13,1,500
 pulse,13,0,500
 pulse,13,1,500
 pulse,13,0,500
 timerSet,1,1
endon
Some fast blink (pulse 0/1) and one slow blink (timerSet). Looks good, but CPU load high and slow Web response.

So I read about ‘longpulse’. Tried with a http command and seems that the Parameter is in seconds.
Filled in the longpulse in the example above, but did not work.
Are timer and longpulse conflict ESP internal resources???

Till now no good solution:
- Blink frequency 1Hz or faster
- Low CPU load
- Fast Web response

May be there is a simple solution. I’m not so experienced….
Thank you!

Willi

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests