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

Thomas McGrath III mcgrath3 at mac.com
Fri Feb 4 12:35:11 EST 2011


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





More information about the use-livecode mailing list