3... not an bad idea... <br><br>i'm about to setup my monitoring pi as a webserver also so i have a place to share files.. and then i'm going to look for parts so i can build a birdsnest prototype, just something simple with leds and/or small pc fans<br>
<br>going to order parts so i can read my water meter anyway and repair the psu on tina's creative speaker system (relay melted... bad made.. try google for creative gigaworks 550)<br><br><br>/bo<br><br><div class="gmail_quote">
2013/5/28 Damon Hart-Davis <span dir="ltr"><<a href="mailto:dhd@exnet.com" target="_blank">dhd@exnet.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
1) That's quite power hungry with no sleep() which you may want to address.<br>
<br>
2) It'll do something funny at ~49 days, when the millis() internal counter rolls.<br>
<br>
3) If analogueWrite() uses hardware PWM then you should be able to, say, replace:<br>
<br>
if (ledState == LOW)<br>
ledState = HIGH;<br>
else<br>
ledState = LOW;<br>
// set the LED with the ledState of the variable:<br>
digitalWrite(ledPin, ledState);<br>
<br>
with (say):<br>
<br>
++ledState;<br>
analogueWrite(ledPin, ledState & 0xff);<br>
<br>
to generate a slowly-rising saw-tooth (PWMed) for example, though I haven't tried it.<br>
<br>
Rgds<br>
<br>
Damon<br>
<br>
<br>
On 28 May 2013, at 19:59, Bo Herrmannsen wrote:<br>
<br>
> i was given this example: <a href="http://arduino.cc/en/Tutorial/BlinkWithoutDelay" target="_blank">http://arduino.cc/en/Tutorial/BlinkWithoutDelay</a><br>
><br>
><br>
> but is there a way to call this and just give it a i number like analogwrite?<br>
><br>
> /bo<br>
><br>
> 2013/5/26 Damon Hart-Davis <<a href="mailto:dhd@exnet.com">dhd@exnet.com</a>><br>
> Duty cycle is the fraction of the time the output is HIGH and is nominally independent of the frequency.<br>
><br>
> Rgds<br>
><br>
> Damon<br>
><br>
><br>
> On 26 May 2013, at 19:15, Bo Herrmannsen wrote:<br>
><br>
> > Hi<br>
> ><br>
> > fighting a small thing here... i know i can use the pwm out for pulses... but how do i know for sure it gives say 3 pulses a sec? i calced something about a duty cycle of 50-60%<br>
> ><br>
> > but is there a more precise way?<br>
> ><br>
> ><br>
> > /bo<br>
> > _______________________________________________<br>
> > OpenTRV-dev mailing list<br>
> > <a href="mailto:OpenTRV-dev@lists.opentrv.org.uk">OpenTRV-dev@lists.opentrv.org.uk</a><br>
> > <a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
><br>
> _______________________________________________<br>
> OpenTRV-dev mailing list<br>
> <a href="mailto:OpenTRV-dev@lists.opentrv.org.uk">OpenTRV-dev@lists.opentrv.org.uk</a><br>
> <a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
><br>
> _______________________________________________<br>
> OpenTRV-dev mailing list<br>
> <a href="mailto:OpenTRV-dev@lists.opentrv.org.uk">OpenTRV-dev@lists.opentrv.org.uk</a><br>
> <a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
<br>
_______________________________________________<br>
OpenTRV-dev mailing list<br>
<a href="mailto:OpenTRV-dev@lists.opentrv.org.uk">OpenTRV-dev@lists.opentrv.org.uk</a><br>
<a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
</blockquote></div><br>