WPF Data Binding to physical objects (updated)
I had some spare time tonight, so I thought I'd have a go at controlling a small servo I had lying around using an Arduino Uno . That was pretty easy (it is explained on the Arduino website over here ), so I decided to take it a step further. What about writing a .NET application that can control the servo? Right, Windows Forms? Nah... boring... WPF! And to make the code nice and shiny, let's use data binding. Here is a picture: And a video! What does this take? A little bit of code on the Arduino that listens for commands to change the servo position on the serial interface. A .NET class that represents the physical servo, which has a "Position" property (to which we can data bind) and which sends out a command on the serial port when the position changes. The Arduino sketch: The servo class in C#: Let's now use this class to data bind the position of a slider control to the position of the physical servo: The XAML: Side note: for some reason my littl