Thanks so much, it just works! And I have another problem, but now I will be propably more difficult. I have morph that reads values from SerialPort and on the other end of Serial cabel I have an arduino (AVR microchip). I am reading values from 0 to 255 on arduino's pin (I have infrared receiver here) and I am sending them immediately over serial to squeak. Here I am setting Morph's color to value I have received every 500 steps. I have this code:<br>
<br>readColor<br> | s n |<br> n := SerialPort new.<br> n baudRate: 9600.<br> n openPort: 7.<br> s := n readString asInteger.<br> Transcript show: s; cr.<br> s := s - 46 * (1/60).<br> self color: (Color r:s g:s b:s).<br>
n close.<br><br>and it works almost fine. But there is a bug. Time to time I receive only a part of value, for example I am receiving: 56 55 56 55 5 6 55 ... 102 103 101<br>103 100 102 1 1 0 102 102. Those one-digit values are truly false and it looks like the mistake in receiving. How can I synchonize sending and receiving? Or do I have to use other method of SerialPort? Thanks.<br>
<br><div class="gmail_quote">On Thu, Feb 4, 2010 at 9:46 PM, Edgar J. De Cleene <span dir="ltr"><<a href="mailto:edgardec2001@yahoo.com.ar">edgardec2001@yahoo.com.ar</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="im">
<font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><br>
<br>
<br>
On 2/4/10 7:18 PM, "Garret Raziel" <<a href="mailto:boloomka@gmail.com" target="_blank">boloomka@gmail.com</a>> wrote:<br>
<br>
</span></font></font></div><blockquote><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><div class="im">hi, can anyone help me with some code? I want to have a Morph object that change his color by values that squeak gets from SerialPort. I have wroted code of getting values and changing color but I dunno how to do that the morph change its color forever. If i call method "AMorph changeColor" in some to:do: it stucks and shows only last color. I want to use some kind of timer, that will call this method every second and updates this Morph. what must I use?<br>
<br></div>
You should use step and stepTime methods.<br>
<br>
In step you put whatever you like your morph do.<br>
In stepTime you put the time in milliseconds for each change<br>
<br>
I add a example, you could drag and drop on any Squeak you have and see a red thing in the upper corner of Squeak telling the name of the current project and position of mouse.<br>
<br>
Select load as morph.<br>
<br>
Edgar<br>
<br>
</span></font></font></blockquote>
</div>
<br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br>