[OpenTRV-dev] OT: pulse output from arduino

Bo Herrmannsen EMAIL ADDRESS HIDDEN
Tue May 28 21:22:49 BST 2013


3... not an bad idea...

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

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)


/bo

2013/5/28 Damon Hart-Davis <EMAIL ADDRESS HIDDEN>

> Hi,
>
> 1) That's quite power hungry with no sleep() which you may want to address.
>
> 2) It'll do something funny at ~49 days, when the millis() internal
> counter rolls.
>
> 3) If analogueWrite() uses hardware PWM then you should be able to, say,
> replace:
>
>     if (ledState == LOW)
>       ledState = HIGH;
>     else
>       ledState = LOW;
>     // set the LED with the ledState of the variable:
>     digitalWrite(ledPin, ledState);
>
> with (say):
>
>   ++ledState;
>  analogueWrite(ledPin, ledState & 0xff);
>
> to generate a slowly-rising saw-tooth (PWMed) for example, though I
> haven't tried it.
>
> Rgds
>
> Damon
>
>
> On 28 May 2013, at 19:59, Bo Herrmannsen wrote:
>
> > i was given this example:
> http://arduino.cc/en/Tutorial/BlinkWithoutDelay
> >
> >
> > but is there a way to call this and just give it a i number like
> analogwrite?
> >
> > /bo
> >
> > 2013/5/26 Damon Hart-Davis <EMAIL ADDRESS HIDDEN>
> > Duty cycle is the fraction of the time the output is HIGH and is
> nominally independent of the frequency.
> >
> > Rgds
> >
> > Damon
> >
> >
> > On 26 May 2013, at 19:15, Bo Herrmannsen wrote:
> >
> > > Hi
> > >
> > > 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%
> > >
> > > but is there a more precise way?
> > >
> > >
> > > /bo
> > > _______________________________________________
> > > OpenTRV-dev mailing list
> > > EMAIL ADDRESS HIDDEN
> > > http://lists.opentrv.org.uk/listinfo/opentrv-dev
> >
> > _______________________________________________
> > OpenTRV-dev mailing list
> > EMAIL ADDRESS HIDDEN
> > http://lists.opentrv.org.uk/listinfo/opentrv-dev
> >
> > _______________________________________________
> > OpenTRV-dev mailing list
> > EMAIL ADDRESS HIDDEN
> > http://lists.opentrv.org.uk/listinfo/opentrv-dev
>
> _______________________________________________
> OpenTRV-dev mailing list
> EMAIL ADDRESS HIDDEN
> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opentrv.org.uk/pipermail/opentrv-dev/attachments/20130528/8f1527e5/attachment-0001.html>


More information about the OpenTRV-dev mailing list