How to send a number as a number or How to rule an LED

Nonsanity form at nonsanity.com
Fri Feb 4 11:42:09 CST 2011


Glad it helped. Though as a longtime hardware serial interface user, I DO
strongly suggest going the ascii route. That Arduino function should work
as-is (with the bug fixes). Couple it with really simple code on the LC side
and you're done.

write ("LED" && tValue & CR) to file thePort


 ~ Chris Innanen
 ~ Nonsanity


On Fri, Feb 4, 2011 at 12:35 PM, Thomas McGrath III <mcgrath3 at mac.com>wrote:

> Well, Thank you very much the numtochar worked perfectly. SInce most of
> these are either two or three numbers being sent for motor/stepper and LED
> and will not be more than 255 I will stick with the numtochar() for this. I
> will still try to come up with a parser for the Arduino for passing commands
> and arguments but a tleast for now I am Beating that LED into submission and
> am very happy about it.
>
>
>
> -- Tom McGrath III
> http://lazyriver.on-rev.com
> 3mcgrath at comcast.net
>
> On Feb 4, 2011, at 12:23 PM, form wrote:
>
> > On Fri, Feb 4, 2011 at 12:18 PM, form <form at nonsanity.com> wrote:
> >
> >>
> >>    else
> >>        ++bufloc; // next read will go in the next buf char
> >
> >
> > For safety's sake...
> >
> >    else
> >    {
> >        ++bufloc; // next read will go in the next buf char
> >        if ( bufloc > 255 )
> >        {
> >            // ERROR - buffer overflow - line too long - missing CR?
> (print
> > something...)
> >            memset( buf, 0, sizeof( buf ) );
> >            bufloc = 0;
> >        }
> >    }
> >
> > Looking at that code and knowing that error would crash it... I couldn't
> > stand it anymore. :)
> >
> > ~ Chris Innanen
> > ~ Nonsanity
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list