﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>RoboticsConnection User Forum / RoboticsConnection Software Support / Serializer .NET Library </title><generator>InstantForum.NET v4.1.4</generator><description>RoboticsConnection User Forum</description><link>http://www.roboticsconnection.com/userForums/</link><webMaster>info@roboticsconnection.com</webMaster><lastBuildDate>Mon, 06 Oct 2008 09:21:24 GMT</lastBuildDate><ttl>20</ttl><item><title>Webcam</title><link>http://www.roboticsconnection.com/userForums/Topic625-6-1.aspx</link><description>Dear members,&lt;br&gt;&lt;br&gt;could you help me how to open webcam window in C# console application?&lt;br&gt;&lt;br&gt;&lt;br&gt;thanks a lot.&lt;br&gt;</description><pubDate>Thu, 21 Aug 2008 21:36:57 GMT</pubDate><dc:creator>speeduae</dc:creator></item><item><title>Motor Control</title><link>http://www.roboticsconnection.com/userForums/Topic606-6-1.aspx</link><description>&lt;P style="BACKGROUND: white"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: 'Verdana','sans-serif'"&gt;[quote]Hi,&lt;BR&gt;I’m beginner in C# and wrote this code below in Microsoft Visual C# 2008 Express in Console application to control DC motors. Actually I want to control DC motors from the keyboard, but the problem is I have to press enter after press key.&lt;BR&gt;How can I solve this problem? and How can i change Com port?&lt;BR&gt;Thank you.:)&lt;BR&gt;using RoboticsConnection.Serializer;&lt;BR&gt;using RoboticsConnection.Serializer.Ids;&lt;BR&gt;using RoboticsConnection.Serializer.Sensors;&lt;BR&gt;using RoboticsConnection.Serializer.Components;&lt;BR&gt;using RoboticsConnection.Serializer.Controllers;&lt;BR&gt;using System;&lt;BR&gt;using System.Threading;&lt;BR&gt; &lt;BR&gt;namespace test&lt;BR&gt;{&lt;BR&gt;    class Program&lt;BR&gt;    {&lt;BR&gt;        static Serializer serializer;&lt;BR&gt;        static PwmDCMotorController LeftMotor;&lt;BR&gt;        static PwmDCMotorController RightMotor;&lt;BR&gt; &lt;BR&gt;        static void Main(string[] args)&lt;BR&gt;        {&lt;BR&gt;            serializer = new Serializer();&lt;BR&gt; &lt;BR&gt;            LeftMotor = new PwmDCMotorController(serializer);&lt;BR&gt;            RightMotor = new PwmDCMotorController(serializer);&lt;BR&gt; &lt;BR&gt;            LeftMotor.DCMotorId = DCMotorId.DCMotor2;&lt;BR&gt;            RightMotor.DCMotorId = DCMotorId.DCMotor1;&lt;BR&gt; &lt;BR&gt;            serializer.StartCommunication();&lt;BR&gt;            while (true)&lt;BR&gt;            {&lt;BR&gt;                serializer.PumpEvents();&lt;BR&gt; &lt;BR&gt;              &lt;BR&gt;                Console.Write("Enter Key:");&lt;BR&gt;                string s = Console.ReadLine();&lt;BR&gt; &lt;BR&gt;                if (s == "w")&lt;BR&gt;                {&lt;BR&gt;                    LeftMotor.Speed = 100;&lt;BR&gt;                    RightMotor.Speed = 100;&lt;BR&gt;                }&lt;BR&gt;                if (s == "a")&lt;BR&gt;                {&lt;BR&gt;                    LeftMotor.Speed = -100;&lt;BR&gt;                    RightMotor.Speed = 100;&lt;BR&gt;                }&lt;BR&gt;                if (s == "d")&lt;BR&gt;                {&lt;BR&gt;                    LeftMotor.Speed = 100;&lt;BR&gt;                    RightMotor.Speed = -100;&lt;BR&gt;                }&lt;BR&gt;                if (s == "x")&lt;BR&gt;                {&lt;BR&gt;                    LeftMotor.Speed = -100;&lt;BR&gt;                    RightMotor.Speed = -100;&lt;BR&gt;                }&lt;BR&gt;                if (s == "s")&lt;BR&gt;                {&lt;BR&gt;                    LeftMotor.Speed = 0;&lt;BR&gt;                    RightMotor.Speed = 0;&lt;BR&gt;                }&lt;BR&gt;            }&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 115%"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;</description><pubDate>Sun, 03 Aug 2008 13:19:36 GMT</pubDate><dc:creator>speeduae</dc:creator></item><item><title>Time delay</title><link>http://www.roboticsconnection.com/userForums/Topic492-6-1.aspx</link><description>Hi I have a Problem and I don´t know if it a Hard - or Software Problem.&lt;/P&gt;&lt;P&gt;I write a Programm in C#. There is a Button on the interface, when I press this Button a Motor starts.  A switch which is connected on I/O Pin 1 works as a counter.&lt;/P&gt;&lt;P&gt;The start and stop from the motor over the C# Interface works great and very fast. But the count from the switch which is connected to the borad has a time delay of 0,5 - 1 second.&lt;/P&gt;&lt;P&gt;Is this normal? Can I make this faster? is there the possibility the press of the switch to write in a register, so that I see the counter works when i press the switch faster? &lt;/P&gt;&lt;P&gt;I have tried some different "Timer" periods from 25 - 200 msec. But the counter is always to slow.</description><pubDate>Sat, 10 May 2008 01:42:10 GMT</pubDate><dc:creator>Silvermatrix</dc:creator></item><item><title>Unhandled exception errror</title><link>http://www.roboticsconnection.com/userForums/Topic568-6-1.aspx</link><description>Hi all,&lt;br&gt;we are working on a summer robotics project at Mesa State College and have run into an early snag. &lt;br&gt;We have the serializer controller board with the bluetooth serial interface with one servo connected to servo pin 1 (digital 8). When we try to run this code: &lt;br&gt;&lt;br&gt;[i]using System;&lt;br&gt;using System.Collections.Generic;&lt;br&gt;using System.Linq;&lt;br&gt;using System.Text;&lt;br&gt;&lt;br&gt;using RoboticsConnection.Serializer;&lt;br&gt;using RoboticsConnection.Serializer.Components;&lt;br&gt;using RoboticsConnection.Serializer.Controllers;&lt;br&gt;using RoboticsConnection.Serializer.Ids;&lt;br&gt;using RoboticsConnection.Serializer.Sensors;&lt;br&gt;&lt;br&gt;namespace ServoApp&lt;br&gt;{&lt;br&gt;    class Program&lt;br&gt;    {&lt;br&gt;        Serializer serializer;&lt;br&gt;        ServoMotorController antennaServo;&lt;br&gt;&lt;br&gt;        private void InitializeSerializer()&lt;br&gt;        {&lt;br&gt;            serializer = new Serializer();&lt;br&gt;            serializer.BaudRate = 19200;&lt;br&gt;            serializer.PortName = "COM40";&lt;br&gt;            serializer.CommunicationStarted += new SerializerEventHandler(serializer_CommunicationStarted);&lt;br&gt;&lt;br&gt;&lt;br&gt;            antennaServo = new ServoMotorController(serializer);&lt;br&gt;            antennaServo.ServoMotorId = ServoMotorId.ServoMotor1;&lt;br&gt;            antennaServo.Position = -100;&lt;br&gt;&lt;br&gt;            serializer.Run();&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        void serializer_CommunicationStarted(Serializer sender)&lt;br&gt;        {&lt;br&gt;            serializer.BlinkLED(LedId.Led1, 50);&lt;br&gt;            serializer.BlinkLED(LedId.Led2, 100);&lt;br&gt;            serializer.Units = Units.English;&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        static void Main(string[] args)&lt;br&gt;        {&lt;br&gt;            Program p = new Program();&lt;br&gt;&lt;br&gt;            System.Threading.Thread thread = new System.Threading.Thread(&lt;br&gt;                new System.Threading.ThreadStart(p.InitializeSerializer));&lt;br&gt;            thread.Start();&lt;br&gt;&lt;br&gt;&lt;br&gt;            for (int position = -99; position &lt;= 100; ++position)&lt;br&gt;            {&lt;br&gt;                p.antennaServo.Position = position;&lt;br&gt;                for (int i = 0; i &lt; 100000; ++i) { ; }&lt;br&gt;            }&lt;br&gt;            p.serializer.ShutDown();&lt;br&gt;        }&lt;br&gt;&lt;br&gt;    }&lt;br&gt;}[/i]&lt;br&gt;&lt;br&gt;we get this error:&lt;br&gt;&lt;br&gt;[i]Unhandled Exception: System.NullReferenceException: Object reference not set to&lt;br&gt;an instance of an object.&lt;br&gt;   at RoboticsConnection.Serializer.Internal.CommunicationTask.ThreadProc()&lt;br&gt;   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)&lt;br&gt;   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C&lt;br&gt;ontextCallback callback, Object state)&lt;br&gt;   at System.Threading.ThreadHelper.ThreadStart()&lt;br&gt;&lt;br&gt;[/i]&lt;br&gt;&lt;br&gt;&lt;br&gt;Does anyone have any ideas on what might be wrong here?&lt;br&gt;Thanks &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description><pubDate>Tue, 24 Jun 2008 17:22:23 GMT</pubDate><dc:creator>caquinto</dc:creator></item><item><title>Getting distance traveled from PID controller?</title><link>http://www.roboticsconnection.com/userForums/Topic525-6-1.aspx</link><description>Hi Jason,&lt;br&gt;&lt;br&gt;I've checked the .Net documentation on the PID controller interface and it's not clear to me if I can get the distance traveled between any two points in time.  In other words, suppose I command my robot to move 48 inches but part way through it has to stop because of an obstacle.  I'd like to be able to read off how far it traveled before stopping.  If I were doing it at the firmware level I could clear the encoder counters then read off their values when the robot stopped.&lt;br&gt;&lt;br&gt;Thanks!&lt;br&gt;patrick&lt;br&gt;&lt;br&gt;</description><pubDate>Sat, 31 May 2008 11:08:36 GMT</pubDate><dc:creator>pirobot</dc:creator></item><item><title>How to cleanly shutdown a .NET Serializer application?</title><link>http://www.roboticsconnection.com/userForums/Topic449-6-1.aspx</link><description>Yes, it's me again! :)  I am trying to cleanly shut down my Serializer C# application but I must be missing something.&lt;br&gt;&lt;br&gt;I am using a Bluetooth connection to the Serializer and everything works great in terms of firing up the application, connecting to the Serializer, retrieving senors values, etc.  Then I close my Windows form and issue either a Serializer Shutdown() or StopCommunication() command--or both--during the "Form Closed" or "Form Closing" event handler.  The application shuts down cleanly with no complaint (I'm running this all in Debug mode within Visual Studio 2005).  However, if I fire the application up again, it connects to the Serializer but no longer sees any sensor values--in other words, the fields on my form that display the sensor values all show 0.  With the application still running, if I reset the Serializer using the little white push button, then the sensor values show up again.  This behavior always occurs--I can never run the application twice in a row without resetting or power-cycling the Serializer.&lt;br&gt;&lt;br&gt;Any thoughts?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;patrick&lt;br&gt;</description><pubDate>Thu, 24 Apr 2008 15:28:20 GMT</pubDate><dc:creator>pirobot</dc:creator></item><item><title>Volume, Pitch and Speed for SP03?</title><link>http://www.roboticsconnection.com/userForums/Topic500-6-1.aspx</link><description>Hello Jason,&lt;br&gt;&lt;br&gt;Is there a way to embed volume, pitch or speed control characters in the string phrase passed to the SP03.Speak method?    When I used my SP03 with a Brainstem controller in the past, the Acroname software interface had a way to set these parameters.&lt;br&gt;&lt;br&gt;Thanks!&lt;br&gt;patrick&lt;br&gt;</description><pubDate>Wed, 14 May 2008 20:33:33 GMT</pubDate><dc:creator>pirobot</dc:creator></item><item><title>How to program the Serializer WL with VB.NET?</title><link>http://www.roboticsconnection.com/userForums/Topic496-6-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I'm living in Europe (Belgium, Brussels) and I was looking for a controller that could work in both Visual Studio .NET and MSRS. So I found the Serializer WL, ordered it and experimented with it in Hyperterm. Everything works well! &lt;/P&gt;&lt;P&gt;Now, I want to drive some servo's (and probably in the near future also DC motors and sensors) with the VB 2005 express edition, but unfortunately I only find examples and software code in C#. &lt;/P&gt;&lt;P&gt;Is there anybody that can help me transferring this C# code into operating VB code? Maybe 1 or 2 small examples "how to drive servo's" will do the job!&lt;/P&gt;&lt;P&gt;Thanks and greetz from Belgium!&lt;/P&gt;&lt;P&gt;Sven Somers</description><pubDate>Mon, 12 May 2008 11:38:14 GMT</pubDate><dc:creator>sven.somers@gmail.com</dc:creator></item><item><title>Correct use of "static" Serializer object in C#?</title><link>http://www.roboticsconnection.com/userForums/Topic432-6-1.aspx</link><description>Hi Jason (or anyone else who knows!),&lt;br&gt;&lt;br&gt;I'm trying to declare my Serializer object in a C# application in such a way that I can add sensors and drive motor objects by way of their own classes.  In other words, in my main Windows Forms application, I want to be able to do something like this:&lt;br&gt;&lt;br&gt;mySerializer = new Serializer();&lt;br&gt;mySensors = new Sensors();&lt;br&gt;myDriveMotors = new DriveMotors();&lt;br&gt;&lt;br&gt;where, for example, the Sensors class looks something like:&lt;br&gt;&lt;br&gt;    public class Sensors&lt;br&gt;    {&lt;br&gt;        public Ping sPing;&lt;br&gt;&lt;br&gt;        public Sensors()&lt;br&gt;        {&lt;br&gt;            sPing = new Ping(Serializer);&lt;br&gt;            sPing.Pin = GpioPinId.Pin0;&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;&lt;br&gt;and similarly for the Controller and DriveMotors classes.   Then, in the rest of my application, I can refer to the Ping sensor as mySensors.sPing etc.&lt;br&gt;&lt;br&gt;The Serializer class of course creates a new Serializer object and then runs StartCommunication().  My problem is that I can't figure out what needs to be static (or not) so that I don't get "null object references" when I create the Sensors and DriveMotors classes (which depend on the Serializer object).  Similarly, I'm not sure if I call StartCommunication() before or after I instantiate the Sensors and DriveMotors classes.&lt;br&gt;&lt;br&gt;I know if I put all the sensor and motor definitions in the same class file as the Serializer, then I can get things to work, but I'm trying to make my code a little more modular.&lt;br&gt;&lt;br&gt;Does this make any sense???&lt;br&gt;&lt;br&gt;--patrick</description><pubDate>Wed, 23 Apr 2008 15:31:56 GMT</pubDate><dc:creator>pirobot</dc:creator></item><item><title>Can't toggle Ping from Enabled=false to Enabled=true</title><link>http://www.roboticsconnection.com/userForums/Topic358-6-1.aspx</link><description>Hi Jason and Ringo,&lt;br&gt;&lt;br&gt;I am simply trying to toggle one of my Ping sensors from Enabled=true to Enabled=false, then back to Enabled=true.  My simplest test pseudo code is:&lt;br&gt;&lt;br&gt;Ping.Enabled=false&lt;br&gt;sleep 2 seconds&lt;br&gt;Ping.Enabled=true&lt;br&gt;&lt;br&gt;What I observe is that the first line successfully turns the Ping sensor off (LED stops flashing and I don't get updated distances), but the third line does not turn it back on.  Am I missing something?&lt;br&gt;&lt;br&gt;I am using the latest Serializer.NET library and firmware 1.5.1.&lt;br&gt;&lt;br&gt;On a related note, do you happen to know the fastest meaningful update frequency one can use with the Ping sensors?  Ditto for the GP2D12 sensors.  In other words, what is the minimum round trip time for a manual update() and distance reading using these two sensors and the Serializer? (I imagine the Ping sensor will take longer than the IR sensor.)&lt;br&gt;&lt;br&gt;Thanks!&lt;br&gt;patrick&lt;br&gt;</description><pubDate>Thu, 17 Apr 2008 08:15:52 GMT</pubDate><dc:creator>pirobot</dc:creator></item><item><title>Servo controll</title><link>http://www.roboticsconnection.com/userForums/Topic334-6-1.aspx</link><description>Hi in the moment I can make a simple Programm in which i can show the state of the Digital Pins, controll the LEDs and two Motors.&lt;P&gt;Now I have added a Servo on Servo Pin1. In the timer, where I controll a Motor with the Digital Pin1, I have added the Position argument for the Servo.&lt;/P&gt;&lt;P&gt;When I Start the Programm, the Servo goes first time to the positon. After this the Servo don´t work. At the same time I can´t controll the Motor with my Button.&lt;/P&gt;&lt;P&gt;When I delete the Servo.Position = 40; in my Programm, I can controll the Motor.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Collections.Generic;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.ComponentModel;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Data;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Drawing;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Linq;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Text;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Windows.Forms;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Threading;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; RoboticsConnection.Serializer;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; RoboticsConnection.Serializer.Components;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; RoboticsConnection.Serializer.Controllers;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; RoboticsConnection.Serializer.Ids;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; RoboticsConnection.Serializer.Sensors;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;namespace&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; WindowsFormsApplication1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;partial&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Form1&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; : &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Form&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Serializer&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; _s;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;PwmDCMotorController&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; _motor;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ServoMotorController&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; _servo;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;GpioPin&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; _pin;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Form1()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;InitializeComponent();&lt;/P&gt;&lt;P&gt;_s = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Serializer&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/P&gt;&lt;P&gt;_s.PortName = &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"COM40"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_s.BaudRate = 19200;&lt;/P&gt;&lt;P&gt;_s.CommunicationStarted +=&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;SerializerEventHandler&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(_s_CommunicationStarted);&lt;/P&gt;&lt;P&gt;_motor = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;PwmDCMotorController&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(_s);&lt;/P&gt;&lt;P&gt;_motor.DCMotorId = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;DCMotorId&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.DCMotor1;&lt;/P&gt;&lt;P&gt;_motor.Speed = 0;&lt;/P&gt;&lt;P&gt;_pin = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;GpioPin&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(_s);&lt;/P&gt;&lt;P&gt;_pin.Pin = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;GpioPinId&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Pin1;&lt;/P&gt;&lt;P&gt;_pin.Enabled = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_servo = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ServoMotorController&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(_s);&lt;/P&gt;&lt;P&gt;_servo.ServoMotorId = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ServoMotorId&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.ServoMotor1;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;// _servo.Position = 0;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;_s.StartCommunication();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; _s_CommunicationStarted(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Serializer&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; sender)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;timer1.Enabled = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; timer1_Tick(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (_pin.State == &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;_motor.Speed = 80;&lt;/P&gt;&lt;P&gt;_servo.Position = 50;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (_pin.State == &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;{ &lt;/P&gt;&lt;P&gt;_motor.Speed =0;&lt;/P&gt;&lt;P&gt;_servo.Position = -50;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;_s.PumpEvents();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Sat, 12 Apr 2008 02:53:12 GMT</pubDate><dc:creator>Silvermatrix</dc:creator></item><item><title>Trouble accessing CMPS03 via I2CGeneric</title><link>http://www.roboticsconnection.com/userForums/Topic260-6-1.aspx</link><description>I attempted to roughly follow the example for the I2CDevice accessing CMPS03 compass, posted at:&lt;BR&gt;&lt;A href="http://www.roboticsconnection.com/multimedia/libraries/MSDNDocumentation/_23n15r2ti.htm"&gt;http://www.roboticsconnection.com/multimedia/libraries/MSDNDocumentation/_23n15r2ti.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The main difference being that I am doing it from a Windows Forms not Console.  Here is what I coded, which is not working (always returns "255").  [FYI, my compass is working fine using Serializer.NET class CMPS03, so its not a hardware issue].  Let me know if you see anything wrong here ...&lt;/P&gt;&lt;P&gt;[Declaration]:&lt;BR&gt;private static I2CDevice i2cd;&lt;/P&gt;&lt;P&gt;&lt;BR&gt;[Form_Load]:&lt;BR&gt;i2c = new I2CDevice(serializer)&lt;BR&gt;i2cd.I2CAddress = 0xC0;&lt;BR&gt;i2cd.ReadCommand = "1";&lt;BR&gt;i2cd.WriteCommand = "1";&lt;BR&gt;//I notice there is no i2cd.Update() like I would normally use for CMPS03 class?&lt;/P&gt;&lt;P&gt;[Periodic_Timer_Tick]:&lt;BR&gt;serializer.PumpEvents();&lt;BR&gt;i2cd.Write();&lt;BR&gt;lblCompass.Text = i2cd.Read().ToString();    //always posts 255 to my label</description><pubDate>Thu, 27 Mar 2008 17:21:25 GMT</pubDate><dc:creator>cjohns</dc:creator></item><item><title>High resolution CMPS03 readings</title><link>http://www.roboticsconnection.com/userForums/Topic259-6-1.aspx</link><description>I am experimenting with my CMPS03.  Using compass.Heading() gets me a number between 0 and 255, which you are pulling from I2C register 1, according to my manual for this sensor.  &lt;/P&gt;&lt;P&gt;However, there is a higher-resolution compass bearing (0 to 3599) available in registers 2 and 3 (divide by 10 to get actual compass bearing, in degrees).  That value (in actual degrees) seems more useful.  Any chance you could add that to the Serializer.NET class?  I'd suggest just creating a new property, maybe HighResolutionHeading() or HeadingInDegrees() or something like that, so as not to affect anyone who may have programmatically used the regular Heading() already in their code.    &lt;/P&gt;&lt;P&gt;In the meantime, that gives me an excuse to tinker with the I2C Generic you showed me in a previous post. I'm going to see if I can pull this high resolution reading using that, to hone my skills for when I get a power supply for my MD23. :)</description><pubDate>Thu, 27 Mar 2008 16:16:12 GMT</pubDate><dc:creator>cjohns</dc:creator></item><item><title>I2C Generic to MD23</title><link>http://www.roboticsconnection.com/userForums/Topic247-6-1.aspx</link><description>Jason,&lt;/P&gt;&lt;P&gt;Thanks for your response to my earlier post.  I'll pull this out into a separate topic in case it might help someone else.  I saw the I2CDevice object and figured that would be the way to go, for communicating with the not-yet-supported MD23 I2C device.  &lt;/P&gt;&lt;P&gt;However, I got a little hung up with the I2C byte sequences that you mention.  The MD23 documentation discussing the registers, etc., is at &lt;A href="http://www.robot-electronics.co.uk/htm/md23tech.htm"&gt;http://www.robot-electronics.co.uk/htm/md23tech.htm&lt;/A&gt; and it describes "first send a start bit, the module address (0xB0 for example) with the read/write bit low, then the register number you wish to read [there is a list of registers, 0-16, in a table there].  This is followed by a repeated start and the module address again with the read/write bit high (0xB1 in this example).  You are now able to read one or more registers."&lt;/P&gt;&lt;P&gt;Being a relative newbie to I2C and serial communication, I haven't quite been able to translate that into C#, let alone English :)&lt;/P&gt;&lt;P&gt;What i2cd.Write() command(s) would I issue to this (assuming it's at its default I2C address, 0xB0) to read the battery volts (register 10) and write a mode of "2" to register 16?  [A read example and a write example should be enough to get me off to the races!] :)&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Wed, 26 Mar 2008 11:45:20 GMT</pubDate><dc:creator>cjohns</dc:creator></item><item><title>Serializer .NET Library v1.2.3.0 Released</title><link>http://www.roboticsconnection.com/userForums/Topic236-6-1.aspx</link><description>We just released the Serializer .NET Library version 1.2.3.0&lt;UL&gt;&lt;LI&gt;&lt;A href="http://www.roboticsconnection.com/p-16-serializer-net-robot-controller.aspx"&gt;Serializer Page&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://www.roboticsconnection.com/multimedia/libraries/Installer_11.msi"&gt;Serializer .NET Library Installer&lt;/A&gt; (msi)&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://www.roboticsconnection.com/multimedia/libraries/SerializerReleaseNotes_v1.2.3.0.txt"&gt;Serializer .NET Library Release Notes&lt;/A&gt; (.txt)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This fixed the following issues:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;PIDMotorController not allowing identical distance and rotation angles to be set back-to-back&lt;/LI&gt;&lt;LI&gt;TPA81 Fahrenheit conversion bug&lt;/LI&gt;&lt;LI&gt;Updated and auto compiled MSDN documentation examples&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Best Regards!</description><pubDate>Tue, 25 Mar 2008 19:02:53 GMT</pubDate><dc:creator>jsummerour</dc:creator></item><item><title>Suggestions for addition to SerializerLIB</title><link>http://www.roboticsconnection.com/userForums/Topic238-6-1.aspx</link><description>For whatever it is worth, here are a couple things I'd like to see in a future Serializer.NET (and Robotics Studio) release:&lt;/P&gt;&lt;P&gt;1. A class for the Sharp GP2Y0A02YK infrared sensor (8-60").  &lt;/P&gt;&lt;P&gt;2. A class for the Devontech MD23 (I2C H-Bridge).</description><pubDate>Tue, 25 Mar 2008 21:56:50 GMT</pubDate><dc:creator>cjohns</dc:creator></item><item><title>TPA81 reads differently when calling from RoboticsStudio vs. Serializer.NET</title><link>http://www.roboticsconnection.com/userForums/Topic230-6-1.aspx</link><description>I have a TPA81 that reads usually 75-77 F (24-25C) in Robotics Studio service TPA81Service.  However, if I poll the exact same sensor from a Windows Forms application using Serializer.Net call like this:&lt;P&gt;lblTemp = tpa81[0].Temperature.ToString();   //get ambient temp&lt;/P&gt;&lt;P&gt;the value I get returned is usually 56-57.  If I heat the thing up, it goes up; if I cool it down, it goes down.  So on a relative basis it seems to be working, but the value it is returning is clearly not Celsius or Fahrenheit.  The same for all the other eight temp points.  I know the sensor is working fine, because RoboticsStudio service is correctly reading the temps off it.  Is my programmatic call above retrieving some kind of raw sensor reading that needs to be converted to F or C?  (If so, what is the formula?)  Or what might be going on here, any ideas?&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Tue, 25 Mar 2008 13:11:37 GMT</pubDate><dc:creator>cjohns</dc:creator></item><item><title>Serializer .NET Library User Documentation and Examples Updated</title><link>http://www.roboticsconnection.com/userForums/Topic154-6-1.aspx</link><description>I just updated the Serializer .NET Library User Documentation &lt;A href="http://www.roboticsconnection.com/multimedia/libraries/MSDNDocumentation/"&gt;pages&lt;/A&gt;.&lt;P&gt;The updates included:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Example Programs Compiled to ensure there are no compilation errors.&lt;/LI&gt;&lt;LI&gt;Example Programs used are now auto compiled by the Serializer .NET Library Solution to ensure there are no more compilation errors going forward&lt;/LI&gt;&lt;LI&gt;Image Updates&lt;/LI&gt;&lt;LI&gt;Added &lt;A href="http://www.roboticsconnection.com/multimedia/libraries/MSDNDocumentation/msdndocumentation.chm"&gt;.CHM file &lt;/A&gt;to the site, so you can download the Serializer .NET Library Documentation locally&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Best Regards!</description><pubDate>Sun, 16 Mar 2008 20:16:52 GMT</pubDate><dc:creator>jsummerour</dc:creator></item><item><title>Update .Net library and support ?</title><link>http://www.roboticsconnection.com/userForums/Topic28-6-1.aspx</link><description>i when are you inprove the current library ? (In 3 week you said me)&lt;/P&gt;&lt;P&gt;And when you improve documentation because a lot of new fonctions appear but the actual doesn't give any information about it ?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arnaud</description><pubDate>Sun, 20 Jan 2008 09:25:19 GMT</pubDate><dc:creator>Arnaud</dc:creator></item><item><title>Serializer .NET update? :)))</title><link>http://www.roboticsconnection.com/userForums/Topic60-6-1.aspx</link><description>Hi guys,&lt;br&gt;&lt;br&gt;Congrats on your new forums and website--very nice!  In the meantime, my poor robot is really beginning to suffer from the still-existing bug in the .NET libraries regarding PID motion control.  (The one where a minus sign gets dropped or added so that a left rotation command actually rotates the robot to the right, or a forward command actually makes the robot go backward...)   You mentioned back on Jan 16 that you hoped to have an update available within three weeks--do you have a new ETA?  I'm really start to depend on your most excellent Serializer and so would appreciate the bug fix.&lt;br&gt;&lt;br&gt;Thanks!&lt;br&gt;patrick&lt;br&gt;</description><pubDate>Mon, 18 Feb 2008 08:50:48 GMT</pubDate><dc:creator>pirobot</dc:creator></item><item><title>Serializer .NET Library v1.2.2.4 and Firmware v1.5.2 Released</title><link>http://www.roboticsconnection.com/userForums/Topic103-6-1.aspx</link><description>The Serializer .NET Library v1.2.2.4 was released today which contains the following enhancments.&lt;UL&gt;&lt;LI&gt;Added QueryStatus() to query internal PID algorithm status to determine when PID distance algorithm has finished traveling specified distance in the PIDMotorController class.&lt;/LI&gt;&lt;LI&gt;PIDMotorController no longer derives from QueryableComponentBase, but from SerializerComponent now.&lt;/LI&gt;&lt;LI&gt;Changed PIDMotorController QueryVelocities() to be manually invoked, instead of invoked at a specified UpdateFrequency.&lt;/LI&gt;&lt;LI&gt;Added Motor1Speed and Motor2Speed properties to the PIDMotorController class.&lt;/LI&gt;&lt;LI&gt;Updated Velocity and Distance PID params to work w/ latest motors on Traxster and Stinger&lt;/LI&gt;&lt;LI&gt;Updated encoder params to match latest encoders on Traxster and Stinger &lt;/LI&gt;&lt;LI&gt;Added optional DistDeadband and DeadbandEnabled PIDMotorController properties to work with firmware versions 1.5.2 and higher.&lt;/LI&gt;&lt;LI&gt;Added ConstantUpdates property to LineFollowingSensor, so that the LineSensorChanged event constantly occurs (based on UpdateFrequency).  ConstantUpdates defaults to false, in which case the LineSensorChanged event only occurs when the actual value of the sensor changes.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We also launched a new Serializer Firmware version, v1.5.2, which includes the following enhancements:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Added Deadband for Distance PID.  Also added additional (optional) deadband parameter for 'dpid' command so you can set the deadband.  Deadband is defaulted to 5, and you shouldn't really need to set it.&lt;/LI&gt;&lt;LI&gt;Modified mogo and digo commands to set wheels speeds as close to the same time as possible.  Mismatched motors might still show signs of one starting over the other.&lt;/LI&gt;&lt;LI&gt;Updated PID velocity and distance parameters for smoother acceleration for the DC Gearhead Motor combo used in our Traxster and Stinger Robot Kits. (vpid -&amp;gt; 10:0:5:10   dpid -&amp;gt; 1:0:0:20:5)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The Serializer .NET Library and Firmware can be downloaded from the &lt;A href="http://www.roboticsconnection.com/p-16-serializer-net-robot-controller.aspx"&gt;Serializer Robot Controller Page&lt;/A&gt; under the Docs/HowTo/Documentation tab.   The MSDN style documentation has also been updated to reflect the latest changes in the .NET Library.&lt;/P&gt;&lt;P&gt;Best Regards!</description><pubDate>Tue, 04 Mar 2008 20:31:03 GMT</pubDate><dc:creator>jsummerour</dc:creator></item><item><title>Is it possible programming robots without .Net library?</title><link>http://www.roboticsconnection.com/userForums/Topic14-6-1.aspx</link><description>Absolutely.  All you have to do is have the ability to open up a serial (COM) port, set the proper settings (baud rate, start/stop bits, etc), and send/receive commands/responses to/from the Serializer using the Serializer Protocol, which is documented in the &lt;A href="http://www.roboticsconnection.com/multimedia/docs/SerializerWL_UserGuide_v2.0.pdf"&gt;&lt;FONT color=#003366&gt;Serializer User Guide&lt;/FONT&gt;&lt;/A&gt;.&lt;P&gt;Thus, if you have the ability to open up a COM port within another language/framework, then you can certainly control/query everything supported by the Serializer.&lt;/P&gt;&lt;P&gt;Best Regards,</description><pubDate>Sat, 19 Jan 2008 19:14:30 GMT</pubDate><dc:creator>jsummerour</dc:creator></item><item><title>When to use Serializer.Run() and Serializer.PumpEvents()</title><link>http://www.roboticsconnection.com/userForums/Topic4-6-1.aspx</link><description>&lt;SPAN class=Forum_Normal id=spBody&gt;For those of you who have used the Serializer .NET library, you have probably seen that there are two ways to allow the library to send out events for the various objects as your application is running.   &lt;P&gt;You can either use:&lt;/P&gt;&lt;P&gt;1.) Serializer.Run(), or&lt;/P&gt;&lt;P&gt;2.) In an infinite loop, call Serializer.PumpEvents()&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Serializer.Run()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The Serializer.Run() method is useful if don't need to perform any processing in between events (such has handle button clicks, read joysticks, invoke other methods or interfaces).  Thus, if you have a simple application where all you want to do is print the output of various sensors values to the screen, and you have nothing else to do, then Serializer.Run() is your command.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;using RoboticsConnection.Serializer;&lt;BR&gt;using RoboticsConnection.Serializer.Ids;&lt;BR&gt;using RoboticsConnection.Serializer.Sensors;&lt;BR&gt;using RoboticsConnection.Serializer.Components;&lt;BR&gt;using RoboticsConnection.Serializer.Controllers;&lt;BR&gt;using System;&lt;BR&gt;&lt;BR&gt;namespace test&lt;BR&gt;{&lt;BR&gt;   class Program&lt;BR&gt;   {&lt;BR&gt;      static Serializer serializer;&lt;BR&gt;      static GP2D12 irSensor;&lt;BR&gt;&lt;BR&gt;      static void Main(string[] args)&lt;BR&gt;      {&lt;BR&gt;          serializer = new Serializer();&lt;BR&gt;&lt;BR&gt;          // Sign up for the CommunicationStarted event, so we'll know&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;          // that the library has established communications w/ the board&lt;BR&gt;          serializer.CommunicationStarted += new SerializerEventHandler(serializer_CommunicationStarted);&lt;BR&gt;&lt;BR&gt;          // Create some object:&lt;BR&gt;&lt;FONT size=3&gt;&lt;FONT size=2&gt;          irSensor = new GP2D12(serializer);&lt;BR&gt;          irSensor.Pin = AnalogPinId.Pin2; &lt;BR&gt;          irSensor.UpdateFrequency = 50;&lt;BR&gt;          irSensor.DistanceChangedThreshold = 0.5;  &lt;BR&gt;&lt;BR&gt;          // Sign up to receive events from the GP2D12 object:    &lt;BR&gt;          irSensor.DistanceChanged += new SerializerComponentEventHandler(irSensor_DistanceChanged);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT size=3&gt;&lt;FONT size=2&gt;          serializer.StartCommunication();&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;          // Enter the run loop, which constantly invokes Serializer.PumpEvents()&lt;BR&gt;          // Communication with the serializer board is started and this thread &lt;BR&gt;          // is blocked until ShutDown() is called (presumably in an event handler).&lt;BR&gt;          // As PumpEvents() gets called internally, event for various objects, e.g. GP2D12&lt;BR&gt;          // will be signalled, and our handlers below will be invoked.&lt;BR&gt;          serializer.Run();&lt;BR&gt;      }&lt;BR&gt;&lt;BR&gt;      // This gets invoked once the Serializer object has established communication&lt;BR&gt;      // with the Serializer board:&lt;BR&gt;      static void serializer_CommunicationStarted(Serializer sender)&lt;BR&gt;      {&lt;BR&gt;          Console.WriteLine("Communication Started.");&lt;BR&gt;      }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;      // This gets invoked once the GP2D12 distance has changed&lt;BR&gt;      // more than the threshold amount specified above.&lt;BR&gt;      static void irSensor_DistanceChanged(SerializerComponent sender)&lt;BR&gt;      {&lt;BR&gt;          Console.WriteLine("New gp2d12 distance: {0}", irSensor.Distance);&lt;BR&gt;      }&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;BR&gt;&lt;FONT size=2&gt;   }&lt;BR&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Serializer.PumpEvents()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you want to perform other processing in between events sent out from the Serializer .NET library, then you'll want to set up your own internal loop, whether it be a while(true) { } loop, or a Timer.Tick() handler (via a Windows Form), and invoke Serializer.PumpEvents() within that loop.  Building on the example above you would then have:&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;using RoboticsConnection.Serializer;&lt;BR&gt;using RoboticsConnection.Serializer.Ids;&lt;BR&gt;using RoboticsConnection.Serializer.Sensors;&lt;BR&gt;using RoboticsConnection.Serializer.Components;&lt;BR&gt;using RoboticsConnection.Serializer.Controllers;&lt;BR&gt;using System;&lt;BR&gt;&lt;BR&gt;namespace test&lt;BR&gt;{&lt;BR&gt;   class Program&lt;BR&gt;   {&lt;BR&gt;      static Serializer serializer;&lt;BR&gt;      static GP2D12 irSensor;&lt;BR&gt;&lt;BR&gt;      static void Main(string[] args)&lt;BR&gt;      {&lt;BR&gt;          serializer = new Serializer();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;          serializer.PortName = "COM11";&lt;BR&gt;&lt;BR&gt;          // Sign up for the CommunicationStarted event, so we'll know&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;          // that the library has established communications w/ the board&lt;BR&gt;          serializer.CommunicationStarted += new SerializerEventHandler(serializer_CommunicationStarted);&lt;BR&gt;&lt;BR&gt;          // Create some object:&lt;BR&gt;&lt;FONT size=3&gt;&lt;FONT size=2&gt;          irSensor = new GP2D12(serializer);&lt;BR&gt;          irSensor.Pin = AnalogPinId.Pin2; &lt;BR&gt;          irSensor.UpdateFrequency = 50;&lt;BR&gt;          irSensor.DistanceChangedThreshold = 0.5;  &lt;BR&gt;&lt;BR&gt;          // Sign up to receive events from the GP2D12 object:    &lt;BR&gt;          irSensor.DistanceChanged += new SerializerComponentEventHandler(irSensor_DistanceChanged);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT size=3&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;          serializer.StartCommunication();&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;          // Enter an infinite run loop, which constantly invokes Serializer.PumpEvents().&lt;BR&gt;          // This is doing the same thing as Serializer.Run(), however, you get a chance to&lt;BR&gt;          // do other tasks in between the call to Serializer.PumpEvents().&lt;BR&gt;          while(true)&lt;BR&gt;          {&lt;BR&gt;              // Do whatever you need to do here, such as set motor speeds, move servos,&lt;BR&gt;              // make navigation decisions, etc.&lt;BR&gt;&lt;BR&gt;              // Invoke Serializer.PumpEvents() so that any outstanding events &lt;BR&gt;              // that need to be triggered occurs.&lt;BR&gt;              Serializer.PumpEvents();&lt;BR&gt;          }&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;BR&gt;      }&lt;BR&gt;&lt;BR&gt;      // This gets invoked once the Serializer object has established communication&lt;BR&gt;      // with the Serializer board:&lt;BR&gt;      static void serializer_CommunicationStarted(Serializer sender)&lt;BR&gt;      {&lt;BR&gt;          Console.WriteLine("Communication Started.");&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;BR&gt;      }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;      // This gets invoked once the GP2D12 distance has changed&lt;BR&gt;      // more than the threshold amount specified above.&lt;BR&gt;      static void irSensor_DistanceChanged(SerializerComponent sender)&lt;BR&gt;      {&lt;BR&gt;          Console.WriteLine("new gp2d12 distance: {0}", irSensor.Distance);&lt;BR&gt;      }&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;BR&gt;&lt;FONT size=2&gt;   }&lt;BR&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Windows Forms...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you want to build a Windows Form application, and interface the Serializer .NET library, it's really as simple as adding a Timer object (Components ToolBox) to your form...&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://www.roboticsconnection.com/userForums/Uploads/Images/109ff106-5b45-46a5-8833-5138.jpg"&gt;&lt;/P&gt;&lt;P&gt;setting the timer1 Enabled property to false, setting the Interval property to 10 (for example).   If you enable the timer1 Enabled property to True at this point, a race condition exists, and it may attempt to invoke serializer.PumpEvents() in the timer handler before the serializer object exists.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://www.roboticsconnection.com/userForums/Uploads/Images/f7a25f9a-97e0-4525-b526-82c6.jpg"&gt;&lt;/P&gt;&lt;P&gt;and adding a handler to handle the Tick event...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; System;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; System.Collections.Generic;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; System.ComponentModel;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; System.Data;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; System.Drawing;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; System.Text;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; System.Windows.Forms;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; RoboticsConnection.Serializer;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; RoboticsConnection.Serializer.Components;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; RoboticsConnection.Serializer.Controllers;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; RoboticsConnection.Serializer.Ids;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face="Courier New"&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; RoboticsConnection.Serializer.Sensors;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;namespace&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; SerializerTestApp&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;    public&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;partial&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Form1&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; : &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Form&lt;BR&gt;    &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;        private&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Serializer&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; serializer;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;        private&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;PwmDCMotorController&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; motor;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;        private&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;GP2D12&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New" color=#000000&gt; ir;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;        public&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt; Form1()&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            InitializeComponent();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            serializer = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Serializer&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            serializer.PortName = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#a31515 size=2&gt;"COM1"&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            serializer.BaudRate = 19200;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            serializer.Units = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#2b91af size=2&gt;Units&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;.English;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            serializer.CommunicationStarted += &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SerializerEventHandler&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;(serializer_CommunicationStarted);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;            motor = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;PwmDCMotorController&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;(serializer);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            motor.DCMotorId = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#2b91af size=2&gt;DCMotorId&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;.DCMotor1;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            motor.Speed = 0;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;            ir = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;GP2D12&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;(serializer);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            ir.DistanceChangedThreshold = 0.1;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            ir.Pin = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#2b91af size=2&gt;AnalogPinId&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;.Pin0;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;            ir.UpdateFrequency = 50; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;// 50 msec&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;            ir.DistanceChanged += &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SerializerComponentEventHandler&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;(ir_DistanceChanged);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;            serializer.StartCommunication();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;        } &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;        void&lt;/FONT&gt;&lt;FONT size=2&gt; ir_DistanceChanged(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SerializerComponent&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt; sender)&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;{&lt;BR&gt;            &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#2b91af size=2&gt;Console&lt;/FONT&gt;&lt;FONT size=2&gt;.WriteLine(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"Distance Changed: {0}"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;, ir.Distance);&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;        void&lt;/FONT&gt;&lt;FONT size=2&gt; serializer_CommunicationStarted(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Serializer&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt; sender)&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;{&lt;BR&gt;            &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#2b91af size=2&gt;Console&lt;/FONT&gt;&lt;FONT size=2&gt;.WriteLine(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"Communication Started"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;            // Enable timer, which is disabeld by default...&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;            timer1.Enabled = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;BR&gt;        }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff size=2&gt;        private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; timer1_Tick(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt; e)&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;        {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;            // Set motor speed based on distance of object&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;            // in front of ir sensor.&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;            motor.Speed = (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;int&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;)(ir.Distance * 3.22);&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT face="Courier New"&gt;            // Let library signal outstanding events:&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;            serializer.PumpEvents();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;        }&lt;BR&gt;    &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;So, every 100 msec, the timer1_Tick() handler is setting the speed of a motor based on the distance of the object in front of the ir sensor.  Since the speed range of the motor is 0 to 100, and the distance range of the GP2D12 is 4 to 31, the ir distance is scaled by a factor of 3.22 so you can use the full motor speed range for this experiement.   In fact, it's just and example...and the logic isn't really that useful, eh? :)  Notice that even though the motor speed is being set every 100 msec, the internal distance property for the GP2D12 is being set every 50 msec.  When the distance changes more than the specified threshold specified above, then the &lt;FONT face="Courier New" size=2&gt;DistanceChanged event will occur, and the ir_DistanceChanged() handler will be invoked.&lt;/FONT&gt;&lt;/P&gt;&lt;/SPAN&gt;</description><pubDate>Sat, 19 Jan 2008 17:41:04 GMT</pubDate><dc:creator>jsummerour</dc:creator></item></channel></rss>