<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Laurent Ellerbach</title><link>http://blogs.msdn.com/b/laurelle/</link><description>Internet of Things, IoT, Arduino, Netduino, Galileo, Spark.IO, NETMF, .NET Microframework and other embedded gadgets :-)</description><dc:language>fr</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Internet of Things: installing Mono/Linux and Windows Embedded on a BeagleBone Black board (BBB)</title><link>http://blogs.msdn.com/b/laurelle/archive/2015/02/26/internet-of-things-installing-mono-linux-and-windows-embedded-on-a-beaglebone-black-board-bbb.aspx</link><pubDate>Thu, 26 Feb 2015 16:12:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10596239</guid><dc:creator>Laurelle</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10596239</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2015/02/26/internet-of-things-installing-mono-linux-and-windows-embedded-on-a-beaglebone-black-board-bbb.aspx#comments</comments><description>&lt;p&gt;The &lt;a href="http://beagleboard.org/black"&gt;BeagleBone Black&lt;/a&gt;, also called Beagle Bone Black or BBB is an interesting board. It’s an AM335x 1GHz ARM Cortex-A8 with 512M of DDR3, 4GB of flash and does have an HDMI, USB client and host interface. But what I prefer are the 2 times 46 pins to have tons of IO available. It does reduce a bit the number if you are using HDMI. But still, it’s an interesting board. On the not as good aspect the analogic entries are only 1.8V max and not protected (so you need to add a 1.8V Zener diode to protect all analogic entries.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8233.clip_5F00_image001_5F00_2.png"&gt;&lt;img title="clip_image001" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3581.clip_5F00_image001_5F00_thumb.png" width="198" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The board does natively run Linux on it on the embedded Flash. And you can flash it with another Linux or even Windows Embedded see &lt;a href="https://beaglebonebsp.codeplex.com/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I’m a C# guy (ok, sometimes I do some C++ too) so I like anything running C#. And I always try to find a way to develop using C# on any board. Sometimes it’s possible like for the RaspberyPi first version, see my blog post &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2013/06/21/net-microframework-on-raspberrypi-part-1.aspx" target="_blank"&gt;here&lt;/a&gt;. C” with either the full Microsoft .Net framework or the open source Mono one is a great way to be super productive in terms of development. Even in the embedded world if you don’t need hard code real time. And in the case you need some, then switch to C++ and create your own dll which you’ll be able to use later with C# for the rest.&lt;/p&gt;  &lt;p&gt;In this article, I’ll explain how to install a new Linux compatible to install Mono as well as a Windows Embedded image.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;The Linux way&lt;/h2&gt;  &lt;p&gt;I’m not a Linux guy and I have to admit, I had to spend quite a lot of time for this step. I realized not all SD cards were compatible and I had no real way to check this on Linux before really booting on the SD. So make sure you have recent SD card and looks like it will work fine.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 1: find a version that is BBB compatible&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;After researches using Bing, I found a link explaining almost everything. The project was about developing using Mono including classes to access the GPIO. You’ll find the full site &lt;a href="http://www.ofitselfso.com/Beagle/InstallingArmhfKernelBeagleboneBlack.php" target="_blank"&gt;here&lt;/a&gt;. So I learned I need to install on the board an armhf version of Linux. The one present is just arm and Mono does not work on it.&lt;/p&gt;  &lt;p&gt;So after spending time figuring out that some of my SD card were not compatible while booting but compatible for flashing under Linux, I’ve finally found one recent compatible one. And to make sure the image was correct, I went for the Windows way of flashing. So I’ve downloaded an img file from &lt;a href="http://elinux.org/BeagleBoardUbuntu" target="_blank"&gt;here&lt;/a&gt;. The &lt;a href="https://rcn-ee.net/rootfs/2015-02-19/microsd/bb-ubuntu-14.04.2-console-armhf-2015-02-19-2gb.img.xz" target="_blank"&gt;BB-ubuntu-14.04.2-console-armhf-2015-02_19-2gb.img.xz&lt;/a&gt; is working perfectly. And as recommended, I used the &lt;a href="https://wiki.ubuntu.com/Win32DiskImager" target="_blank"&gt;Win32DiskImager&lt;/a&gt; to flash the image. Other equivalent tools are also working perfectly.&lt;/p&gt;  &lt;p&gt;Once flashed, put the SD card into the SD card reader, press the button which is up to the SD card, plug the power and release the button. This will make the BBB boot on the SD card. If none of the blue led is flashing, then you’ve most likely have the same issue as me with none compatible SD card. Try with another one! If it’s blinking, then everything should be all good.&lt;/p&gt;  &lt;p&gt;You can easily test but using PuTTY or equivalent to connect to the board using SSH on port 22 with the IP address the board will get. If you don’t know or if you are not sure, just plug the board with the USB cable on your PC, use the address 192.168.7.2 to connect.&lt;/p&gt;  &lt;p&gt;If everything goes correctly, you’ll be able to log with “ubuntu” as username and “temppwd” as the password.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7167.clip_5F00_image003_5F00_2.jpg"&gt;&lt;img title="clip_image003" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6102.clip_5F00_image003_5F00_thumb.jpg" width="244" height="157" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;At this point, you can go to the next step. If you don’t have this screen, it does mean you’ve most likely miss something or your SD is not compatible.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 2: installation Mono&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;As explained in the &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2013/06/21/net-microframework-on-raspberrypi-part-1.aspx" target="_blank"&gt;RaspberyyPi first version article&lt;/a&gt;, steps are the same. Conect with PuTTY or equivalent, make sure this time, you’re plug to a network cable and have internet access.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;sudo apt-get update&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The password is the same as for the login so “temppwd”. Now, you are downloading all updates, it can take few minutes.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;sudo apt-get install mono-runtime&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;this will get the mono runtime and will allow you to further develop using Visual Studio and C#. Careful as this image is just a console one. If you want to add a desktop, you need to install one. You can for example install Gnome like this:&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;sudo apt-get install ubuntu-desktop&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;b&gt;Step 3: accessing the GPIO thru C#&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;That’s where the first project I found is super useful as it’s a great, efficient implementation of OutpuPort and other well know classes from .Net Microrfamework (NETMF). You can download it directly from &lt;a href="http://www.ofitselfso.com/BBBCSIO/BBBCSIOSource_0101.zip"&gt;here&lt;/a&gt;. From this point, you can extract the source and directly use them in your project.&lt;/p&gt;  &lt;p&gt;You’re now ready to do a C# development using the BBB and some common NETMF classes J For the deployment, either copy your build, or use a network deployment or anything equivalent. I may write as well how to setup the debugger and environment to include a full debugger.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;The Windows Embedded way&lt;/h2&gt;  &lt;p&gt;&lt;b&gt;Step 1: prepare an SD Card with Windows Embedded&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Download the Windows image from Codeplex &lt;a href="https://beaglebonebsp.codeplex.com/" target="_blank"&gt;here&lt;/a&gt;. The download contains an example image. &lt;/p&gt;  &lt;p&gt;You’ll need to prepare your SD card. For this, use diskpart with an admin command prompt:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2656.clip_5F00_image005_5F00_2.jpg"&gt;&lt;img title="clip_image005" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image005" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6011.clip_5F00_image005_5F00_thumb.jpg" width="244" height="126" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then find your SD card, it should be easy to find with the size. Here it’s a 8Gb one, so it’s the Disk 2. Select it by typing &lt;/p&gt;  &lt;p&gt;&lt;i&gt;Select disk 2&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;You can then list the partitions with “&lt;i&gt;List part”&lt;/i&gt; make sure there is just one partition, if it’s not the case, you may have done a mistake with your disk. If you are not sure, it’s better to exit the tool, format your SD card with Windows the normal way and make sure you just have one partition. Make sure the original partition is formatted in FAT32 or exFAT.&lt;/p&gt;  &lt;p&gt;Then select the particition with&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Select part 1&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;Now the partition is selected, you need to make it active. This will allow the boot loader on the board to find the SD card and boot from there. This is done by using the command&lt;/p&gt;  &lt;p&gt;&lt;i&gt;active&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7848.clip_5F00_image007_5F00_2.jpg"&gt;&lt;img title="clip_image007" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image007" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8877.clip_5F00_image007_5F00_thumb.jpg" width="244" height="125" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Exit from diskpart now. Now you need to copy the Windows Embedded files to the bootable SD card you’ve prepared. Launch the TI SDCard boot utility from the tools directory from the downloaded files. Select the MLO file. It will be copied first on the SDCard, then select the other elements so the EBOOTSD.nb0, the logo.bmp and NK.bin files. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4572.clip_5F00_image008_5F00_2.png"&gt;&lt;img title="clip_image008" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image008" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1462.clip_5F00_image008_5F00_thumb.png" width="130" height="94" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Click proceed, skip the formatting of the SD card (should have been done previously and the partition is now active). One done, you’re ready!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6558.clip_5F00_image009_5F00_2.png"&gt;&lt;img title="clip_image009" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image009" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5428.clip_5F00_image009_5F00_thumb.png" width="244" height="211" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Place the SD card in the SD card reader on the board, press the button which is up the SD card reader, plug the power and release the button. &lt;/p&gt;  &lt;p&gt;If everything went correctly, you are now running Windows Embedded Compact version on the BeagleBone Black.&lt;/p&gt;  &lt;p&gt;You can test by trying to find your board on the network. I’m using Advanced IP Scanner. If you’ve used the board previously, the IP address your DHCP server will give will be the same.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8270.clip_5F00_image010_5F00_2.png"&gt;&lt;img title="clip_image010" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image010" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4807.clip_5F00_image010_5F00_thumb.png" width="244" height="35" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can now access the board with Telnet or thru FTP. If you’ve done everything correctly, then you’ll be able to see this from the ftp address:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4338.clip_5F00_image012_5F00_2.jpg"&gt;&lt;img title="clip_image012" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image012" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6825.clip_5F00_image012_5F00_thumb.jpg" width="244" height="78" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And from Telnet:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3247.clip_5F00_image014_5F00_2.jpg"&gt;&lt;img title="clip_image014" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image014" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3107.clip_5F00_image014_5F00_thumb.jpg" width="244" height="155" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;From here, you can now play a bit and try to connect remotely to the device with a tool called “Remote Display Control for Windows CE”. You’ll find the tool in the tools directory. Just type in the telnet session&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Cerdisp -c &lt;/i&gt;&lt;/p&gt;  &lt;p&gt;And launch the Host version on your desktop. You will see the board and you can now play with it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8420.clip_5F00_image016_5F00_2.jpg"&gt;&lt;img title="clip_image016" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image016" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8875.clip_5F00_image016_5F00_thumb.jpg" width="244" height="199" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 2: installing .NET and using GPIO&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;OK, for this step, it’s a bit more complicated as it does require to rebuild totally a Windows CE image for this board. The platform elements are included in the BeagleBone WEC7 SDK file. Once you’ve installed the full Windows Embedded Compact 7, you then install the SDK. And you can create a project to include the .NET framework.&lt;/p&gt;  &lt;p&gt;I haven’t done it yet but I used Windows CE quite a long time ago and there is a lot of fun building your own OS with component. The god news is that Windows EC is free for individuals:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Individual Non-Commercial Use.&lt;/strong&gt; If you are an individual (that is, a natural person, and not an organization, business entity, or unit of government), then you may flash or download the Runtime Image to your device for your own Non-Commercial use.&lt;/p&gt;  &lt;p&gt;From full license &lt;a href="https://msdn.microsoft.com/en-us/library/dn269455.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Access to GPIO is then a bit of development as you’ll need to build a DLL to be able to do it or see if there is an existing one in the PAL. &lt;/p&gt;  &lt;p&gt;If you do an image, please let me know! Enjoy and have fun.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10596239" width="1" height="1"&gt;</description></item><item><title>Servo motor tester in NETMF (.NET Micro Framework) with Netduino</title><link>http://blogs.msdn.com/b/laurelle/archive/2015/01/09/servo-motor-tester-in-netmf-net-micro-framework-with-netduino.aspx</link><pubDate>Fri, 09 Jan 2015 18:36:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10585425</guid><dc:creator>Laurelle</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10585425</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2015/01/09/servo-motor-tester-in-netmf-net-micro-framework-with-netduino.aspx#comments</comments><description>&lt;p&gt;I rencently bought new servo motor as I needed some to pilot new switches in &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/04/26/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-3.aspx" target="_blank"&gt;my Lego train&lt;/a&gt;. The problem is I didn’t found the same as the previous one. Another problem is that I needed to replace one which didn’t worked properly.&lt;/p&gt;  &lt;p&gt;And here came the main issue: find the boundaries of those servo motors. There are databases online but my servo was not existing (or I didn’t found it). My new servo is a Motorcraft MC-410 sold by Connard. So I had to found the boundaries myself. Rather than testing fully blind, I’ve decided to make it in a flexible way. I have a Netduino Plus 2 available for my dev. I also developed a light &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2013/04/07/net-microframework-netmf-web-server-source-code-available.aspx" target="_blank"&gt;WebServer&lt;/a&gt;. So why not build a simple webpage where I’ll be able to change the key settings of the servo and see the impact for real.&lt;/p&gt;  &lt;p&gt;In order to pilot correctly&amp;#160; servo motors, we need to use PWM. It’s quite straight forward to use for servo motors. It’s about having a period and a duration. This duration is from a minimum pulse to a maximum pulse. this will make move the servo motor from its base angle to its maximum angle.&lt;/p&gt;  &lt;p&gt;Usually servo are using a 20000 period and then the minimum pulse vary a lot around 800 microseconds and the maximum one around 2000, sometimes more. But it’s get quite complicated to find the right numbers especially because most of the time, the makers are not providing them as they are usually calibrated with a bit of analogic. &lt;/p&gt;  &lt;p&gt;I build a solution where I have a simple web page and I can change the settings of the servo motor and test them right away. The web page is super simple:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0882.image_5F00_2.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2072.image_5F00_thumb.png" width="289" height="199" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The way it’s working is quite simple, I start with some default settings, put the position at 50% and then try to change the min pulse to 700, then put 0 in the Position and see if it’s moving. If it’s moving, then the boundary is lower, if not, the boundary is higher. and the other way for the higher boundary. The period is usually 20K but some may be lower or higher. This allow also to test up to which value the servo still operate.&lt;/p&gt;  &lt;p&gt;And as a bonus, when the lower and higher boundaries are found, it does allow to measure the full angle the servo can give. In my case, close to 200° which does correspond to the spec.&lt;/p&gt;  &lt;p&gt;On the hardware side, it’s super simple, I’m using the pin D5 for the pilot cable to the servo, it’s a PWM on the Netduino. And then I use 5V and ground for the two other pins. The middle one in most servo is the +5V, the brown/black is the ground, the other one (can be yellow, white, orange, etc) is then the pilot one.&lt;/p&gt;  &lt;p&gt;Here is how it does looks like on my Lego test switch.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1374.WP_5F00_20150109_5F00_002_5F00_2.jpg"&gt;&lt;img title="WP_20150109_002" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="WP_20150109_002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5554.WP_5F00_20150109_5F00_002_5F00_thumb.jpg" width="414" height="235" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In terms of software, I’m using my micro Web Server which I’ve developed. I’m using it because it’s light and I don’t need anything complicated. You can find &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2013/04/07/net-microframework-netmf-web-server-source-code-available.aspx" target="_blank"&gt;the source code here&lt;/a&gt; and more explanation &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/29/creating-an-efficient-http-web-server-for-net-microframework-netmf.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The full code source is here:&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; System;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; System.Net;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; System.Net.Sockets;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; System.Threading;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; Microsoft.SPOT;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; Microsoft.SPOT.Hardware;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; SecretLabs.NETMF.Hardware;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; SecretLabs.NETMF.Hardware.Netduino;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; NetduinoLibrary.Toolbox;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;namespace&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; Servo_test&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#2b91af"&gt;Program&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; SecretLabs.NETMF.Hardware.&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;PWM&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; pwm = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; SecretLabs.NETMF.Hardware.&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;PWM&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Pins&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.GPIO_PIN_D5);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; server;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//string constant&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; strOK = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;OK&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; strProblem = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;Problem&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; pageReq = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;req.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; paramMinPulse = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;mi&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; paramMaxPulse = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;ma&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; paramPeriod = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;pe&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; paramPosition = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;po&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//servo info&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; MinPulse = 800;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; MaxPulse = 2200;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; Period = 20000;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; Position = 0;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; Main()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;server = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;(80, 10000);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;server.CommandReceived += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;GetRequestHandler&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;(ProcessClientGetRequest);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;server.Start();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Thread&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.Sleep(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Timeout&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.Infinite);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; DecryptRequest(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; strDecrypt)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// decode params&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Param&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;[] Params = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.decryptParam(strDecrypt);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; mMin = -1;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; mMax = -1;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; mPeriod = -1;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; mPosition = -1;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; isvalid = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; (Params != &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; i = 0; i &amp;lt; Params.Length; i++)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//on cherche le paramètre strMonth&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; j = Params[i].Name.ToLower().IndexOf(paramMinPulse);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (j == 0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;mMin = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Convert&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.ToInt32(Params[i].Value);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (mMin&amp;lt;0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;isvalid = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;false&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;j = Params[i].Name.ToLower().IndexOf(paramMaxPulse);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (j == 0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;mMax = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Convert&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.ToInt32(Params[i].Value);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (mMax&amp;lt;0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;isvalid = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;false&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;j = Params[i].Name.ToLower().IndexOf(paramPeriod);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (j == 0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;mPeriod = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Convert&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.ToInt32(Params[i].Value);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (mPeriod&amp;lt;0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;isvalid = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;false&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;j = Params[i].Name.ToLower().IndexOf(paramPosition);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (j == 0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;mPosition = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Convert&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.ToInt32(Params[i].Value);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (mPosition&amp;lt;0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;mPosition = 0;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (mPosition &amp;gt; 100)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;mPosition = 100;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// check if all params are correct&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (isvalid)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; (!Microsoft.SPOT.Hardware.&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;SystemInfo&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.IsEmulator)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{ &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;(mMin &amp;gt; 0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;MinPulse = (&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)mMin;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (mMax &amp;gt; 0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;MaxPulse = (&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)mMax;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;(mPeriod&amp;gt;0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Period = (&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)mPeriod;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;(mPosition&amp;gt;=0)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Position = (&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)mPosition;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; duration = (&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)(MinPulse + (MaxPulse - MinPulse)/100.0f*Position);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//pwm.SetDutyCycle(duration);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;pwm.SetPulse(Period, duration);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#0000ff"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#0000ff"&gt;else&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Debug&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.Print(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;MinPulse &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; + mMin.ToString() + &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot; MaxPulse &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; + mMax.ToString() + &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot; Period &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; + mPeriod.ToString() + &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot; Position &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; + mPosition.ToString());&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#0000ff"&gt;else&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;isvalid = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;false&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; isvalid;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; ProcessRequest(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Socket&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; response, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; rawURL)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; strResp = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (DecryptRequest(rawURL))&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp = strOK;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#0000ff"&gt;else&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp = strProblem;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.OutPutStream(response, strResp);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; ProcessClientGetRequest(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; obj, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServerEventArgs&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; e)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Socket&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; response = e.response;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; strResp = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; strFilePath = e.rawURL;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//HTP header&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=utf-8\r\nCache-Control: no-cache\r\nConnection: close\r\n\r\n&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.OutPutStream(response, strResp);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (strFilePath.Length &amp;gt;= pageReq.Length)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (strFilePath.Substring(0, pageReq.Length).ToLower() == pageReq)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;ProcessRequest(response, strFilePath);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;!DOCTYPE html PUBLIC \&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN\&amp;quot; \&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\&amp;quot;&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;html xmlns=\&amp;quot;http://www.w3.org/1999/xhtml\&amp;quot;&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Servo Motor Discover&amp;lt;/title&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;meta http-equiv=\&amp;quot;Content-Type\&amp;quot; content=\&amp;quot;text/html; charset=utf-8\&amp;quot;/&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;meta http-equiv=\&amp;quot;Cache-control\&amp;quot; content=\&amp;quot;no-cache\&amp;quot;/&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//create the script part&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;script language=\&amp;quot;JavaScript\&amp;quot;&amp;gt;var xhr = new XMLHttpRequest();function btnclicked(boxMSG, cmdSend) {&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;document.getElementById('status').innerHTML=\&amp;quot;waiting\&amp;quot;;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;xhr.open('GET', cmdSend + boxMSG.value);&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;xhr.send(null); xhr.onreadystatechange = function() {if (xhr.readyState == 4) {document.getElementById('status').innerHTML=xhr.responseText;}};}&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;/script&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.OutPutStream(response, strResp);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//body&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;table &amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Min pulse&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input id=\&amp;quot;MinPulse\&amp;quot; type=\&amp;quot;text\&amp;quot; value=\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;+MinPulse.ToString()+&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input id=\&amp;quot;MinPulseBtn\&amp;quot; type=\&amp;quot;button\&amp;quot; value=\&amp;quot;Update\&amp;quot; onclick=\&amp;quot;btnclicked(document.getElementById('MinPulse'),'req.aspx?mi=')\&amp;quot;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Max pulse&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input id=\&amp;quot;MaxPulse\&amp;quot; type=\&amp;quot;text\&amp;quot; value=\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;+MaxPulse.ToString()+&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input id=\&amp;quot;MaxPulseBtn\&amp;quot; type=\&amp;quot;button\&amp;quot; value=\&amp;quot;Update\&amp;quot; onclick=\&amp;quot;btnclicked(document.getElementById('MaxPulse'),'req.aspx?ma=')\&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Period&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input id=\&amp;quot;Period\&amp;quot; type=\&amp;quot;text\&amp;quot; value=\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; + Period.ToString() + &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input id=\&amp;quot;PeriodBtn\&amp;quot; type=\&amp;quot;button\&amp;quot; value=\&amp;quot;Update\&amp;quot; onclick=\&amp;quot;btnclicked(document.getElementById('Period'),'req.aspx?pe=')\&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Position %&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input id=\&amp;quot;Position\&amp;quot; type=\&amp;quot;text\&amp;quot; value=\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; + Position.ToString() + &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input id=\&amp;quot;PositionBtn\&amp;quot; type=\&amp;quot;button\&amp;quot; value=\&amp;quot;Update\&amp;quot; onclick=\&amp;quot;btnclicked(document.getElementById('Position'),'req.aspx?po=')\&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp += &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;/table&amp;gt;&amp;lt;div id=\&amp;quot;status\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;strResp = &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;WebServer&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.OutPutStream(response, strResp);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;The Main function just create the Web Server.&lt;/p&gt;  &lt;p&gt;ProcessClientGetRequest received all the Get requests from the Web Server. I do analyze the path. If the called page is “req.aspx” I do then call a sub function which will change the servo motor settings. If not, then the main page.&lt;/p&gt;  &lt;p&gt;Let start with the main page source code, I’m using background http requests to change the servo settings. This avoid reloading the page and make it light in terms of discussions with the board, only a light header is sent with a simple status. This is a very simple a typical script that all web dev knows.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#a31515"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span lang="FR" style="font-family: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;language&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; xhr = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; XMLHttpRequest();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;function&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font style="font-size: 10pt" color="#000000"&gt; btnclicked(boxMSG, cmdSend) { &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;span style="font-family: ; line-height: 11pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;document.getElementById(&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;'status'&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;).innerHTML=&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;waiting&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;span lang="FR" style="font-family: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;xhr.open(&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;'GET'&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, cmdSend + boxMSG.value);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;span lang="FR" style="font-family: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;xhr.send(&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;); &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;span lang="FR" style="font-family: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;xhr.onreadystatechange = &lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;() {&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; line-height: 11pt"&gt;&lt;font style="font-size: 10pt" color="#000000"&gt; (xhr.readyState == 4) { &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;span style="font-family: ; line-height: 11pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 10pt"&gt;document.getElementById(&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;'status'&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;).innerHTML=xhr.responseText;}};}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#a31515"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Then it’s a simple tables which does contains the various settings and a button which does call the req.aspx page to update the settings.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#a31515"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#a31515"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; color: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span lang="FR" style="font-family: ; line-height: 11pt; mso-ansi-language: fr"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt;Min pulse&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#a31515"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#0000ff"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#a31515"&gt;input&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; line-height: 11pt"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&amp;quot;MinPulse&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&amp;quot;text&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&amp;quot;800&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;/&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#a31515"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#0000ff"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: ; line-height: 11pt"&gt;&lt;font color="#a31515"&gt;input&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; line-height: 11pt"&gt;&lt;font style="font-size: 10pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&amp;quot;MinPulseBtn&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&amp;quot;button&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&amp;quot;Update&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;onclick&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&amp;quot;btnclicked(document.getElementById('MinPulse'),'req.aspx?mi=')&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;/&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I pass the object so in the code I can read the value. I can do it also in the call but this allow to do other modification if needed from the script. At the end, there is status div to pub the status sent back by the req.aspx page.&lt;/p&gt;  &lt;p&gt;The code to build the page has nothing complicated. The code of the page is build dynamically with predefined values for the text box.&lt;/p&gt;  &lt;p&gt;The function DecryptRequest decrypt the request and the settings. It’s rest API based with parameters in the URL. I would even be able to build a Windows Phone, Windows 8, Android or iOS App if I want &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6472.wlEmoticon_2D00_smile_5F00_2.png" /&gt; Well, let say this test page is enough for me &lt;img class="wlEmoticon wlEmoticon-openmouthedsmile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Rire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3276.wlEmoticon_2D00_openmouthedsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;In the function, after analyzing the parameters and validating few of them, in a very basic, it’s time to change the settings of the servo. The pulse is then calculated and the order to make the PWM work sent with the period.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; duration = (&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;uint&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)(MinPulse + (MaxPulse - MinPulse)/100.0f*Position);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;pwm.SetPulse(Period, duration);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So all up, it’s a good reuse of my Web Server code. And good use of basic javascript in a page. It’s already something I’ve &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/06/20/using-xmlhttprequest-to-pilot-a-lego-train-dynamically-in-html-5.aspx" target="_blank"&gt;used in various projects&lt;/a&gt; and it’s really saving some time. So all up, it took me 5 minutes to find the right settings of the servo and will save me time in the future.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10585425" width="1" height="1"&gt;</description></item><item><title>Manage my wine cellar with QR codes and Microsoft Azure</title><link>http://blogs.msdn.com/b/laurelle/archive/2014/12/26/manage-my-wine-cellar-with-qr-codes-and-microsoft-azure.aspx</link><pubDate>Fri, 26 Dec 2014 21:34:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10583105</guid><dc:creator>Laurelle</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10583105</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2014/12/26/manage-my-wine-cellar-with-qr-codes-and-microsoft-azure.aspx#comments</comments><description>&lt;p&gt;I have quite “few” bottles of wine. I really do like wine a lot. Yes, I’m French &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8080.wlEmoticon_2D00_smile_5F00_2.png" /&gt; As for any resource you use a lot with lots of new items in and out almost every day, you start to have mistakes in your inventory. That’s what happen naturally to any inventory. And you need to rebuild it time to time to check if it’s still correct or not.&lt;/p&gt;  &lt;p&gt;For a very long time, I was using a simple Excel file to manage my wine cellar. With manually decreasing by handwriting the new number of bottles on each line. You can imagine how the line looks like when I have 12 bottles and drink them all between 2 inventory periods. Aalso adding new bottles manually on the paper was quite a challenge. So I needed to do the inventory at least 2 to 3 times a year.&lt;/p&gt;  &lt;p&gt;I was thinking of doing something with barcode and a simple barcode reader. Finally, I never took the time to do it. But recently, I got the idea of using QR Codes, smartphones to recognize the QR Codes and a Cloud website to store everything. &lt;/p&gt;  &lt;p&gt;I went naturally for Microsoft Azure for both the Website using ASP.NET + MVC + EntityFramework and a SQL Azure database. I would have been able to use PHP, Java or any web technology like this but my core skills are more on .NET and C# &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8080.wlEmoticon_2D00_smile_5F00_2.png" /&gt; Note that for the usage I’m doing, the project hosting and database are fully free in Azure. So if you want to do the same, it will be fully free. So let see in 8 simple steps how to make this app.&lt;/p&gt;  &lt;h2&gt;Step 1: Create the Azure Web Site from Visual Studio 2013&lt;/h2&gt;  &lt;p&gt;Visual Studio 2013 is the best development tool I’ve ever used (yes, I do use to test, competitive ones, time to time). Visual Studio have multiple versions and some are for free like &lt;a href="http://www.visualstudio.com/products/visual-studio-community-vs" target="_blank"&gt;Visual Studio Community&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;You will need a Microsoft Azure subscription. To do this application, including the database, you won’t have to pay anything at all. The free hosting and free database is largely enough. So first, click on Trial on the &lt;a href="http://azure.microsoft.com/pricing/free-trial/" target="_blank"&gt;Azure&lt;/a&gt; page and follow the steps. You'll have to use an existing Microsoft Account (ex Live ID), then you’ll have to put your credit card. This is for verification only, after the trial, you won’t be charged, you’ll be able to continue to use the free website and free database.&lt;/p&gt;  &lt;p&gt;To create an Azure Website, you can follow the step by step documented &lt;a href="http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-get-started/" target="_blank"&gt;here&lt;/a&gt;. What is important is to keep the Authentication mechanism into the website, so to select “Individual User Accounts”. This is the only difference from the tutorial. I will use authentication in the web application to make sure not everyone can access some specific parts.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3146.image_5F00_2.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2746.image_5F00_thumb.png" width="499" height="225" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The project is now ready and you already have the ability to add new users. The AspNet* tables are used to manage the users and roles.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7658.image_5F00_4.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3487.image_5F00_thumb_5F00_1.png" width="241" height="185" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Every time a user is registered, the AspNetUsers is filled. As the basic pages does only contains email and password, those 2 are created. Note that the password is not stored, only the Hash code is for security reason. It’s a good habit not to share any password in a database but either a crypted one or just the hash.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1680.image_5F00_6.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3660.image_5F00_thumb_5F00_2.png" width="711" height="33" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Step 2: create the Wine database&lt;/h2&gt;  &lt;p&gt;I made it super simple and straight forward: I’ve only created 1 table called “ListeVin” (WineList in English). Go to the Server management, select your Azure database and select manage it in the server explorer (you may get a message to update the firewall rules on Azure). Right click on Table from the database you’ve created with the website, select Add New Table.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7024.image_5F00_8.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6862.image_5F00_thumb_5F00_3.png" width="244" height="100" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can then start creating new columns. In my case, I’ve created an Id which will be my primary key and can’t be null. Then a region, description and placement (“rangement”) which are text, a year (“annee”), quantity (“quantitee”) and years to keep (“Agarder”) which are integers. Yes, it’s simple, I should have add the creation date, the last update, another table to keep track of the modifications, etc. But I’m more interested for this version to just the necessary.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6648.image_5F00_10.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0841.image_5F00_thumb_5F00_4.png" width="683" height="352" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once done, click on Update, and the database will the create.&lt;/p&gt;  &lt;h2&gt;Step 3: create the Model associated to this table&lt;/h2&gt;  &lt;p&gt;MVC means Model View Controller. The Model is the data part, the View is the page and the Controller is in the middle of the view and the data to perform advanced operations, manage some security, etc. So we need to add a Model first.&lt;/p&gt;  &lt;p&gt;On Models in your project, right click, select “Add” then “New Item…” and “ADO.NET Entity Data Model”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1854.image_5F00_12.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8737.image_5F00_thumb_5F00_5.png" width="630" height="134" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Name it, then Add and select “EF Designer from database”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7674.image_5F00_14.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2262.image_5F00_thumb_5F00_6.png" width="497" height="442" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you haven’t setup the connection to the database, you’ll need to do it selecting “New Connection”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6431.image_5F00_16.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3107.image_5F00_thumb_5F00_7.png" width="392" height="558" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can get the name of your database in the database properties or directly in the Azure portal. Select your database from the drop down list. The next step looks like this, you can include or not the login and password in the code or in the connection string. I’m adding it in the connection string.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8741.image_5F00_46.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2746.image_5F00_thumb_5F00_22.png" width="402" height="359" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the next step, you select the table just created. Note you can select the other tables as well as views, store procedures and functions if you’ve created some.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2705.image_5F00_20.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6560.image_5F00_thumb_5F00_9.png" width="430" height="384" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Just click on Finish and you’ll get now your new entity created. The C# files has been created automatically and will make our life easier later on. There is no need to change anything to the generated code. You can have a look if you want to see all what you’ve avoided to do to access the database &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8080.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0143.image_5F00_22.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3617.image_5F00_thumb_5F00_10.png" width="244" height="223" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Rebuild the full project. It’s important to make sure the Entity is recognize correctly.&lt;/p&gt;  &lt;h2&gt;Step 4: Create the Controller and the View&lt;/h2&gt;  &lt;p&gt;Right click on “Controllers” in the project, select “Controller…” and then “MVC 5 Controller with views, using Entity Framework” and click “Add”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1581.image_5F00_24.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8877.image_5F00_thumb_5F00_11.png" width="435" height="300" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Select the created Model in the previous step as well as the entity in the drop down list. Name it “ListeVinsController”, select “Generate views” at least and click “Add”. You can also select the layout of the project or do it later in the code of the pages.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6663.image_5F00_26.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3173.image_5F00_thumb_5F00_12.png" width="543" height="345" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You’re done for this step. It’s the moment to test the app! Hit F5. You’ll arrive on the default web page. &lt;/p&gt;  &lt;p&gt;Change the URL by replacing “/home/index” by “/ListeVins”. Please note that this name is the Controller name. It’s automatically done by default by removing the “Controller” part of the name. When we’ve created it, I’ve named it “ListeVinsController”. If you had names if “WineListController”, you’ll be able to access the page by putting “/WineList”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8712.image_5F00_28.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6102.image_5F00_thumb_5F00_13.png" width="652" height="161" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;At this moment, you can create new entries, edit then and delete them without any security. And you didn’t had to write any code either to have those pages! This is the beauty of those ASP.NET MVC default pages. And yes, of course, you’ll be able to modify the code later to adapt to your needs. I’ll show an example later.&lt;/p&gt;  &lt;h2&gt;Step 5: Adding security&lt;/h2&gt;  &lt;p&gt;As I wrote in the first step, few tables are created for the users. One is important, it’s called AspNetRoles. This is the one which contains the roles of users. The way the security is working in this MVC model is thru users and or roles. Users can be part of roles. I will use this notion of roles in the code. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8664.image_5F00_30.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8117.image_5F00_thumb_5F00_14.png" width="244" height="93" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I’ve create 2 roles in the previous table. I will use them later in the code. Be careful, they are case sensitive.&lt;/p&gt;  &lt;p&gt;The AspNetUsersRoles is the table linking a user with roles. I’ve linked a use to those 2 roles. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1602.image_5F00_32.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8078.image_5F00_thumb_5F00_15.png" width="244" height="92" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I do this manually but of course, yes, we can also build simple pages to manage all this. But I’ll have something like 5 users so I’ll do it directly in the database &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8080.wlEmoticon_2D00_smile_5F00_2.png" /&gt; Please note that in development mode, you have also a local database. You have to do this modification as well in the local base to be able to use the roles and the users.&lt;/p&gt;  &lt;p&gt;The way to use this security in the code is working either by declaration either by code or both. I’ll use only the declarative way. And it’s very straight forward by adding [Authorize(Roles = “Admin”)] to give access to the admin roles. By default, all anonymous connections are allowed.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// POST: ListeVins/Create&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// To protect from overposting attacks, please enable the specific properties you want to bind to, for &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// more details see http://go.microsoft.com/fwlink/?LinkId=317598.&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;[&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;HttpPost&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;[&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;ValidateAntiForgeryToken&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;[&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Authorize&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(Roles=&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;Admin&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;ActionResult&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; Create([&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Bind&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(Include = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;Id,Region,Description,Annee,Quantite,Rangement,Agarder&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;)] &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;ListeVin&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; listeVin)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (ModelState.IsValid)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;db.ListeVin.Add(listeVin);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;db.SaveChanges();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; RedirectToAction(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;Index&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; View(listeVin);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;You can define one or multiple roles, just separate them with a coma. You can do the same with users for example. But the notion of role is much more flexible than users.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#008000" face="Consolas"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;[&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Authorize&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(Roles = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;Admin,CanEdit&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;ActionResult&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; Edit(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;? id)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; (id == &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;HttpStatusCodeResult&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;HttpStatusCode&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.BadRequest);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;ListeVin&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; listeVin = db.ListeVin.Find(id);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; (listeVin == &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; HttpNotFound();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; View(listeVin);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; line-height: 10pt; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;I did it on the Create, Delete and Edit functions which are the key feature to protect.&lt;/p&gt;  &lt;p&gt;So if you are not registered or if you don’t have the right to access a specific part of the code, you’ll be redirected to the login page:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0083.image_5F00_38.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0028.image_5F00_thumb_5F00_18.png" width="587" height="347" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once logged with the correct role, you can access to the Create page and create new set of bottles.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8233.image_5F00_40.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5040.image_5F00_thumb_5F00_19.png" width="582" height="394" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Step 6: Removing 1 bottle from the inventory&lt;/h2&gt;  &lt;p&gt;I’ve create a specific function in the controller to decrease the number of bottles on a specific set of bottle.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// GET: ListeVins/Decrease/5&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;[&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Authorize&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(Roles = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;CanEdit&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;ActionResult&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; Decrease(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;? id)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; (id == &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;HttpStatusCodeResult&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;HttpStatusCode&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.BadRequest);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;ListeVin&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; listeVin = db.ListeVin.Find(id);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; (listeVin == &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; HttpNotFound();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;listeVin.Quantite -= 1;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;db.SaveChanges();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; RedirectToAction(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;Index&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; line-height: 10pt; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The code is very similar to the delete one but I just decrease the quantity, save the changes and redirect on the full wine list. I don’t test anything, quantity can be negative. Again, this is very simple but largely enough for my needs. I should add a nice message sayaing everything has been updates, etc, etc. But hey, I’ll teach everyone at home. To call this function, I just have to go to“&lt;a title="http://localhost:51235/listevins/decrease/1" href="http://yoursite/listevins/decrease/1"&gt;http://yoursite/listevins/decrease/1&lt;/a&gt;” to decrease by 1 the number or bottle of the bottle set numer 1 (replace yoursite by the url of your site).&lt;/p&gt;  &lt;p&gt;This is not very user friendly as none at home will remember what to call in the url, the id of a specific set of bottles. And that’s where QR Codes arrived &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8080.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;h2&gt;Step 7: Adding QR codes with a redirect on the good URL&lt;/h2&gt;  &lt;p&gt;I want everyone at home to be able to scan a RQ code sticked on a bottle with their Windows Phone (yea, it’s also working with other smartphones as well but everyone has Windows Phone at home &lt;img class="wlEmoticon wlEmoticon-openmouthedsmile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Rire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6644.wlEmoticon_2D00_openmouthedsmile_5F00_2.png" /&gt;) and that’s it!&lt;/p&gt;  &lt;p&gt;But I’ll need to generate the QR Codes dynamically when I’ll create the set of bottles to be then able to print them and stick them on the bottles. Ho yes, this will take some time as I have quite a lot of bottles. But it’s the price to pay to make it simple on the other side. And once it’s done, it’s done! No need to change them even if I keep the bottles for 20 years or more &lt;img class="wlEmoticon wlEmoticon-winkingsmile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Clignement d&amp;#39;œil" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8206.wlEmoticon_2D00_winkingsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;I found a good QR Code project to generate QR Code on CodePlex: &lt;a title="http://qrcodenet.codeplex.com/" href="http://qrcodenet.codeplex.com/"&gt;http://qrcodenet.codeplex.com/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once downloaded and referenced in the project. The usage is quite easy:&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; GetQrCode(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;? id)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;img src=\&amp;quot;/ListeVins/QrCode?id=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; + id + &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;FileResult&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; QRCode(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;? id)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#2b91af"&gt;QrEncoder&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#000000"&gt; encoder = &lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#2b91af"&gt;QrEncoder&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#2b91af"&gt;ErrorCorrectionLevel&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.M);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font color="#2b91af"&gt;QrCode&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; qrCode;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span lang="FR" style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white; mso-ansi-language: fr"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;MemoryStream&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; ms = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;MemoryStream&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;encoder.TryEncode(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;https://yoursite/listevins/decrease/&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;+id, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;out&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; qrCode);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; render = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;GraphicsRenderer&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;FixedModuleSize&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(10, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;QuietZoneModules&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.Two));&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;render.WriteToStream(qrCode.Matrix, &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;ImageFormat&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;.Png, ms);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; File(ms.GetBuffer(), &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;@&amp;quot;image/png&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;); ;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 8pt; line-height: 12pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; line-height: 10pt; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The GetQrCode function is just returning a simple string containing the call on the second function which does return a file, in our case an image. The image is generate dynamically by encoding the the URL. The image is generated in memory in a stream, the stream is saved as an image in the memory. In order to generate the right URL, change “yoursite” to the right URL.&lt;/p&gt;  &lt;p&gt;Now, I have to modify the “Details.cshtml” by adding this QR Code in the list, at the end. GetQrCode will be called, this will create the image tag. The image tab contains a call on the QRCode image creation and the image will be displayed.&lt;/p&gt;  &lt;p&gt;&amp;lt;dd&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; @Html.Action(&amp;quot;GetQrCode&amp;quot;, &amp;quot;ListeVins&amp;quot;, new { id = Model.Id });     &lt;br /&gt;&amp;lt;/dd&amp;gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8540.image_5F00_44.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6445.image_5F00_thumb_5F00_21.png" width="471" height="234" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And as a result, the details page shows now the QR Code.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1273.image_5F00_42.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2210.image_5F00_thumb_5F00_20.png" width="355" height="423" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;All what I need to do is copy/paste it in Word in a template that I’m using to print stickers, print them and stick them on the bottle!&lt;/p&gt;  &lt;p&gt;As you can also see, I’ve customized the main menu of the website as well as the footer. You can do all this by modifying the cshtml files from the home folder as well as the Shared one.&lt;/p&gt;  &lt;h2&gt;Step 8: Scan and drink &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8080.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/h2&gt;  &lt;p&gt;The last step is the user step. When anyone from the familly at home goes to the basement and take a bottle, he/she just have to scan the bottle using a QR Code app if they’re not using a Windows Phone or directly the visual search (Visual Bing) using a Windows Phone. And if they’ve installed Cortana, they can use &lt;a href="http://www.windowsphone.com/store/app/qr-for-cortana/3517e8f0-33c6-4c4c-a293-14fd08722364" target="_blank"&gt;QR for Cortana&lt;/a&gt; for example and launch the filter which does the QR Code recognition. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1425.wp_5F00_ss_5F00_20141226_5F00_0002_5F00_2.jpg"&gt;&lt;img title="wp_ss_20141226_0002" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="wp_ss_20141226_0002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7206.wp_5F00_ss_5F00_20141226_5F00_0002_5F00_thumb.jpg" width="166" height="274" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The first time they scan a QR code, they just have to put their login and password in the website (like in Step 5), click “remind me” and they’re done for the other times. So very simple. And even if they forget to do it from the basement or they forgot their phone or whateverotherfakereasontheywillfind, I/they still can do it when they have the bottle upstairs.&lt;/p&gt;  &lt;p&gt;Now I can enjoy a great bottle of wine &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8080.wlEmoticon_2D00_smile_5F00_2.png" /&gt; Feedback welcomes on the article as well on wine of course &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8080.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10583105" width="1" height="1"&gt;</description></item><item><title>Connect Arduino, Spark.IO, Netduino (NETMF .Net Microframework), to Microsoft Azure Mobile Services, create IoT (Part 3)</title><link>http://blogs.msdn.com/b/laurelle/archive/2014/11/30/connect-arduino-spark-io-netduino-netmf-net-microframework-to-microsoft-azure-mobile-services-create-iot-part-3.aspx</link><pubDate>Sun, 30 Nov 2014 10:14:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10576919</guid><dc:creator>Laurelle</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10576919</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2014/11/30/connect-arduino-spark-io-netduino-netmf-net-microframework-to-microsoft-azure-mobile-services-create-iot-part-3.aspx#comments</comments><description>&lt;p&gt;In the 2 previous articles, we’ve created a local network of objects which communicate sensor information to a more smarter object which will post the information somewhere in the Cloud. Idea is to create a full Internet of Things (IoT) infrastructure. Those sensors are temperature, humidity (air and soil), wind direction as well as rain. Some have been just reused from Oregon Scientific and some have been developed from scratch using simple &lt;a href="http://www.arduino.cc" target="_blank"&gt;Arduino&lt;/a&gt; or equivalent like &lt;a href="http://spark.io" target="_blank"&gt;Spark.IO&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;It is now time to look at how to post the sensor information in the Cloud. There are multiple offers to post data in the Cloud. I prefer the Microsoft Azure offer for multiple reasons. First, it’s free for a low usage like my hobbyist usage. &lt;strong&gt;Yes, it’s just free. Yes, really free&lt;/strong&gt;. I will use for this the Azure Mobile Services as well as an Azure SQL database for the storage. The Azure SQL database is free up to 1Gb of data. And in one of the next article, we’ll see how to consume those data, &lt;strong&gt;also for free in an Azure Web site&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;There are also good technical reasons to use Azure: first it’s totally open, easy to access, based on the Internet protocols. All what you need is simply an IP stack and sockets. It can work on a low speed connection like GPRS or high speed like WiFi, using HTTPS or HTTP. So it’s very flexible and very easy to use. Let go deeper in the code. As a summary, Azure Mobile Services are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Fully REST API, can be access HTTP or HTTPS, in our case, as the processors are very low end, it will be HTTP only &lt;/li&gt;    &lt;li&gt;Dynamic table auto setup, no need to be SQL guru &lt;/li&gt;    &lt;li&gt;Access thru application key, this is a simple but easy and simple security mechanism &lt;/li&gt;    &lt;li&gt;Can customize insert, update and all other functions, I’ll use this to simplify a bit the data returned by Azure &lt;/li&gt;    &lt;li&gt;Can create custom API, I’ll use this feature for the last part to connect my Sprinkler to the Azure data &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;First step is to open an Azure subscription: &lt;a title="http://azure.microsoft.com/pricing/free-trial/" href="http://azure.microsoft.com/pricing/free-trial/"&gt;http://azure.microsoft.com/pricing/free-trial/&lt;/a&gt;. Your credit card will be required but won’t be used if you decide to stay with free offer. The credit card is used for verification mainly. You’ll get 30 days also with real $$ to use for free if you want to test other part of Azure which I of course encourage you to do.&lt;/p&gt;  &lt;p&gt;First step is to create a Mobile Service. For this, just follow the excellent step by step you’ll find here. &lt;a title="http://azure.microsoft.com/en-us/documentation/services/mobile-services/" href="http://azure.microsoft.com/en-us/documentation/services/mobile-services/"&gt;http://azure.microsoft.com/en-us/documentation/services/mobile-services/&lt;/a&gt;. It’s just 3 easy steps and you’re done for the server side.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6735.image_5F00_2.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7343.image_5F00_thumb.png" width="365" height="109" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now the service is creates, to access it, it’s super simple: connect to the port 80 (stand HTTP port) of the Azure Mobile Service you’ve just created. And send the following data:&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;POST /tables/&lt;/span&gt;weather&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;/ HTTP/1.1&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;X-ZUMO-APPLICATION: 123456789abcdef123456789abcdef12&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Host: nomduservice.azure-mobile.net&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Content-Length: 88&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Connection: close&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;{&amp;quot;sensorID&amp;quot;:22, &amp;quot;channel&amp;quot;:5, &amp;quot;instSpeed&amp;quot;:12,&amp;quot;averSpeed&amp;quot;:5,&amp;quot;direction&amp;quot;:2,&amp;quot;batterylife&amp;quot;:90}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The server will return the following text:&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;HTTP/1.1 201 Created&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Cache-Control: no-cache&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Content-Length: 133&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;Content-Type: application/&lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;json&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Location: https://nomduservice.azure-mobile.net/tables/weather//931CFDDE-AB7F-4480-BA28-F1D5C611398B&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Server: Microsoft-IIS/8.0&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;x-&lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;zumo&lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;-version: Zumo.master.0.1.6.3803.Runtime&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;X-Powered-By: ASP.NET&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;Set-Cookie: &lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;ARRAffinity&lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;=da4a9f7437a690e3c1a799d3a6c3ddf3ee0cbb9f5a67008d3c919f0149f34ee3;Path=/;Domain= nomduservice.azure-mobile.net&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Date: Sun, 31 Aug 2014 15:40:12 GMT&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;Connection: close&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; tab-stops: left 45.8pt left 91.6pt left 137.4pt left 183.2pt left 229.0pt left 274.8pt left 320.6pt left 366.4pt left 412.2pt left 458.0pt left 503.8pt left 549.6pt left 595.4pt left 641.2pt left 687.0pt left 732.8pt; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style="list-style-type: disc; font-family: ; color: ; line-height: normal; language: en-us; mso-ascii-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000" size="2"&gt;{&amp;quot;sensorID&amp;quot;:22,&amp;quot;channel&amp;quot;:5,&amp;quot;instSpeed&amp;quot;:12,&amp;quot;averSpeed&amp;quot;:5,&amp;quot;direction&amp;quot;:2,&amp;quot;batterylife&amp;quot;:90,&amp;quot;id&amp;quot;:&amp;quot;931CFDDE-AB7F-4480-BA28-F1D5C611398B&amp;quot;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;   &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;yes, it’s HTTP, so it’s just simple text. What we send is a POST request on a specific table, here /tables/weather/ and we send information in a JSON format. See JSON as a simplified XML still readable by a human &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8420.wlEmoticon_2D00_smile_5F00_2.png" /&gt; So basically a bit less text to send with still a structured way.&lt;/p&gt;  &lt;p&gt;What we get in return from the server is a standard header containing quite lots of information as well as the data and the unique ID returned. Wait, a unique ID? Yes, it’s part of what is generated automatically when you are using the Azure Mobile Services. All the database is created for you, all the mechanism to generate the data in the database is totally hidden for you. So clearly no need to be the king of SQL. It’s fully transparent. And yes, you can personalize, you can customize the received data, you can do check and all this. We'll have a look later on how to simply do it.&lt;/p&gt;  &lt;p&gt;OK, time to see code. Here is the full Arduino code necessary to post the example above:&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;TCPClient&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; client;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;AzureServer&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;[] = { 12, 34, 56, 78 };&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000" size="2"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;writeJsonWind&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: blue; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;struct&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;wind&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;wd&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;Create&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; a simple JSON;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; = &lt;/span&gt;&lt;/font&gt;&lt;font color="#a31515"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&amp;quot;{\&amp;quot;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;sensorID&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;\&amp;quot;:&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;wd&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.ID);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;,\&amp;quot;channel\&amp;quot;:&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;wd&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.channel&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;font color="#a31515"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&amp;quot;,\&amp;quot;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;instSpeed&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;\&amp;quot;:&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;wd&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.instantSpeed&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;font color="#a31515"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&amp;quot;,\&amp;quot;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;averSpeed&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;\&amp;quot;:&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;wd&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.averageSpeed&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;,\&amp;quot;direction\&amp;quot;:&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;wd&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.direction&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;font color="#a31515"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&amp;quot;,\&amp;quot;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;batterylife&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;\&amp;quot;:&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;wd&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.bat);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; += &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;}&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: blue; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; (&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;datastring&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000" size="2"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000" size="2"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: blue; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;sendData&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;thisData&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;create&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; a &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;connection&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; to port 80 on the server&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;IP &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;is&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;your&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; Mobile Services &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;address&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: blue; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; (&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.connect&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;AzureServer&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;, 80)) &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;//&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;Serial.println&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&amp;quot;Connected to Azure Server&amp;quot;);&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;create&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; the REST &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;request&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;using&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; POST&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;Nomdelatable&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;is&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;name&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; of the table&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.print&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;font color="#a31515"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&amp;quot;POST /tables/&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;weather&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;/&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.println&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot; HTTP/1.1&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;use the application key&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.println&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;X-ZUMO-APPLICATION: 123456789abcdef123456789abcdef12&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;host &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;name&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;is&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;name&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; of &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;your&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; Azure Mobile Service&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.println&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;Host: nomdumobileservice.azure-mobile.net&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.print&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;font color="#a31515"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&amp;quot;Content-&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;Length&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;: &amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.println&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;thisData&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;.length&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;());&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.println&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #a31515; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;Connection: close&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.println&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;();&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;and &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;finally&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; data!&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.println&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: gray; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#808080"&gt;thisData&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: blue; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000"&gt; {&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#008000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;in case of &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;error&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;, stop &lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#008000"&gt;connection&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;client.stop&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;();&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160; &lt;/span&gt;}&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#000000" size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font color="#008000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;// &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;Sending&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; data &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;is&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; simple, &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;create&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; a JSON, and &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;send&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;it&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: green; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; on port 80!&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 0pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #2b91af; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;dataString&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt; = &lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;writeJsonWind&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;myWind&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;);&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 8pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 13pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;sendData&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;(&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;dataString&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: black; mso-style-textfill-fill-alpha: 100.0%; mso-highlight: white"&gt;);&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;That’s it? Yes, that’s it. Nothing more is needed. As I wrote before, you need an IP stack and sockets. You have them with the TCPClient object. I’m using a Spark.IO which is based on the same kind of processor you find in normal Arduino but with a WiFi chip on top. See previous articles for more information.&lt;/p&gt;  &lt;p&gt;Rest of the code is quite straight forward, the writeJsonWind function create the Json string. sendData is first connecting to the Azure Mobile Services server on port 80. Then a socket connection is created, it write in the socket the header and then the Json data. And that’s all! The data will be stored automatically in the SQL Azure database and you’ll be able to access them.&lt;/p&gt;  &lt;p&gt;It’s possible to personalize and create your own Azure Mobile Services API. You can do it either in Javascript directly in the Azure management console or in .NET using the excellent and free Visual Studio, either the Express version and installing the Azure SDK, either the &lt;a href="http://www.visualstudio.com/products/visual-studio-community-vs" target="_blank"&gt;Visual Studio Community&lt;/a&gt; edition. As an example, I’ll use Javascript here. The idea is to reduce number of data sent back to the client. No need to send the generated data, it won’t be use. The header will be largely enough.&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 8pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 14.25pt; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging; mso-line-height-rule: exactly" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font size="2" face="Consolas"&gt;function insert(item, user, request) {&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 8pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0in; margin-top: 0pt; line-height: 14.25pt; text-indent: 0.5in; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging; mso-line-height-rule: exactly" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;request.execute&lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;({&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 8pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0.5in; margin-top: 0pt; line-height: 14.25pt; text-indent: 0.5in; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging; mso-line-height-rule: exactly" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font size="2" face="Consolas"&gt;success: function(results) {&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 8pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 1in; margin-top: 0pt; line-height: 14.25pt; text-indent: 0.5in; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging; mso-line-height-rule: exactly" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;request.respond&lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;statusCodes.OK&lt;/span&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;);&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;},&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 8pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 0.5in; margin-top: 0pt; line-height: 14.25pt; text-indent: 0.5in; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging; mso-line-height-rule: exactly" align="left"&gt;&lt;span style="font-family: ; color: ; language: en-us; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;&lt;font size="2" face="Consolas"&gt;error: function(results) {&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin-bottom: 8pt; unicode-bidi: embed; word-break: normal; direction: ltr; margin-left: 1in; margin-top: 0pt; line-height: 14.25pt; text-indent: 0.5in; language: en-us; mso-line-break-override: none; punctuation-wrap: hanging; mso-line-height-rule: exactly" align="left"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="font-family: ; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;request.respond&lt;/span&gt;&lt;span style="font-family: ; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;(&lt;/span&gt;&lt;span style="font-family: ; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;statusCodes.BAD_REQUEST&lt;/span&gt;&lt;span style="font-family: ; color: ; language: fr; mso-ascii-font-family: consolas; mso-fareast-font-family: calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 12.0pt; mso-style-textfill-type: solid; mso-style-textfill-fill-color: #333333; mso-style-textfill-fill-alpha: 100.0%"&gt;); }&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;}); }&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This is a simple modification which return OK if the data has been successfully entered into the database or bad request if not. You can of course do more. I encourage you to follow the project my friend Mario Vernari is doing &lt;a href="https://highfieldtales.wordpress.com/2014/11/07/azure-veneziano-part-1/" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="https://highfieldtales.wordpress.com/2014/11/16/azure-veneziano-part-2/" target="_blank"&gt;here&lt;/a&gt;. Lots of great and cool stuff too with example of personalized API.&lt;/p&gt;  &lt;p&gt;As always, you can raise the question: what about security?&lt;/p&gt;  &lt;p&gt;It’s a critical part of Mobile Services. The default access is HTTPS which offers a reasonable level of security with the application key. Here, we are using very cheap processors which are not powerful enough to run HTTPS, so we are using basic HPPT. Of course, for a professional project or a project which require more sensible data, we’ll clearly have to use more robust processors. On top, you can use Azure Directory federation and make user/device authentication. When you’ll have to manage thousands of devices, when you’ll have them randomly in the wild and not physically secured, you’ll be happy to use those kind of mechanism to exclude specific devices. You have on top an easy federation with Microsoft ID, Google, Facebook and Twitter. And of course the Azure SQL database is secured with login/pwd, you can control which server/PC/device can have access by IP as well as user/pwd.&lt;/p&gt;  &lt;p&gt;What are the other way to post data in Azure?&amp;#160; &lt;/p&gt;  &lt;p&gt;There are other ways of course. You can access directly the SQL database but it’s not the easiest method to manage authentication, validate data. You better want to use the &lt;a href="http://azure.microsoft.com/services/event-hubs/" target="_blank"&gt;Azure Event Hubs&lt;/a&gt; to connect millions of devices across platforms and which allow the support for AMQP and HTTP. It does have native client libraries also exist for popular platforms&lt;/p&gt;  &lt;p&gt;You can also use framework like &lt;a href="http://www.microsoft.com/windowsembedded/en-us/intelligent-systems-service.aspx" target="_blank"&gt;Intelligent Systems Service&lt;/a&gt;, more oriented to consume the data. It’s based on Azure, provide additional tools for analyze and data consumption. &lt;/p&gt;  &lt;p&gt;So all up, we’ve seen how to post data from a 1$ chip with access to an IP stack and Socket to Azure and store them in a SQL Azure database. It is simple, straight forward and flexible solution. It’s free for low usage so it makes it the best solution for simple projects and hobbyists.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10576919" width="1" height="1"&gt;</description></item><item><title>Connect your Arduino, Spark.IO, Netduino (NETMF .Net Microframework), Galileo to Microsoft Azure (Part 2) to create an Internet of Things (IoT)</title><link>http://blogs.msdn.com/b/laurelle/archive/2014/11/14/connect-your-arduino-spark-io-netduino-netmf-net-microframework-galileo-to-microsoft-azure-part-2-to-create-an-internet-of-things-iot.aspx</link><pubDate>Fri, 14 Nov 2014 18:01:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10573028</guid><dc:creator>Laurelle</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10573028</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2014/11/14/connect-your-arduino-spark-io-netduino-netmf-net-microframework-galileo-to-microsoft-azure-part-2-to-create-an-internet-of-things-iot.aspx#comments</comments><description>&lt;p&gt;In the &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2014/11/08/connect-your-arduino-spark-io-netduino-net-microframework-galileo-to-microsoft-azure-part-1.aspx" target="_blank"&gt;previous article&lt;/a&gt;, I’ve explained that I’ll build an Internet of Things (IoT) infrastructure to pilot automatically with sensors and a Microsoft Azure backend my Sprinkler system at home. I’ve also explained a bit the &lt;a href="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2146.image_5F00_8.png" target="_blank"&gt;full architecture&lt;/a&gt;. In this post, I will explain how I have connected existing objects and make them communicating with the rest of the world as well as how I’ve created my own objects.&lt;/p&gt;  &lt;p&gt;I have decided to connect the existing Oregon Scientific sensors to the Cloud and Microsoft Azure &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1881.wlEmoticon_2D00_smile_5F00_2.png" /&gt; In order to do that, without doing any modification on the existing sensors, I had to analyze how they’re build and how to be able to interface with them.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6607.image_5F00_6.png"&gt;&lt;img title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1803.image_5F00_thumb_5F00_2.png" width="278" height="278" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Those sensors are using a 433MHz band to communicate wireless to a base which can gather the information. Some are even connectable with a serial port. In my case, I didn’t had such a base. So I needed to basically decode the protocol and decrypt it. After a quick search on the internet, I found and excellent article from Olivier Lebrun in French (yes I’m French &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1881.wlEmoticon_2D00_smile_5F00_2.png" /&gt;) here: &lt;a href="http://connectingstuff.net/blog/decodage-protocole-oregon-arduino-1/"&gt;http://connectingstuff.net/blog/decodage-protocole-oregon-arduino-1/&lt;/a&gt;. Olivier is using another article which is this time in English and which you can find here: &lt;a title="http://jeelabs.net/projects/cafe/wiki/Decoding_the_Oregon_Scientific_V2_protocol" href="http://jeelabs.net/projects/cafe/wiki/Decoding_the_Oregon_Scientific_V2_protocol"&gt;http://jeelabs.net/projects/cafe/wiki/Decoding_the_Oregon_Scientific_V2_protocol&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The good news for me is that it’s easy and cheap to find a 433MHz demodulator and that the protocol used is simple and non crypted. In order to decode the protocol, I’ve decided to use an &lt;a href="http://www.arduino.cc" target="_blank"&gt;Arduino&lt;/a&gt; based processor. the reason is the very low cost and the fact that the existing code to decode is existing for Arduino. When searching a bit more, I found an Arduino compatible based processor which has an embedded wifi chip: &lt;a href="http://spark.io" target="_blank"&gt;Spark.IO&lt;/a&gt;. Good news is that it is still cheap and can be connected to the Internet. So with the Spark.IO, I can decode the protocol as well as posting information in Azure cloud. &lt;/p&gt;  &lt;p&gt;The wireless protocol use &lt;a href="http://en.wikipedia.org/wiki/Manchester_encoding" target="_blank"&gt;Manchester encoding&lt;/a&gt;. It’s a very common protocol used when doing wireless communications.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3312.image_5F00_2.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0601.image_5F00_thumb.png" width="244" height="118" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Source Wikipedia &lt;a href="http://en.wikipedia.org/wiki/Manchester_encoding"&gt;http://en.wikipedia.org/wiki/Manchester_encoding&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When a message is sent, it is transformed using the Manchester encoding and modulated at 433MHz. The graphic explains vey well how the information is sent. So in order to decode the signal, you can do it with the states changes and the timing between 2 changes. All this is very well explained in the 2 articles I4ve pointed. &lt;/p&gt;  &lt;p&gt;And as I can decode the protocol, I can also do the opposite and use a transmitter to send a signal. By doing this, I can have my own sensors. I’ll post an example of code later.&lt;/p&gt;  &lt;p&gt;The architecture I will use for my sensors and to connect them to Internet is a quite common one. It is used for years in alarms for example. Most sensors are only one direction, they use a close wireless protocol and send them information to a smart base. All what the open door detection sensor has to do is send time to time that he is alive and in case the door open send the signal it is open. It does not need to know if his signal has arrived or not and who did listen to him. And most sensors in the world are like that. But the smart base has to know all the sensors and has to monitor them. It has to make sure that they are all alive, or it will raise an alert. It aslo has to make sure that when the open door signal is raised it will also raise an alert. Today the only thing which is really connected to the internet and a another central point in an alarm system is the smart base. &lt;/p&gt;  &lt;p&gt;So I’ll use the same architecture for my project. Only the Spark.IO is connected to Internet thru its wifi. The other sensors are using the 433MHz wireless protocol to send their information. And they have no idea is it will arrive or not.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4784.image_5F00_4.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1680.image_5F00_thumb_5F00_1.png" width="515" height="355" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So the role of the Spark.IO is crucial. It will have the task to decode the messages send over the air as well as posting the information in Azure. &lt;/p&gt;  &lt;p&gt;The sensors I’ve developed are using ATmega 328 which is the processor used in the basic Arduino. it is very cheap, 1€, consume very low energy as well as possibility to sleep it to even more reduce the energy used. I wanted my sensors to be outside and fully autonomous. So I had to take case of this. &lt;/p&gt;  &lt;p&gt;Another great news is the possibility to use Visual Studio with the &lt;a href="http://www.visualmicro.com/" target="_blank"&gt;Visual Micro&lt;/a&gt; complement to develop for Arduino. &lt;a href="http://www.visualstudio.com/products/visual-studio-community-vs" target="_blank"&gt;Visual Studio Community&lt;/a&gt; Edition is free and have much more feature than the Arduino tools. Writing code is then super easy, it does support all the Ardunio flavor as well as a great debugger. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8233.image_5F00_8.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4048.image_5F00_thumb_5F00_3.png" width="244" height="166" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6131.image_5F00_10.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1616.image_5F00_thumb_5F00_4.png" width="198" height="162" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here is the example of the wind speed, wind direction and pluviometer. It is quite simple electronic. I bought the anemometer, wind vane and rain gauge sensors &lt;a href="https://www.sparkfun.com/products/8942" target="_blank"&gt;here&lt;/a&gt;. This was what cost me the most in the all project (70$)!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3806.image_5F00_6.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0118.image_5F00_thumb_5F00_2.png" width="513" height="318" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;this is how it does look like as a prototype:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8156.clip_5F00_image002_5F00_2.jpg"&gt;&lt;img title="clip_image002" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1565.clip_5F00_image002_5F00_thumb.jpg" width="504" height="286" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;and integrated as a beta version fully autonomous in the garden&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7888.WP_5F00_20141111_5F00_002_5F00_2.jpg"&gt;&lt;img title="WP_20141111_002" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="WP_20141111_002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6758.WP_5F00_20141111_5F00_002_5F00_thumb.jpg" width="250" height="442" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;inside the transparent box, there is &lt;a href="http://www.dx.com/p/ultrafire-brc-18650-3000mah-3-7v-li-ion-rechargeable-batteries-red-2-pcs-160132" target="_blank"&gt;Li-ion battery&lt;/a&gt; (3$), a &lt;a href="http://www.dx.com/p/tp4056-1a-li-ion-battery-charging-module-blue-4v-8v-215797" target="_blank"&gt;Li-ion charger&lt;/a&gt; (2$) and a &lt;a href="http://www.dx.com/p/miniisw-sw-015-1-5w-polysilicon-solar-panel-black-223292" target="_blank"&gt;solar panel&lt;/a&gt; (6$) on top of what you have in the prototype picture.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1832.WP_5F00_20141111_5F00_004_5F00_2.jpg"&gt;&lt;img title="WP_20141111_004" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="WP_20141111_004" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2845.WP_5F00_20141111_5F00_004_5F00_thumb.jpg" width="507" height="287" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The power consumption is quite low, it can run in the dark on the battery for multiple days and few hours of a direct and intense sun is enough to fully recharge the battery.&lt;/p&gt;  &lt;p&gt;Here is a part of the code needed for the anemometer. It is quite straight forward:&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;#define&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;PIN_ANEMOMETER&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Digital 2&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;#define&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;PIN_ALIMRF&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//Digital 5&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// How often we want to calculate wind speed or direction&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;#define&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;MSECS_CALC_WIND_SPEED&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; 10&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;volatile&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; numRevsAnemometer = 0; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Incremented in the interrupt&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;&lt;font style="font-size: 9.5pt"&gt;ulong&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; nextCalcSpeed;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// When we next calc the wind speed&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;&lt;font style="font-size: 9.5pt"&gt;ulong&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; time;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Millis() at each start of loop().&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Buffer for Oregon message max size&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;&lt;font style="font-size: 9.5pt"&gt;byte&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; OregonMessageBuffer[12];&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;&lt;font style="font-size: 9.5pt"&gt;byte&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; numByteToSend = 12;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;&lt;font style="font-size: 9.5pt"&gt;Wind&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; *myWind = &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;Wind&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;unsigned&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;long&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt; lastSensorCheck = now();&lt;/font&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;const&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;unsigned&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; interval = 5; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// every 3 minutes = 3*60 sec&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; setup()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;pinMode(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;PIN_ALIMRF&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;OUTPUT&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;pinMode(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;PIN_ANEMOMETER&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;INPUT&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// set internal pull up&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;digitalWrite(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;PIN_ANEMOMETER&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;HIGH&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//set interuption&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;attachInterrupt(0, countAnemometer, &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;FALLING&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;nextCalcSpeed = now() + &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;MSECS_CALC_WIND_SPEED&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//other initis&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; setWinMessage(){&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Create the Oregon message for an Anemometer (WTGR800)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; ID[] = { 0x1A, 0x99 };&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;setType(OregonMessageBuffer, ID);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;setChannel(OregonMessageBuffer, 0x20);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;setId(OregonMessageBuffer, 0x12);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;setBatteryLevel(OregonMessageBuffer, 1); &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// 0 : low, 1 : high&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;setWind(OregonMessageBuffer, myWind-&amp;gt;getInstantSpeed(), myWind-&amp;gt;getAverageSpeed(), myWind-&amp;gt;getDirection());&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; numByteToSend = 10;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;csWind(OregonMessageBuffer);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Serial.print(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot;inst speed: &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Serial.print(myWind-&amp;gt;getInstantSpeed());&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Serial.print(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot; aver speed: &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Serial.print(myWind-&amp;gt;getAverageSpeed());&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Serial.print(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#a31515"&gt;&amp;quot; dir :&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Serial.println(strVals[myWind-&amp;gt;getDirection()]);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; sendMessage()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Show the Oregon Message&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;digitalWrite(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;PIN_ALIMRF&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;HIGH&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// wait 1 second that RF switch on&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;delay(1000);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; i = 0; i &amp;lt; numByteToSend; ++i)&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Serial.print(OregonMessageBuffer[i] &amp;gt;&amp;gt; 4, &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;HEX&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;Serial.print(OregonMessageBuffer[i] &amp;amp; 0x0F, &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;HEX&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Send the Message over RF&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;sendOregon(OregonMessageBuffer, numByteToSend);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Send a &amp;quot;pause&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_LOW&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;delayMicroseconds(TWOTIME * 8);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Send a copie of the first message. The v2.1 protocol send the&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// message two time &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;sendOregon(OregonMessageBuffer, numByteToSend);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// Wait for 30 seconds before send a new message &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_LOW&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;digitalWrite(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;PIN_ALIMRF&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;LOW&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; loop()&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;time = now();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; (time &amp;gt;= nextCalcSpeed) {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;calcWindSpeed();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;setWinMessage();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;sendMessage();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;nextCalcSpeed = time + &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;MSECS_CALC_WIND_SPEED&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;// other treatment and other time related check&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; countAnemometer() {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;numRevsAnemometer++;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And there are also functions used to send the message. Here, idea is to build few macros and then use them to send the low or high message:&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;#define&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;TX_PIN&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt;//Digital 4&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;const&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;unsigned&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;long&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; TIME = 512;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;const&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;unsigned&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;long&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt; TWOTIME = TIME * 2;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;#define&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_HIGH&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;() digitalWrite(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;TX_PIN&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;HIGH&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;#define&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_LOW&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;() digitalWrite(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;TX_PIN&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;LOW&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;inline&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; sendZero(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_HIGH&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;delayMicroseconds(TIME);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_LOW&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;delayMicroseconds(TWOTIME);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_HIGH&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;delayMicroseconds(TIME);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;inline&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; sendOne(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_LOW&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;delayMicroseconds(TIME);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_HIGH&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;delayMicroseconds(TWOTIME);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;SEND_LOW&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;delayMicroseconds(TIME);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;inline&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; sendQuarterMSB(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;bitRead&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;, 4)) ? sendOne() : sendZero();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;bitRead&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;, 5)) ? sendOne() : sendZero();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;bitRead&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;, 6)) ? sendOne() : sendZero();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;bitRead&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;, 7)) ? sendOne() : sendZero();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.5pt"&gt;inline&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; sendQuarterLSB(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#2b91af"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;bitRead&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;, 0)) ? sendOne() : sendZero();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;bitRead&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;, 1)) ? sendOne() : sendZero();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;bitRead&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;, 2)) ? sendOne() : sendZero();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#6f008a"&gt;bitRead&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#808080"&gt;data&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;, 3)) ? sendOne() : sendZero();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000" face="Consolas"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;It is quite straight forward to then send an information thru the 433MHz emitter. It’s just then about sending the bits one by one. &lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;I’m using a Spark.IO for the decoding part. &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;The Spark.IO can be programmed over the air (OTA) and you need to use the development tools in a browser provided by the Spark.IO. The tools are ok to use, clearly much more limited than Visual Studio. It is still possible to use Visual Studio as for the Arduino but then you’ll need to be plugged in to program the chip. What I4m doing is I’m using Visual Studio for the code, the syntax and then copy/paste my code into the online editor to program the chip.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;It comes also with what they call a cloud. In reality, it’s just a server which provide access to information you can publish. But it is very limited and can’t be control in a smart way. So I will use Microsoft Azure instead. And I will explain it in the next part.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;Now on the Spark.IO, the way the decoding is working is this way:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;First disconnect Spark.IO from it’s own server. If you don’t do it, you will never be able to decode correctly anything, the servers are taking lots of resources and interrupt the processes not in a needed time. So use Spark.disconnect(); in the main void setup() function. I am allowing e to reconnect it to make my life easier when I want to reprogram it over the air by using one of the entry. When I change the state of the entry, the server is reconnected so I can reprogram it over the air&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;A length is calculated between 2 state changes on the 433MHz receptor&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;if this length is between 200 and 700 milliseconds, then it’s a short, if it’s between 700 and 1200 it’s a long. Others are not valid and reinit the decoder&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;As soon as the impulsions are still valid:&lt;/div&gt;      &lt;ul&gt;       &lt;li&gt;         &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;The Manchester decoding is done for every new impulsion&lt;/div&gt;       &lt;/li&gt;        &lt;li&gt;         &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;The message is decoded on the flight &lt;/div&gt;       &lt;/li&gt;        &lt;li&gt;         &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;When the synchro is found (32 impulsions of 1 so 0xFF 0xFF received after the first 32 impulsions has been decoded), the sensor type is checked and what kind of data are expected.&lt;/div&gt;       &lt;/li&gt;        &lt;li&gt;         &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;if at some point data are not valid the decoder is reinitialyzed&lt;/div&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;When all the message is decoded, it is stored and it’s ready for the next one to be decoded&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;This decoding part is well documented in the 2 articles I was referring before.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;This is how look like the Spark.IO with the receptor. The 433MHz demodulator is under the paper. In fact it’s a layer of paper plus few layers of aluminum and a layer of paper so like an aluminum sandwich. And the aluminum is then put to the ground. This simple method allow to isolate a bit the very cheap receptor I bought and increase drastically the decoding performances &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1881.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3414.image_5F00_12.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3480.image_5F00_thumb_5F00_5.png" width="504" height="285" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;There is a key question that can be raised here: the security one. In fact the data that are send by the sensors are not crypted and they are not secured. The initial temperature and humidity sensors are not protected. This is for a cost/sensibility reason. Those are not considered as sensitive. Of course, if you have to deal with sensitive data and send them with those kind of short range wireless protocols, do crypt them. This will increase of course the cost of your solution. But it’s the price to pay for security. And some of my neighbor is using also Oregon Scientific sensors and I can decode them and have access to them.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none"&gt;So that’s it for this article. It did cover the sensor part, how to make existing sensor connected, how to create your own sensor, what kind of architecture to use and how to build a simple solution to decode everything. We will see next time how to post the data on Azure.&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"&gt;&lt;span style="font-family: ; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10573028" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/laurelle/archive/tags/Arduino/">Arduino</category><category domain="http://blogs.msdn.com/b/laurelle/archive/tags/IoT/">IoT</category><category domain="http://blogs.msdn.com/b/laurelle/archive/tags/Spark-IO/">Spark.IO</category></item><item><title>Connect your Arduino, Spark.IO, Netduino (.Net Microframework), Galileo to Microsoft Azure (Part 1)</title><link>http://blogs.msdn.com/b/laurelle/archive/2014/11/08/connect-your-arduino-spark-io-netduino-net-microframework-galileo-to-microsoft-azure-part-1.aspx</link><pubDate>Sat, 08 Nov 2014 11:01:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10570766</guid><dc:creator>Laurelle</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10570766</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2014/11/08/connect-your-arduino-spark-io-netduino-net-microframework-galileo-to-microsoft-azure-part-1.aspx#comments</comments><description>&lt;p&gt;Internet of Things (IoT) is exploding. Cost of processors and cost of electronic components is falling, electrical consumption is also getting lower and lower for more and more power. It’s now more than ever becoming to be super easy to create our own objects with some intelligence. Add to this technologies like Bluetooth Low Energy (BLE), some Wifi or GPRS low cost and low consumption, you can also add some connectivity, between each others and/or with Internet.&lt;/p&gt;  &lt;p&gt;What is the Internet of Things? &lt;font color="#000000"&gt;&lt;strong&gt;&lt;em&gt;“The network of physical objects that contain embedded technology to communicate and interact with their internal states or the external environment.”&lt;/em&gt; &lt;/strong&gt;&lt;/font&gt;Gartner&lt;/p&gt;  &lt;p&gt;Being connected is nice but does not bring any value if the generate data are not used or if the object don’t take any action. For few years, the Cloud infrastructure like Microsoft Azure makes it easy to store and analyze those produced data or make it easy to consume data exposed by those infrastructures. So our objects can publish data in the Cloud as well as consume data that the Cloud host.&lt;/p&gt;  &lt;p&gt;IoT is more complex than most people thing about. And there as lots of questions that must be answered: create a brand new object or just add connectivity to an existing one? How to manage the object remotely? How to deploy new firmware to those new objects? How to secure access to those objects both physically as well as thru their communications and software? How to manage the generated data? How to analyze them? What to analyze? How to send back the data generated to some smartest objects? How to make an object adapt to data generated by others? What kind of hardware? What tools to use to develop on those new platforms?&lt;/p&gt;  &lt;p&gt;And those are just few examples of questions, there are many more that come in an IoT project. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4186.image_5F00_2.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4263.image_5F00_thumb.png" width="697" height="195" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To help answering those questions, we will separate the problem in multiple layers. Even if IoT is a fashion word those days, the full process behind and the way projects are managed is quite old and working for years. We will use the framework above in order to segment the problem. The first part will be related to the devices and objects we have. How to architecture them, why, how to connected them to the next layer which is the storage and cloud. We will then move to the data analytics, try to understand the data and get insights. With this, we will then go back the chain up to the objects themselves.&lt;/p&gt;  &lt;p&gt;In order to make it concrete, I will use a real example: my home and my sprinkler system. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What I need:&lt;/strong&gt; automate my sprinkler system based on elements like the temperature, the air and soil humidity, the sun light, the wind, the pluviometer.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What I already have&lt;/strong&gt;: I have my sprinkler system using .NET Microframework (NETMF), you’ll find previous article on how it is build in my blog &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/07/managing-my-sprinklers-from-the-cloud.aspx" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/12/07/creating-dynamically-a-web-page-using-net-micro-framework.aspx" target="_blank"&gt;here&lt;/a&gt; for example, you’ll find more in the full blog. This is already a big part of the system as it allows me to control manually and in a programmatically way my sprinkler. but it’s not fully automated based on external conditions. This sprinkler is based on Netduino Plus board using an ATMEL AT91SAM7X512 processor. NETMF is fully open source and as the name said, it’s mini .NET running directly on the metal without any OS. It can be develop with C# using Visual Studio.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4812.image_5F00_4.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4743.image_5F00_thumb_5F00_1.png" width="343" height="258" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I do also have existing Oregon Scientific sensors. My idea is to reuse them for the temperature and air humidity. I will make them communicating with the Internet. We will see how to do it in a next article.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6607.image_5F00_6.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1803.image_5F00_thumb_5F00_2.png" width="278" height="278" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What I’ve decided to do&lt;/strong&gt;: I’ve decided to reuse the Oregon Scientific sensors, make them connected to the Internet. For this, I’ve decided to use &lt;a href="http://www.arduino.cc" target="_blank"&gt;Arduino&lt;/a&gt; and &lt;a href="http://spark.io" target="_blank"&gt;Spark.IO&lt;/a&gt;. Both are based on the cheap ATMEL ATmega328 processor. Both implement the open source &lt;a href="http://www.wiring.org.co/" target="_blank"&gt;Wiring.org&lt;/a&gt; framework. This framework is easy to use based on C/C++ and it does make easy to build simple devices. You’ll find tons of do it yourself (DIY) projects based on Arduino. I also wanted to show that it is super easy to connect those objects to Microsoft Azure Cloud infrastructure. Keep in mind that a simple ATMEL ATmega328 cost 1€. So it’s a very cheap solution. The good news with the &lt;a href="http://wiring.org" target="_blank"&gt;Wiring.org&lt;/a&gt; framework is that it can also run on top of an OS like Linux or Windows. As an example, it’s the case for the Arduino YÚN or Galileo. Galileo boards can run Linux or Windows and have the Wiring.org layer on top. See &lt;a href="http://dev.windows.com/en-us/featured/Windows-Developer-Program-for-IoT"&gt;http://dev.windows.com/en-us/featured/Windows-Developer-Program-for-IoT&lt;/a&gt; for more info as well as the sources &lt;a href="https://github.com/ms-iot"&gt;https://github.com/ms-iot&lt;/a&gt; for the Windows version. The Windows version is free to run on those boards.&lt;/p&gt;  &lt;p&gt;Having an OS below those frameworks allow to have more security, capacity to encrypt data, do authentication and more. But at the same time, you are increasing the cost of your solution. We will discuss a bit the security further as it’s an important point. But it’s like in any project: it has a cost. So up to you to place the cursor where you think it must be. The more security you’ll need, the more costly it will be. &lt;/p&gt;  &lt;p&gt;So my final architecture will look like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2146.image_5F00_8.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8345.image_5F00_thumb_5F00_3.png" width="682" height="368" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I will have sensors, my Oregon Scientific existing sensors, new ones I will create using the same wireless 433MHHz protocol as the existing Oregon Scientific sensors. A Spark.IO will be decrypting the data and posting them on Microsoft Azure using the Azure Mobile Services. The data will be stored in a SQL Azure database. I’ve build a full Azure Website using ASP.NET + MVC + Entity Framework + jquery. And my Sprinkler will connect also to the Azure Mobile Services to consume the data produced and take decision to sprinkler or not.&lt;/p&gt;  &lt;p&gt;I will go step by step to describe the full architecture in the next parts. This was just the intro to explain the full architecture. Stay tune!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10570766" width="1" height="1"&gt;</description></item><item><title>.NET Microframework on RaspberryPi (Part 2)</title><link>http://blogs.msdn.com/b/laurelle/archive/2014/10/25/net-microframework-on-raspberrypi-part-2.aspx</link><pubDate>Sat, 25 Oct 2014 13:48:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10567376</guid><dc:creator>Laurelle</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10567376</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2014/10/25/net-microframework-on-raspberrypi-part-2.aspx#comments</comments><description>&lt;p&gt;I realize I haven’t posted on my blog the direct link to the porting of .NET Microframework (NETMF) to the RaspberryPi. See &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2013/06/21/net-microframework-on-raspberrypi-part-1.aspx"&gt;previous article&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;So code is available here: &lt;a title="https://raspberrypinetmf.codeplex.com/" href="https://raspberrypinetmf.codeplex.com/"&gt;https://raspberrypinetmf.codeplex.com/&lt;/a&gt;. This is not a full port of NETMF natively on RaspberryPi. It’s a port of specific NETMF classes on Mono running on Linux. It can be useful to quickly port existing NETMF projects with very little or no modifications. Note also that some classes are missing. So don’t hesitate to participate.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10567376" width="1" height="1"&gt;</description></item><item><title>Building an Internet of Things garden with Arduino/Netduino/Azure</title><link>http://blogs.msdn.com/b/laurelle/archive/2014/10/05/building-an-internet-of-things-garden-with-arduino-netduino-azure.aspx</link><pubDate>Sun, 05 Oct 2014 09:01:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10562540</guid><dc:creator>Laurelle</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10562540</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2014/10/05/building-an-internet-of-things-garden-with-arduino-netduino-azure.aspx#comments</comments><description>&lt;p&gt;For those who follow this blog, it’s been a while I haven’t posted anything. Reason of time missing and also because I worked on a new project so documentation of the project was not the priority.&lt;/p&gt;  &lt;p&gt;But now it’s time to start the documentation and sharing. I gave recently a conference in Kiev to explain how the project is working and all the technologies involved.&lt;/p&gt;  &lt;p&gt;Presentation for the day as well as full presentation with more details can be found on my OneDrive &lt;a href="https://onedrive.live.com/?cid=ED3080C73007CBED&amp;amp;id=ED3080C73007CBED%21138714"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;So you’ll find in the coming months quite detailed article to explain how to publish information from an Arduino or any thing with an IP stack/Socket. Stay tune &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2112.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10562540" width="1" height="1"&gt;</description></item><item><title>.NET Microframework on RaspberryPi (Part 1)</title><link>http://blogs.msdn.com/b/laurelle/archive/2013/06/21/net-microframework-on-raspberrypi-part-1.aspx</link><pubDate>Fri, 21 Jun 2013 13:20:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10427690</guid><dc:creator>Laurelle</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10427690</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2013/06/21/net-microframework-on-raspberrypi-part-1.aspx#comments</comments><description>&lt;p&gt;I’m a bit fan of .NET Microframework (NETMF). NETMF is an open source technology originally developed by Microsoft based on .NET. It directly run on metal, without any OS. All sources and portability kit are freely available On Codeplex: &lt;a title="http://netmf.codeplex.com/" href="http://netmf.codeplex.com/"&gt;http://netmf.codeplex.com/&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;And as a fan of Embedded devices I had to buy this inexpensive RaspberryPi &lt;a title="http://www.raspberrypi.org/" href="http://www.raspberrypi.org/"&gt;http://www.raspberrypi.org/&lt;/a&gt;. I bought the version second revision with the network adaptor. Advantage is clearly the price and having access to couple of GPIO like SPI,k i2c, PWM, serial and couple of other digital IO. Now it’s a slow device when using the user interface, there is no analog input or output, PWM is limited to only 1 hardware PWM and not really flexible for setting the frequencies. But overall, for the price, it’s Worth playing a bit with it.&lt;/p&gt;  &lt;p&gt;In term of environment, it runs under Linux, it was a very long time I did not had to setup and make a Linux working. I was just reminding couple of commands. And I’m far to be a Linux developer… so I’ve started to look at what to put that looks like C# or .NET on this board and more specifically .NET Microframework. &lt;/p&gt;  &lt;p&gt;I was disappointed to see that NETMF is not on the platform. But happy to see a good implementation of Mono &lt;a title="http://www.mono-project.com/Main_Page" href="http://www.mono-project.com/Main_Page"&gt;http://www.mono-project.com/Main_Page&lt;/a&gt;. So at least I was able to run some .NET code on the Raspberry and take the advantage of the display if needed with Windows forms. &lt;/p&gt;  &lt;p&gt;So what for access like we do in NETMF to the GPIO? I started to search on the web for what is possible to do. And I found a first project RaspberryPi.Net: &lt;a title="https://github.com/cypherkey/RaspberryPi.Net/" href="https://github.com/cypherkey/RaspberryPi.Net/"&gt;https://github.com/cypherkey/RaspberryPi.Net/&lt;/a&gt;. This project is using one library to access the BCM2835 chipset where the GPIO are managed. I found the last version of the library here: &lt;a title="http://www.airspayce.com/mikem/bcm2835/" href="http://www.airspayce.com/mikem/bcm2835/"&gt;http://www.airspayce.com/mikem/bcm2835/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And I just followed the steps explained on the RaspberryPi.Net project page. Here are the steps. Open an LXTerminal and type:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;sudo apt-get update&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;sudo apt-get install xrdp&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;this second one will allow you to access your Raspberry thru RDP &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4426.wlEmoticon_2D00_smile_5F00_52B846C1.png" /&gt; So you can do remote desktop on your Raspberry as you do with any other Windows machine.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;sudo apt-get install mono-runtime&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;this will install Mono and all what is needed to run a .NET program.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;sudo apt-get install git&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Very useful if you need to download Git projects. I’ll explain how to use it in the next part of this article as I’ve used it.&lt;/p&gt;  &lt;p&gt;Now we go thru the download of the BCM2835 library, the compilation, the installation:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.25.tar.gz&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;tar -zxvf bcm2835-1.25.tar.gz&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;cd bcm2835-1.25&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;./configure&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;make&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;sudo make install&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;cd src&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;cc -shared bcm2835.o -o libbcm2835.so&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;cd&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;rm bcm2835-1.25.tar.gz&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Now, you have to copy the libbcm2835.so library with the executable you’ll produce at the end. And for the moment you’re done with the RaspberryPi.&lt;/p&gt;  &lt;p&gt;Go on Windows, download the code from &lt;a href="https://github.com/cypherkey/RaspberryPi.Net/"&gt;https://github.com/cypherkey/RaspberryPi.Net/&lt;/a&gt;, open the project in Visual Studio, if like me you’re using the 2012 version, you may have to change the target to .Net Framework 4.0, change the pin you want to use to put a led, compile the project, put the exe and the so on a USB stick for example, or use any other way to copy it on your Rapsberry.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7455.image_5F00_1BDDF27B.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7317.image_5F00_thumb_5F00_0F726003.png" width="362" height="238" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I’ve used GPIO 7 (pin 11 on the board), ground on pin 9, I put a Led and a 60 ohms resistor. &lt;/p&gt;  &lt;p&gt;Use this site as a reference to know which pin does what: &lt;a title="http://elinux.org/Rpi_Low-level_peripherals" href="http://elinux.org/Rpi_Low-level_peripherals"&gt;http://elinux.org/Rpi_Low-level_peripherals&lt;/a&gt;. Very well done, with all the details.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0160.image_5F00_013677C4.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8358.image_5F00_thumb_5F00_03E39330.png" width="200" height="353" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;On the Raspberry, run the following command line from the directory you’ve copied the exe and the so file:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Sudo mono yourprogramm.exe&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;of course, yourprogramm here represent the name of the program you’ve done. And in my case I made the link blinking.&lt;/p&gt;  &lt;p&gt;The way it’s working is quite simple. Like in a normal .Net program, you can import external DLL like the system ones. Here, you import the same way but of course not DLL but object. See the following example:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;[DllImport(&lt;span class="str"&gt;&amp;quot;libbcm2835.so&amp;quot;&lt;/span&gt;, EntryPoint = &lt;span class="str"&gt;&amp;quot;bcm2835_spi_transfernb&amp;quot;&lt;/span&gt;)]
&lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;extern&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; bcm2835_spi_transfernb(&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;[MarshalAs(UnmanagedType.LPArray)]&lt;span class="kwrd"&gt;byte&lt;/span&gt;[] tbuf, &lt;/pre&gt;

&lt;pre class="csharpcode"&gt;[MarshalAs(UnmanagedType.LPArray)]&lt;span class="kwrd"&gt;byte&lt;/span&gt;[] rbuf, UInt32 len);
&lt;/pre&gt;


&lt;p&gt;In this case, it’s interesting as you’ll have to use the Marshaling. And you’ll have to do in a similar way for all the array, strings, pointers and anything what is not a very simple as byte, uint or other. Be also very careful on the length of the parameters, make sure you match them correctly.&lt;/p&gt;

&lt;p&gt;And I’ve quickly implemented a compatible class for Cpu.Pin, SPI, OutputPort and PWM by importing the various functions from the BCM2835 library.&lt;/p&gt;

&lt;p&gt;My main goal was to reuse the maximum of code from an SPI example piloting a 3.5$ Nokia 5110 LCD screen. I reused the code found on the &lt;a href="http://www.netduino.com/" target="_blank"&gt;Netduino&lt;/a&gt; wiki page: &lt;a href="http://wiki.netduino.com/Nokia-5110-LCD.ashx?HL=nokia"&gt;http://wiki.netduino.com/Nokia-5110-LCD.ashx?HL=nokia&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I did it in couple of hours, exporting the definition from the NETMF code to a new project. As a result, I manage to make it work perfectly on my RaspberryPi!! Cool &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4426.wlEmoticon_2D00_smile_5F00_52B846C1.png" /&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2211.image_5F00_5E128E2E.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2500.image_5F00_thumb_5F00_539E8D83.png" width="347" height="241" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, I quickly found lots of limitation in the BCM2835 library I’ve used. PWM was not implemented, I found bugs in the SPI part, no support of interruptions, and others.&lt;/p&gt;

&lt;p&gt;So I’ve looked at another library and I found the WiringPi &lt;a title="http://wiringpi.com/" href="http://wiringpi.com/"&gt;http://wiringpi.com/&lt;/a&gt;. This library was a bit more complete. Still not the perfect one but more complete. It does implement SPI, i2c, soft and hard PWM and interruption support for the digital IO. It does support also advanced implementations like the helpers we can find in NETMF. &lt;/p&gt;

&lt;p&gt;And from this points, I’ve used the NETMF portability kit with all the definitions, all the sources to make it as much compatible as possible with NETMF. See my next posts to find more about it and find the Codeplex project associated.&lt;/p&gt;

&lt;p&gt;Ultimately, I’d love to port the full NETMF on RaspberryPi but for this, I’ll need much more time than I have or other very motivated persons.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10427690" width="1" height="1"&gt;</description></item><item><title>Ultrasound sensor and .NET Microframework (NETMF)</title><link>http://blogs.msdn.com/b/laurelle/archive/2013/05/27/ultrasound-sensor-and-net-microframework-netmf.aspx</link><pubDate>Mon, 27 May 2013 17:42:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10421586</guid><dc:creator>Laurelle</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10421586</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2013/05/27/ultrasound-sensor-and-net-microframework-netmf.aspx#comments</comments><description>&lt;p&gt;I recently bought a cheap ultrasound sensor because I want to build a robot. Yes, after the &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/07/managing-my-sprinklers-from-the-cloud.aspx" target="_blank"&gt;sprinkler management system&lt;/a&gt; and the &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/06/20/using-xmlhttprequest-to-pilot-a-lego-train-dynamically-in-html-5.aspx" target="_blank"&gt;automation of my Lego city&lt;/a&gt;, it’s time to play with a robot &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4274.wlEmoticon_2D00_smile_5F00_1E8B321B.png" /&gt;. This sensor can measure the distance from 2 cm to approximately 50 cm. Cost is about 5$. &lt;/p&gt;  &lt;p&gt;There are 4 pins:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt; VCC = 5V&lt;/li&gt;    &lt;li&gt;Trig = send an impulsion and you’ll get a signal back in the Echo pin&lt;/li&gt;    &lt;li&gt;Echo = the signal back from the impulsion&lt;/li&gt;    &lt;li&gt;Gnd = ground&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;img alt="" src="http://ecx.images-amazon.com/images/I/51tbSvuOcAL._SY300_.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;So the usage is very simple, just use 2 pins in the &lt;a href="http://www.netduino.com/" target="_blank"&gt;Netduino&lt;/a&gt; board, 1 for Trig and 1 for Echo. In terms of code, it will be simple: output the value 1 (high) on the trig pin, then put it back to 0 (low), wait for an answer on Echo pin. Then you measure the time between the value sent and the way back. It will give you the distance. Best is to use the Ticks generated by DateTime. The difference will give 2 times the distance which you’ll have to divide by the celerity of the air (so approx 340 m per second). And that’s for the theory &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4274.wlEmoticon_2D00_smile_5F00_1E8B321B.png" /&gt;&lt;/p&gt;  &lt;p&gt;When you look at the reality, it’s always very different &lt;img class="wlEmoticon wlEmoticon-openmouthedsmile" alt="Rire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3531.wlEmoticon_2D00_openmouthedsmile_5F00_085516C9.png" /&gt;. I’ve done measurement and he is the graph with points and ticks every centimeter:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4532.image_5F00_75A01D11.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8780.image_5F00_thumb_5F00_7F850E7C.png" width="465" height="365" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;What we can clearly see is a distortion when the object is close, the distance is not very well evaluated and it’s a pretty much linear curve for the rest. I’ve removed the 1cm point and made a linear regression. The initial point is at 4000 ticks.&lt;/p&gt;  &lt;p&gt;Then the step is about 636 per centimeter. And with those 2 values I can now easily calculate a distance.&lt;/p&gt;  &lt;p&gt;I’ve look at the web to search some existing code and there are existing classes. I pick one which was well written by John E. Wilson and posted in the &lt;a href="http://forums.netduino.com/" target="_blank"&gt;Netduino forum&lt;/a&gt;. I’ve simplified a bit the code and change values for calibration. The simplify code looks like:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="background: white; color: black;"&gt;    &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;public class &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;HC_SR04
    &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;{
        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;private &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;OutputPort &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;portOut;
        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;private &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;InterruptPort &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;interIn;
        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;private long &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;beginTick;
        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;private long &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;endTick;
        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;private long &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;minTicks = 0;  &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// System latency, &lt;/span&gt;&lt;/pre&gt;

&lt;pre class="code"&gt;&lt;span style="background: white; color: green;"&gt;subtracted off ticks to find actual sound travel time

        &lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;Constructor
        &lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;/// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name=&amp;quot;pinTrig&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="background: white; color: green;"&gt;Netduino pin connected to the HC-SR04 Trig pin&lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;&amp;lt;/param&amp;gt;
        /// &amp;lt;param name=&amp;quot;pinEcho&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="background: white; color: green;"&gt;Netduino pin connected to the HC-SR04 Echo pin&lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;&amp;lt;/param&amp;gt;
        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;public &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;HC_SR04(&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Cpu&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Pin &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;pinTrig, &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Cpu&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Pin &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;pinEcho)
        {
            portOut = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;OutputPort&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(pinTrig, &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;false&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;);
            interIn = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;InterruptPort&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(pinEcho, &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;false&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;, &lt;/span&gt;&lt;/pre&gt;

&lt;pre class="code"&gt;&lt;span style="background: white; color: black;"&gt;&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Port&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;ResistorMode&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Disabled, &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Port&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;InterruptMode&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.InterruptEdgeLow);
            interIn.OnInterrupt += &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;NativeEventHandler&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(interIn_OnInterrupt);
            minTicks = 4000L;

        }

        &lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;Trigger a sensor reading
        &lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;/// 
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="background: white; color: green;"&gt;Number of mm to the object&lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;&amp;lt;/returns&amp;gt;
        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;public long &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;Ping()
        {
            &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Reset Sensor
            &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;portOut.Write(&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;true&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;);
            &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Sleep(1);

            &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Start Clock
            &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;endTick = 0L;
            beginTick = System.&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Now.Ticks;
            &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Trigger Sonic Pulse
            &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;portOut.Write(&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;false&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;);

            &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Wait 1/20 second (this could be set as a variable instead of constant)
            &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Sleep(50);

            &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;if &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(endTick &amp;gt; 0L)
            {
                &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Calculate Difference
                &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;long &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;elapsed = endTick - beginTick;

                &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Subtract out fixed overhead (interrupt lag, etc.)
                &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;elapsed -= minTicks;
                &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;if &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(elapsed &amp;lt; 0L)
                {
                    elapsed = 0L;
                }

                &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Return elapsed ticks
                &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;return &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;elapsed * 10 / 636;
                ;
            }

            &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Sonic pulse wasn't detected within 1/20 second
            &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;return &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;-1L;
        }

        &lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;This interrupt will trigger when detector receives back reflected sonic pulse       
        &lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;/// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name=&amp;quot;data1&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="background: white; color: green;"&gt;Not used&lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;&amp;lt;/param&amp;gt;
        /// &amp;lt;param name=&amp;quot;data2&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="background: white; color: green;"&gt;Not used&lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;&amp;lt;/param&amp;gt;
        /// &amp;lt;param name=&amp;quot;time&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="background: white; color: green;"&gt;Transfer to endTick to calculated sound pulse travel time&lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;&amp;lt;/param&amp;gt;
        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;void &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;interIn_OnInterrupt(&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;uint &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;data1, &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;uint &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;data2, &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;DateTime &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;time)
        {
            &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// Save the ticks when pulse was received back
            &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;endTick = time.Ticks;
        }
    }&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;The value returned is in milimeter. Usage of the class is extremely simple:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="background: white; color: black;"&gt;        &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;public static void &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;Main()
        {
            HC_SR04.&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;HC_SR04 &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;mUS = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;HC_SR04.&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;HC_SR04&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Pins&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.GPIO_PIN_D4, &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Pins&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.GPIO_PIN_D5);
&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;            &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;while &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;true&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;)
            {
                &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Print(mUS.Ping().ToString());
                &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Sleep(500);
            }

        }&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;That’s it for the Ultra Sound sensor. Next sensor will probably be a presence sensor.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10421586" width="1" height="1"&gt;</description></item><item><title>Adding Bluetooth support to a NETMF board (.NET Microframework)</title><link>http://blogs.msdn.com/b/laurelle/archive/2013/04/29/adding-bluetooth-support-to-a-netmf-board-net-microframework.aspx</link><pubDate>Mon, 29 Apr 2013 09:59:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10414706</guid><dc:creator>Laurelle</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10414706</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2013/04/29/adding-bluetooth-support-to-a-netmf-board-net-microframework.aspx#comments</comments><description>&lt;p&gt;I recently bought a very cheap Bluetooth adaptor for my Netduino. I wanted to test how easy/hard it is to support Bluetooth. I see lots of advantages with Bluetooth for a near field communication like piloting easily a robot with a Phone without the need of other network or Infrared. Also Bluetooth is a secured communication with a peering.&lt;/p&gt;  &lt;p&gt;So I bought &lt;a href="http://dx.com/p/jy-mcu-arduino-bluetooth-wireless-serial-port-module-104299" target="_blank"&gt;this cheap Bluetooth&lt;/a&gt; adaptor for $8.20. It does expose itself to the world with a serial port on one side and as a normal Bluetooth device on the other side. Communication is supported with a serial port from one side to the other. On a PC, Phone or whatever device, it creates a serial port. So communication is basically very transparent and assimilated to a serial port from end to end.&lt;/p&gt;  &lt;p&gt;&lt;img alt="JY-MCU Arduino Bluetooth Wireless Serial Port Module" src="http://img.dxcdn.com/productimages/sku_104299_1.jpg" width="256" height="256" /&gt;&lt;img alt="JY-MCU Arduino Bluetooth Wireless Serial Port Module" src="http://img.dxcdn.com/productimages/sku_104299_3.jpg" width="245" height="245" /&gt;&lt;/p&gt;  &lt;p&gt;When I received it, I was impatient to test it. First step was to peer it with a PC. I looked at the documentation and found the default name for this device was “linvor” and found out the passkey was 1234. After cabling it with 3.3V (my board support 3.3V to 12V alimentation) and the ground, and approximately 1 minutes, I peered it!&lt;/p&gt;  &lt;p&gt;New step was to write a bit of code to test all this. I decided to do a very basic echo program. So whatever it will receive, it will send it back to the calling program. On the netduino board, I’ll use the COM1 (pins D0 and D1). I found also in less than 1 minute that the default configuration was 9600 bauds, 8 bits, no parity and 1 bit stop. So I wrote this very simple code for the test, very hard to do more basic than that:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Net;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Net.Sockets;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Threading;
&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.SPOT;
&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.SPOT.Hardware;
&lt;span class="kwrd"&gt;using&lt;/span&gt; SecretLabs.NETMF.Hardware;
&lt;span class="kwrd"&gt;using&lt;/span&gt; SecretLabs.NETMF.Hardware.Netduino;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text; 
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.IO.Ports;   

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Bluetooth
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Program
    {
        &lt;span class="kwrd"&gt;static&lt;/span&gt; SerialPort serial;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main()
        {
            &lt;span class="rem"&gt;// initialize the serial port for COM1 (pins D0 and D1)             &lt;/span&gt;
            serial = &lt;span class="kwrd"&gt;new&lt;/span&gt; SerialPort(SerialPorts.COM1, 9600, Parity.None, 8, StopBits.One);             
            &lt;span class="rem"&gt;// open the serial-port, so we can send and receive data             &lt;/span&gt;
            serial.Open();             
            &lt;span class="rem"&gt;// add an event-handler for handling incoming data             &lt;/span&gt;
            serial.DataReceived += &lt;span class="kwrd"&gt;new&lt;/span&gt; SerialDataReceivedEventHandler(serial_DataReceived);       
            &lt;span class="rem"&gt;//wait until the end of the Universe :-)&lt;/span&gt;
            
            Thread.Sleep(Timeout.Infinite);         
        }            
        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; serial_DataReceived(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, SerialDataReceivedEventArgs e)         
        {             
            &lt;span class="rem"&gt;// create a single byte array             &lt;/span&gt;
            &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] bytes = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[1];                
            &lt;span class="rem"&gt;// as long as there is data waiting to be read             &lt;/span&gt;
            &lt;span class="kwrd"&gt;while&lt;/span&gt; (serial.BytesToRead &amp;gt; 0)             
            {                 
                &lt;span class="rem"&gt;// read a single byte                 &lt;/span&gt;
                serial.Read(bytes, 0, bytes.Length);                 
                &lt;span class="rem"&gt;// send the same byte back                 &lt;/span&gt;
                serial.Write(bytes, 0, bytes.Length);             
            }         
        }       
        
    }
}
&lt;/pre&gt;


&lt;p&gt;I launch a simple serial port program like the old Hyper terminal on the PC where I peered the Bluetooth device and ran the test. Good surprise, I selected the port created on my PC (was port 6), open the port. The Bluetooth device went from a red blinking led to a always on led showing the device was correctly peered. Sounds good so far! So I typed “bonjour” and send it. instantly I get the “bonjour” back. &lt;/p&gt;

&lt;p&gt;So cool it’s working! I wanted to know more about the cheap and what can be setup, changes like the name of the device, the pin, the baud rate, etc. I used my preferred search engine Bing and quickly found out that it’s possible to change lots of things by sending couple of AT command. Those commands were used at the old age of modems &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7532.wlEmoticon_2D00_smile_5F00_780F0A3C.png" /&gt; It just remembered me that!&lt;/p&gt;

&lt;p&gt;Even if there are lots of cheap existing like the one I bought, most support exactly the same commands. I found a good documentation &lt;a href="http://www.cutedigi.com/pub/Bluetooth/BMX_Bluetooth_quanxin.pdf" target="_blank"&gt;there&lt;/a&gt;. It’s not the same cheap and the AT commands are a bit different but I quickly found out that most were working. So I’ve decided to test if it was working. All what you have to do is send the commands when the device is not peered. You can do it either with a USB to serial FTDI cheap or directly from the board. I did it directly from the Netduino by modifying&amp;#160; a bit the code to send the commands. I found the most interesting commands were the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;AT+NAMEnewname\r\n to change the device name, you get an answer&lt;/li&gt;

  &lt;li&gt;AT+PINxxxx\r\n to change the pin code, default is 1234&lt;/li&gt;

  &lt;li&gt;AT+BAUDx\r\n where X goes from 1 to 8 (1 = 1200 to 8 = 115200) to change the baud rate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;I send couple of commands to test and it worked just perfectly &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7532.wlEmoticon_2D00_smile_5F00_780F0A3C.png" /&gt; So I renamed the device to LaurelleBT instead of linvor. As the device was already peered, Windows did not had to reinstall drivers or cut the communication, it was just about changing the displayed name:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1072.image_5F00_1E70ED88.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4212.image_5F00_thumb_5F00_37008AD8.png" width="438" height="64" /&gt;&amp;#160;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So that’s it! In 5 minutes I had a working Bluetooth module on my board. I was positively surprised and I’ll buy more for sure! Next step it to mount it on a robot and pilot it from a Windows Phone or Windows 8 device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10414706" width="1" height="1"&gt;</description></item><item><title>.NET Microframework (NETMF) Web Server source code available</title><link>http://blogs.msdn.com/b/laurelle/archive/2013/04/07/net-microframework-netmf-web-server-source-code-available.aspx</link><pubDate>Sun, 07 Apr 2013 14:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10409149</guid><dc:creator>Laurelle</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10409149</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2013/04/07/net-microframework-netmf-web-server-source-code-available.aspx#comments</comments><description>&lt;p&gt;So as I got lots of asks to get the code of my Web Server, I’ve decided to create a Codeplex project. You’ll find the source here: &lt;a title="https://netmfwebserver.codeplex.com/" href="https://netmfwebserver.codeplex.com/"&gt;https://netmfwebserver.codeplex.com/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It does include the following features:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Start, stop, Pause the Web Server&lt;/li&gt;    &lt;li&gt;Creation of a Web Server on any port&lt;/li&gt;    &lt;li&gt;Fully functional multithread Web Server supporting GET only&lt;/li&gt;    &lt;li&gt;Downloading any file present on a SD (or any other physical storage)&lt;/li&gt;    &lt;li&gt;A full function to get all the parameters of a URL&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Examples of usage can be found on this blog. Working to publish a fully functional example.&lt;/p&gt;  &lt;p&gt;Feedback welcome!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10409149" width="1" height="1"&gt;</description></item><item><title>Web Server and CSS files in NETMF (.NET Microframework)</title><link>http://blogs.msdn.com/b/laurelle/archive/2013/04/05/web-server-and-css-files-in-netmf-net-microframework.aspx</link><pubDate>Fri, 05 Apr 2013 08:16:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10407866</guid><dc:creator>Laurelle</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10407866</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2013/04/05/web-server-and-css-files-in-netmf-net-microframework.aspx#comments</comments><description>&lt;p&gt;It’s been a long time I did not write anything on my blog. Not that I haven’t developed anything but just because I did not take the time to write proper articles. I’ve continue to add features to my Lego city by piloting the trains but also the switches. And I’ll try to write articles to explain how to do that for all the features.&lt;/p&gt;  &lt;p&gt;But I will start with the modification of my Web Server to support CSS file. I did couple of demonstration of my development and each time I show the interface people were telling to me I need to work with a designer. And that’s what I finally did &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0447.wlEmoticon_2D00_smile_5F00_6AA2141C.png" /&gt; I worked with &lt;a href="http://blogs.msdn.com/b/designmichel/" target="_blank"&gt;Michel Rousseau&lt;/a&gt; who is designer at Microsoft in the French team. And I gave him a challenge: “Design this simple web page without changing the code too much and keep it less than couple of K without any image”. Michel is used to design Windows 8 and Windows Phone apps but not very very simple page like the one I had.&lt;/p&gt;  &lt;p&gt;And he has done an excellent job! Here is the view before and after:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6215.image_5F00_1103F768.png"&gt;&lt;img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3568.image_5F00_thumb_5F00_7C81389A.png" width="179" height="244" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0116.image_5F00_050497E5.png"&gt;&lt;img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6470.image_5F00_thumb_5F00_7BAB6361.png" width="180" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now I had to implement this in my code. As the brief was to have minimal effect on the code, I was expecting to implement this quickly. Reality was a bit different. It took me a bit more time than expected for the following reasons:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;I had to implement in &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/29/creating-an-efficient-http-web-server-for-net-microframework-netmf.aspx" target="_blank"&gt;my basic web server&lt;/a&gt; a function to be able to download a file (the CSS one)&lt;/li&gt;    &lt;li&gt;To read and download a file from an SD, you have to do it by chunk as the buffer size is limited (in the case of my &lt;a href="http://www.netduino.com/" target="_blank"&gt;Netduino&lt;/a&gt; 1024 bit)&lt;/li&gt;    &lt;li&gt;Modify the main code to care about downloaded file and also add the lines of code to support CSS&lt;/li&gt;    &lt;li&gt;But the main issue was that I’ve discovered that to be able to have a CSS file, you need to have the specific type “text/css”. This is to avoid cross domain fishing and other hacking&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So let see how to implement this step by step. So let start with the reading part of the file and how to send it. As explained in the last point, a CSS file has to have the correct mime type in the header. In fact, Internet Explorer and most of the other browsers such as Chrome and Firefox does not need the mime type to determine what kind of fire you are downloading. They do it with the mime type and/or with the extension. Most of the time, it’s just with the extension and reading the header of the file. But for security reason, it’s better if you have to determine correctly the type matching with the extension and the header of the file. And for CSS, it is forced like this to reinforce the security in Internet Explorer 8, 9 and 10. &lt;/p&gt;  &lt;p&gt;So as I had to implement this feature for CSS, I made a simple function to support some types I’ll use in other creation:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SendFileOverHTTP(Socket response, &lt;span class="kwrd"&gt;string&lt;/span&gt; strFilePath)
        {
            &lt;span class="kwrd"&gt;string&lt;/span&gt; ContentType = &lt;span class="str"&gt;&amp;quot;text/html&amp;quot;&lt;/span&gt;;
            &lt;span class="rem"&gt;//determine the type of file for the http header&lt;/span&gt;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.cs&amp;quot;&lt;/span&gt;) != -1 ||
                strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.txt&amp;quot;&lt;/span&gt;) != -1 ||
                strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.csproj&amp;quot;&lt;/span&gt;) != -1
            )
            {
                ContentType = &lt;span class="str"&gt;&amp;quot;text/plain&amp;quot;&lt;/span&gt;;
            }

            &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.jpg&amp;quot;&lt;/span&gt;) != -1 ||
                strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.bmp&amp;quot;&lt;/span&gt;) != -1 ||
                strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.jpeg&amp;quot;&lt;/span&gt;) != -1
              )
            {
                ContentType = &lt;span class="str"&gt;&amp;quot;image&amp;quot;&lt;/span&gt;;
            }

            &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.htm&amp;quot;&lt;/span&gt;) != -1 ||
                strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.html&amp;quot;&lt;/span&gt;) != -1
              )
            {
                ContentType = &lt;span class="str"&gt;&amp;quot;text/html&amp;quot;&lt;/span&gt;;
            }

            &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.mp3&amp;quot;&lt;/span&gt;) != -1)
            {
                ContentType = &lt;span class="str"&gt;&amp;quot;audio/mpeg&amp;quot;&lt;/span&gt;;
            }
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.IndexOf(&lt;span class="str"&gt;&amp;quot;.css&amp;quot;&lt;/span&gt;) != -1)
            {
                ContentType = &lt;span class="str"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt;;
            }

            &lt;span class="kwrd"&gt;string&lt;/span&gt; strResp = &lt;span class="str"&gt;&amp;quot;HTTP/1.1 200 OK\r\nContent-Type: &amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="str"&gt;&lt;/span&gt; + ContentType + &lt;span class="str"&gt;&amp;quot;; charset=UTF-8\r\nCache-Control: &lt;/span&gt;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="str"&gt;no-cache\r\nConnection: close\r\n\r\n&amp;quot;&lt;/span&gt;;
            OutPutStream(response, strResp);&lt;/pre&gt;


&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;So very simple and straight forward code. I do determine the extension of the file I want to read and create a ContentType variable with the right format. Then I build the HTTP header and send the header. Very simple, efficient and straight forward code. We are doing Embedded code, it’s not the code I would do in a normal development of a real web server. But it does the job there!&lt;/p&gt;

&lt;p&gt;Next step is reading the file and outputting it to the Socket. And I do this in the same function, right after this first part:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;            FileStream fileToServe = &lt;span class="kwrd"&gt;null&lt;/span&gt;;
            &lt;span class="kwrd"&gt;try&lt;/span&gt;
            {
                fileToServe = &lt;span class="kwrd"&gt;new&lt;/span&gt; FileStream(strFilePath, &lt;/pre&gt;

&lt;pre class="csharpcode"&gt;FileMode.Open, FileAccess.Read);
                &lt;span class="kwrd"&gt;long&lt;/span&gt; fileLength = fileToServe.Length;
                &lt;span class="rem"&gt;// Now loops sending all the data.&lt;/span&gt;

                &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] buf = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[MAX_BUFF];
                &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;long&lt;/span&gt; bytesSent = 0; bytesSent &amp;lt; fileLength; )
                {
                    &lt;span class="rem"&gt;// Determines amount of data left.&lt;/span&gt;
                    &lt;span class="kwrd"&gt;long&lt;/span&gt; bytesToRead = fileLength - bytesSent;
                    bytesToRead = bytesToRead &amp;lt; MAX_BUFF ? bytesToRead : MAX_BUFF;
                    &lt;span class="rem"&gt;// Reads the data.&lt;/span&gt;
                    fileToServe.Read(buf, 0, (&lt;span class="kwrd"&gt;int&lt;/span&gt;)bytesToRead);
                    &lt;span class="rem"&gt;// Writes data to browser&lt;/span&gt;
                    response.Send(buf, 0, (&lt;span class="kwrd"&gt;int&lt;/span&gt;)bytesToRead, SocketFlags.None);

                    System.Threading.Thread.Sleep(100);
                    &lt;span class="rem"&gt;// Updates bytes read.&lt;/span&gt;
                    bytesSent += bytesToRead;
                }
                fileToServe.Close();
            }
            &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception e)
            {
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (fileToServe != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                {
                    fileToServe.Close();
                }
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; e;
            }

        }&lt;/pre&gt;


&lt;p&gt;First step is to create a FileStream and create the Stream with the path of the file and read the length of the file. MAX_BUFF = 1024 and is the maximum size of a buffer. It depends on the .NET Microframework Platform. And we will start a loop to read part of the file and send it.&lt;/p&gt;

&lt;p&gt;The System.Threading.Thread.Sleep(100) is necessary to allow some time for the system and other tasks. If you don’t put it and have other tasks, the risk is that the memory will get full very quickly and you’ll block all the code.&lt;/p&gt;

&lt;p&gt;In my Web Server I have an event raised when an HTTP request is done. Here is an example of code you can place in your handling function to manage on one side the files to be downloaded from the SD and on the other side a page you’ll generate dynamically like in ASP, ASP.NET, PHP or any other dynamic language:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;            &lt;span class="rem"&gt;//PageCSS&lt;/span&gt;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.Length &amp;gt;= pageCSS.Length)
            {
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.Substring(0, pageCSS.Length).ToLower() == pageCSS)
                {
                    &lt;span class="kwrd"&gt;string&lt;/span&gt; strDefaultDir = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;
                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (Microsoft.SPOT.Hardware.SystemInfo.IsEmulator)
                        strDefaultDir = &lt;span class="str"&gt;&amp;quot;WINFS&amp;quot;&lt;/span&gt;;
                    &lt;span class="kwrd"&gt;else&lt;/span&gt;
                        strDefaultDir = &lt;span class="str"&gt;&amp;quot;SD&amp;quot;&lt;/span&gt;;
                    WebServer.SendFileOverHTTP(response, strDefaultDir + &lt;span class="str"&gt;&amp;quot;\\&amp;quot; + pageCSS);
                    return;
                }
            }
            //HTTP header
            strResp = &amp;quot;&lt;/span&gt;HTTP/1.1 200 OK\r\nContent-Type: text/html; &lt;/pre&gt;

&lt;pre class="csharpcode"&gt;charset=utf-8\r\nCache-Control: no-cache\r\nConnection: close\r\n\r\n&amp;quot;;
            strResp = WebServer.OutPutStream(response, strResp);

            &lt;span class="rem"&gt;// Page util&lt;/span&gt;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.Length &amp;gt;= pageUtil.Length)
            {
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (strFilePath.Substring(0, pageUtil.Length).ToLower() == pageUtil)
                {
                    ProcessUtil(response, strFilePath);
                    &lt;span class="kwrd"&gt;return&lt;/span&gt;;
                }
            }&lt;/pre&gt;


&lt;p&gt;Here PageCSS = the file name of the file you are looking for (including the path if in sub directory) so something like “page.css” and pageUtil = name of a page you will generate dynamically (including the path subdirectory) so something like “util.aspx”&lt;/p&gt;

&lt;p&gt;strFilePath = full URL including the parameters so something like “util.apsx?bd=3;tc=4”&lt;/p&gt;

&lt;p&gt;so code looks for the name of the page in the URL and brunch it to a either the SendFileOverHTTP function we’ve just look at or another function in the case of a dynamic page.&lt;/p&gt;

&lt;p&gt;You’ll note also that the is a case in the file part as the default directory is not the same if you are in the emulator or on a real board. The path depend also from the Platform. In the case of my Netduino, it’s CD. For emulator, it’s always WINFS.&lt;/p&gt;

&lt;p&gt;And please do all your file reading brunching before the HTTP header part. As for files, the header is already send out. Which is not the case for the dynamic generated page. As you can send whatever you want including images, text, binary files and you’ll need to set it up correctly.&lt;/p&gt;

&lt;p&gt;Now, lets have a look at the CSS file:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;@charset &amp;quot;utf-8&amp;quot;;
/* CSS Document */

body {
    font-family: &amp;quot;Lucida Console&amp;quot;, Monaco, monospace;
    font-size: 16px;
    color: #09C;
    text-align: center;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}

a {
    font-family: &amp;quot;Lucida Console&amp;quot;, Monaco, monospace;
    font-size: 14px;
    color: #09F;
}
td {
    font-family: Arial, Helvetica, sans-serif;
    color: #004262;
    font-size: 14px;
}
input {
    font-family: &amp;quot;Lucida Console&amp;quot;, Monaco, monospace;
    font-size: 16px;
    color: #09F;
    background-color: #FFF;
    -webkit-transition: all 0s linear 0s;
    -moz-transition: all 0s linear 0s;
    -ms-transition: all 0s linear 0s;
    -o-transition: all 0s linear 0s;
    transition: all 0s linear 0s;
    border: 1px none #FFF;
}

h1 {
    font-family: Arial, Helvetica, sans-serif;
    color: #FFF;
    background-color: #006699;
    font-size: 24px;
    border: thick solid #006699;
}
td {
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
    font-size: 16px;
}
footer {
    color: #09C;
}
input:hover {
    background-color: #09F;
    color: #FFF;
}
input:active {
    background-color: #003;
}
&lt;/pre&gt;

&lt;p&gt;As you can see, it is very simple CSS that Michel did. It is just over righting the normal styles with colors and fonts. Nothing really complex but complicated to do something nice in only few lines of code! Well done Michel &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0447.wlEmoticon_2D00_smile_5F00_6AA2141C.png" /&gt;&lt;/p&gt;

&lt;p&gt;Now implementation in the rest of the code and all the pages is quite straight forward and simple, here is an example:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Start HTML document&lt;/span&gt;
strResp += &lt;span class="str"&gt;&amp;quot;&amp;lt;!DOCTYPE html PUBLIC \&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN\&amp;quot; &lt;/span&gt;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="str"&gt;\&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span class="str"&gt;&amp;quot;&amp;lt;html xmlns=\&amp;quot;http://www.w3.org/1999/xhtml\&amp;quot;&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Gestion des trains&amp;lt;/title&amp;gt;&amp;quot;&lt;/span&gt;;
&lt;span class="rem"&gt;//this is the css to make it nice :-)&lt;/span&gt;
strResp += &lt;span class="str"&gt;&amp;quot;&amp;lt;link href=\&amp;quot;&amp;quot;&lt;/span&gt; + pageCSS + &lt;span class="str"&gt;&amp;quot;?&amp;quot;&lt;/span&gt; + securityKey + &lt;span class="str"&gt;&amp;quot;\&amp;quot; rel=\&amp;quot;stylesheet\&amp;quot; type=\&amp;quot;text/css\&amp;quot; /&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span class="str"&gt;&amp;quot;&amp;lt;meta http-equiv=\&amp;quot;Content-Type\&amp;quot; content=\&amp;quot;text/html; charset=utf-8\&amp;quot;/&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span class="str"&gt;&amp;quot;&amp;lt;meta http-equiv=\&amp;quot;Cache-control\&amp;quot; content=\&amp;quot;no-cache\&amp;quot;/&amp;gt;&amp;quot;&lt;/span&gt;;
strResp = WebServer.OutPutStream(response, strResp);&lt;/pre&gt;


&lt;p&gt;The HTML page is build and the CSS page is added with a parameter (a security key). And this line including the CSS is the only line I have to add to go from the original design to the nice new one!&lt;/p&gt;

&lt;p&gt;So that’s it for this part. I’ll try to find some time to write additional examples.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10407866" width="1" height="1"&gt;</description></item><item><title>How software can solve hardware problems</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/07/30/how-software-can-solve-hardware-problems.aspx</link><pubDate>Mon, 30 Jul 2012 12:09:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10334740</guid><dc:creator>Laurelle</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10334740</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/07/30/how-software-can-solve-hardware-problems.aspx#comments</comments><description>&lt;p&gt;I’ve developed my own sprinkler system and my own humidity sensor. This sensor is extremely simple as you can read in my &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/07/18/a-soil-low-cost-humidity-sensor-moisture-and-net-micro-framework-netmf.aspx"&gt;article&lt;/a&gt;. The main problem of this sensor is that the data to be read is an analogic data and the length of the cable is very long. There are lots of problems implied with long cables. You can read an excellent article from Mario Vernari &lt;a href="http://highfieldtales.wordpress.com/2012/04/25/effect-of-long-wiring-on-digital-signals/"&gt;here&lt;/a&gt;. In his article, you can clearly see the impact of an alimentation, of other signals into a long distance cable.&lt;/p&gt;  &lt;p&gt;Of course my humidity sensor will follow the same problem. And I’ve logged couple of days of data every minute to have enough data to see how the data looks like.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5531.image_5F00_2.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1715.image_5F00_thumb.png" width="538" height="335" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can visually see the bleu line represents the data and with 19000 data, you can feel like it is very random. In fact those data are not random, they are just noisy. There are couple of solutions to avoid this problem. First solution is of course hardware, changing the hardware to remove a maximum of noise and clear the signal. But I will not do this for my example.&lt;/p&gt;  &lt;p&gt;I will use a pure software solution to remove this noise. As explained in Mario’s blog, most of the noise is kid of high frequency compare to the normal signal. And this apply to any scale. So in my scale, I will also have this issue. What I know is that my signal do not change much. Remember I’m measuring the soil humidity or moisture and this is not changing so quickly. It can change very quickly in less than couple of minutes in case of huge rain.&lt;/p&gt;  &lt;p&gt;So one of the solution is to do a mobile average. By doing this, you can remove the high frequency. The principle is simple, it’s about doing an average of N values that “moves” with the signal. And the effect is to mathematically remove the high frequencies. Let use an example with a period of 15 points. In my graph, that would say an average of a moving quarter. Applied to the previous graph, the black line does represent it:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5100.image_5F00_4.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8737.image_5F00_thumb_5F00_1.png" width="544" height="339" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;and visually, you can see that it does remove lots of the randomness. Of course, if you do an average on more points, you’ll remove even more of the noise. The orange one does represent an average on 60 points so a mobile average of 1h:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3823.image_5F00_6.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8787.image_5F00_thumb_5F00_2.png" width="549" height="342" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The period you have to choose depend on the quality of the signal and of course the change of data you still want to measure. The longest the period is and the less changes you can evaluate. So let use this last example with a 1 hour filter and let see if we can read anything on it. I know what was the weather and when I did sprinkler. Logically, each time it has rain, the signal should increase and decrease with no rain and high temperatures. And it should also increase if I did sprinkler. On this graph, I’ve put in red when it did rain and in green when I did sprinkler.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1348.image_5F00_12.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2313.image_5F00_thumb_5F00_5.png" width="553" height="345" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So even if we have this 60 points mobile filter and this remove rapid change in the measurement, it is still possible to see the impact of a rain or of a sprinkler. Now, I’ve added a 600 points mobile average and I let the pic where they were, here is the result:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0815.image_5F00_14.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7750.image_5F00_thumb_5F00_6.png" width="558" height="348" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;it is still readable but the impact of an event can be read later. And the pic are lower. I don’t want to enter in the theory but to be simple, it’s just because, you are using more data, so as explain, the average will lower the result as it is there to remove high frequencies. And you’ll need more “higher” data to see an impact. It’s like if you had a field of green grass and add couple of red flowers. Take a picture and do an average of the color. It will be green. Add couple of other red flours, take a picture again, do the average and continue like this. And you’ll need to have lots of red flours added to see a change while you’ve started adding flowers some time ago. This is exactly what is happening there. You will detect the phenomenon much later than it happened.&lt;/p&gt;  &lt;p&gt;So if you want to use those kind of filters, make sure you use them wisely and not with a too long period. In my case, I will probably use for production something between 15 and 60 points. I need to have an idea of the humidity, not a very precise value. And as shown in the previous graph, it is visible when there’s been some rain or if the sprinkler was on.&lt;/p&gt;  &lt;p&gt;And of course, I’ll need also to work on the isolation of the cable to try to remove some of the noise.&lt;/p&gt;  &lt;p&gt;You may Wonder how I was able to log 19000 points? Well, it is very simple and the code is there:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;LogToFile
&lt;/span&gt;{
    &lt;span style="color: blue;"&gt;static public bool &lt;/span&gt;Print(&lt;span style="color: blue;"&gt;string &lt;/span&gt;StrFileName, &lt;span style="color: blue;"&gt;string &lt;/span&gt;strToLog)
    {
        &lt;span style="color: blue;"&gt;try
        &lt;/span&gt;{
            &lt;span style="color: rgb(43, 145, 175);"&gt;FileStream &lt;/span&gt;fileToWrite = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;FileStream&lt;/span&gt;(StrFileName, &lt;span style="color: rgb(43, 145, 175);"&gt;FileMode&lt;/span&gt;.OpenOrCreate, &lt;span style="color: rgb(43, 145, 175);"&gt;FileAccess&lt;/span&gt;.Write);
            &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] buff = &lt;span style="color: rgb(43, 145, 175);"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(strToLog);
            fileToWrite.Seek(fileToWrite.Length, 0);
            fileToWrite.Write(buff, 0, buff.Length);
            fileToWrite.Close();
            &lt;span style="color: blue;"&gt;return true&lt;/span&gt;; 
        }
        &lt;span style="color: blue;"&gt;catch &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Exception &lt;/span&gt;e)
        { 
            &lt;span style="color: blue;"&gt;return false&lt;/span&gt;;  
        }
    
    }
}
&lt;/pre&gt;

&lt;p&gt;It takes a simple file name as an input and something to write. The code is straight forward, it first create or open a file. Then encode the string to write in the buff variable. Seek to the end of the file, write the buff and close the file. So extremely simple code!&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;LogToFile&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;WINFS\\out.txt&amp;quot;&lt;/span&gt;, &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;.Now.ToString(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;MM/dd/yyyy HH:mm:ss&amp;quot;&lt;/span&gt;) + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;;&amp;quot; &lt;/span&gt;+ mSensor.Humidity + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\r\n&amp;quot;&lt;/span&gt;);
&lt;/pre&gt;

&lt;p&gt;And the usage is as simple as the code, one line to log data like in this example. and as a result, you get data like this in the text file:&lt;/p&gt;

&lt;p&gt;07/29/2012 13:34:46;86 
  &lt;br /&gt; 07/29/2012 13:34:47;93 

  &lt;br /&gt; 07/29/2012 13:34:48;91 

  &lt;br /&gt; 07/29/2012 13:34:49;93 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;For the next article, we will see how to implement the filter in the real code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10334740" width="1" height="1"&gt;</description></item><item><title>A soil low cost humidity sensor (moisture) and .NET Micro Framework (NETMF)</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/07/18/a-soil-low-cost-humidity-sensor-moisture-and-net-micro-framework-netmf.aspx</link><pubDate>Wed, 18 Jul 2012 01:22:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10330920</guid><dc:creator>Laurelle</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10330920</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/07/18/a-soil-low-cost-humidity-sensor-moisture-and-net-micro-framework-netmf.aspx#comments</comments><description>&lt;p&gt;I’m working on my &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/07/managing-my-sprinklers-from-the-cloud.aspx"&gt;own sprinkler system&lt;/a&gt; which I can pilot thru Internet wherever I am. I can add programs and also open and close sprinklers when I want. I recently build a &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/06/24/a-low-cost-humidity-sensor-for-my-sprinkler-system.aspx"&gt;prototype of a humidity sensor&lt;/a&gt;. Now it’s time to implement this humidity sensor in pre production and see how it is working for real. Next phase will be an automatic piloting based on this humidity sensor. Thanks also to all the feedback I get which encourage me to continue those posts. I’m just a marketing guy doing hardware and software development &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1172.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;Based on the work of the prototype, I’ve build a normal size sensor and put it for real in my garden:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0511.WP_5F00_000846_5F00_2.jpg"&gt;&lt;img title="WP_000846" style="display: inline; background-image: none;" border="0" alt="WP_000846" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7851.WP_5F00_000846_5F00_thumb.jpg" width="324" height="430" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is the same principle as the prototype, there are 2 coppers cables put in the soil (approx. 10 centimeters) and current arriving to those 2 cables. The potential is measured and interpreted to see how humid it is. To summarize, the more humid it is the lower the resistance of the soil is. So I need 3 cables only: one for ground, one for +3.3V and one for the measurement. I can chain sensors and will only need 1 additional cable per sensor. This solution is very simple and very easy to implement. There are smartest way to do this with a real serial bus self powered. But for the moment, I’m fine with this solution. I will explore the other solution when I will want to add temperature, luminosity and others like wind.&lt;/p&gt;  &lt;p&gt;Now, looking at the code, I wanted to make part of the code reusable and I’ve define a humidity sensor with simple Properties and a class to initialize the analogic input.&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public struct &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;HumiditySenrorParam
&lt;/span&gt;{
    &lt;span style="color: blue;"&gt;public int &lt;/span&gt;MinValue;
    &lt;span style="color: blue;"&gt;public int &lt;/span&gt;MaxValue;
    &lt;span style="color: blue;"&gt;public int &lt;/span&gt;DeclValue;
    &lt;span style="color: blue;"&gt;public int &lt;/span&gt;UpdateTime;
}

&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;HumiditySensor
&lt;/span&gt;{
    &lt;span style="color: blue;"&gt;private &lt;/span&gt;SecretLabs.NETMF.Hardware.&lt;span style="color: rgb(43, 145, 175);"&gt;AnalogInput &lt;/span&gt;HumSensor;
    &lt;span style="color: blue;"&gt;private &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Timer &lt;/span&gt;MyTimer;
    &lt;span style="color: blue;"&gt;private int &lt;/span&gt;myDeclUpdate;
    &lt;span style="color: blue;"&gt;private int &lt;/span&gt;myHumidity;
    &lt;span style="color: blue;"&gt;private bool &lt;/span&gt;bhumid = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;
   
    &lt;span style="color: blue;"&gt;public &lt;/span&gt;HumiditySensor(&lt;span style="color: rgb(43, 145, 175);"&gt;Cpu&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;Pin &lt;/span&gt;HumidityPin, &lt;br /&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;HumiditySenrorParam &lt;/span&gt;MyHumidityStruct)
    {
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(!Microsoft.SPOT.Hardware.&lt;span style="color: rgb(43, 145, 175);"&gt;SystemInfo&lt;/span&gt;.IsEmulator)
            HumSensor = &lt;br /&gt;&lt;span style="color: blue;"&gt;new &lt;/span&gt;SecretLabs.NETMF.Hardware.&lt;span style="color: rgb(43, 145, 175);"&gt;AnalogInput&lt;/span&gt;(HumidityPin);
        MyTimer = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Timer&lt;/span&gt;(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;TimerCallback&lt;/span&gt;(ClockTimer_Tick), &lt;br /&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;, MyHumidityStruct.UpdateTime * 1000, 0);
        MinValue = MyHumidityStruct.MinValue;
        MaxValue = MyHumidityStruct.MaxValue;
        DeclValue = MyHumidityStruct.DeclValue;
        UpdateTime = MyHumidityStruct.UpdateTime;
    }
&lt;/pre&gt;

&lt;p&gt;The HumiditySensorParam class is used to pass the initialization value to the HumiditySensor class. Each class is using an analogic input on a specific Pin from the CPU. This value is also passed in the constructor.&lt;/p&gt;

&lt;p&gt;An analogic input on the netduino has 1024 points from 0 to 3.3V starting from 0 to 1023. But as explained in the previous article on the prototype, only part of this range is used. So I’m using 3 parameters: a minimum value, a maximum value and a value to determine the limit between dry and humid. All should be from 0 to 1023. It is not checked in the class but a good programmer will do &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1172.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;

&lt;p&gt;Also, the analogic input has to be read in a regular timeframe. This is done by the UpdateTime value in seconds. A timer is raised every period to update the value of the humidity sensor.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public int &lt;/span&gt;MinValue
{ &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }

&lt;span style="color: blue;"&gt;public int &lt;/span&gt;MaxValue
{ &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }

&lt;span style="color: blue;"&gt;public int &lt;/span&gt;DeclValue
{ &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }

&lt;span style="color: blue;"&gt;public int &lt;/span&gt;UpdateTime
{
    &lt;span style="color: blue;"&gt;get &lt;/span&gt;{ &lt;span style="color: blue;"&gt;return &lt;/span&gt;myDeclUpdate; }
    &lt;span style="color: blue;"&gt;set
    &lt;/span&gt;{
        MyTimer.Change(0, &lt;span style="color: blue;"&gt;value &lt;/span&gt;* 1000);
        myDeclUpdate = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; 
    }
}
&lt;/pre&gt;

&lt;p&gt;All 4 parameters are stored into Properties. The min, max and decl value are stored in normal Properties. The UpdateTime is a bit different. It has to change the value of the timer. Again, here, I do things in a simple way, but all those values should be checked before setting them. &lt;/p&gt;

&lt;p&gt;Now let have a look at the timer&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;static void &lt;/span&gt;ClockTimer_Tick(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender)
{
    &lt;span style="color: rgb(43, 145, 175);"&gt;HumiditySensor &lt;/span&gt;mSensor = (&lt;span style="color: rgb(43, 145, 175);"&gt;HumiditySensor&lt;/span&gt;)sender;
    mSensor.Update();
    &lt;span style="color: green;"&gt;//Debug.Print(DateTime.Now.ToString(&amp;quot;MM/dd/yyyy HH:mm:ss&amp;quot;) &lt;br /&gt;+ &amp;quot; Humidity: &amp;quot; + mSensor.Humidity + &amp;quot; IsHumid: &amp;quot; + mSensor.IsHumid);
&lt;/span&gt;}
&lt;/pre&gt;

&lt;p&gt;The code is quite simple, it first get the object. This function must be a static one as it is called by .NETMF when it is time. The sender object is the humidity sensor itself as setup in the constructor. After the cast, it is possible to call the update method.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public void &lt;/span&gt;Update()
{
    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(!Microsoft.SPOT.Hardware.&lt;span style="color: rgb(43, 145, 175);"&gt;SystemInfo&lt;/span&gt;.IsEmulator)
        Humidity = HumSensor.Read();
    &lt;span style="color: blue;"&gt;else
        &lt;/span&gt;Humidity = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Random&lt;/span&gt;().Next(MaxValue);
}

&lt;/pre&gt;

&lt;p&gt;I first check if we are in the emulator or on a real Platform. In the case I’m in the emulator, I just return a random number. This allow to test the software when I do development in planes like now on my way to Atlanta &lt;img class="wlEmoticon wlEmoticon-winkingsmile" alt="Clignement d&amp;#39;��il" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6886.wlEmoticon_2D00_winkingsmile_5F00_2.png" /&gt;&lt;/p&gt;

&lt;p&gt;In the other case, I read the analogic input and put the value into the Humidity property. &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public int &lt;/span&gt;Humidity
{ &lt;span style="color: blue;"&gt;get &lt;/span&gt;{
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;myHumidity;
}
    &lt;span style="color: blue;"&gt;internal set &lt;/span&gt;{
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(&lt;span style="color: blue;"&gt;value &lt;/span&gt;&amp;lt; MinValue) &lt;span style="color: blue;"&gt;value &lt;/span&gt;= MinValue;
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(&lt;span style="color: blue;"&gt;value &lt;/span&gt;&amp;gt; MaxValue) &lt;span style="color: blue;"&gt;value &lt;/span&gt;= MaxValue;
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(&lt;span style="color: blue;"&gt;value &lt;/span&gt;&amp;gt;= DeclValue) bhumid = &lt;span style="color: blue;"&gt;true&lt;/span&gt;; &lt;span style="color: blue;"&gt;else &lt;/span&gt;bhumid = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;
        myHumidity = 100 * (&lt;span style="color: blue;"&gt;value &lt;/span&gt;- MinValue)/(MaxValue - MinValue);} 
}
&lt;/pre&gt;

&lt;p&gt;I allow to update this property only internally. I do the math with the Min, Max values to compute a percentage. And check if it is dry or humid.&lt;/p&gt;

&lt;p&gt;And I’ve also created 2 other Properties I can use later in the code:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public bool &lt;/span&gt;IsHumid
{
    &lt;span style="color: blue;"&gt;get
    &lt;/span&gt;{ &lt;span style="color: blue;"&gt;return &lt;/span&gt;bhumid; }
}

&lt;span style="color: blue;"&gt;public int &lt;/span&gt;DeclHumidity
{ 
    &lt;span style="color: blue;"&gt;get &lt;/span&gt;{ &lt;span style="color: blue;"&gt;return &lt;/span&gt;(100 * (DeclValue - MinValue) / (MaxValue - MinValue)) ; }
}
&lt;/pre&gt;

&lt;p&gt;The IsHumid return true if it is humid compare to the level and the DeclHumidity return this level in percentage. &lt;/p&gt;

&lt;p&gt;Here it is, you have a humidity sensor and the code to read the values &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1172.wlEmoticon_2D00_smile_5F00_2.png" /&gt; Now we will look at how to use it. For this, I display the humidity level in the main web page with the information regarding the sprinklers. And I’ve also build a page to be able to change dynamically the values of the Humidity sensor. This is useful when you need to calibrate it.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;HumiditySenrorParam &lt;/span&gt;MyHumidityStruc = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;HumiditySenrorParam&lt;/span&gt;();
MyHumidityStruc.MinValue = 0;
MyHumidityStruc.MaxValue = 1023;
MyHumidityStruc.DeclValue = 500;
MyHumidityStruc.UpdateTime = 60;
&lt;/pre&gt;

&lt;pre class="code"&gt;Sprinklers[0].HumiditySensor = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;HumiditySensor&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Pins&lt;/span&gt;.GPIO_PIN_A0, MyHumidityStruc);
&lt;/pre&gt;

&lt;p&gt;Nothing complex in this initialization phase. I’ve already explained in previous posts the Sprinkler class. I just added a HumiditySensor member. So I can have 1 humidity sensor per sprinkling zone. Looking at how it’s working in the industry. And I want to be flexible. So I can have a humidity sensor wherever I want. I’m using a parameter file which I read and interpret at boot time.&lt;/p&gt;

&lt;p&gt;The final result looks like this with 1 humidity sensor:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8831.image_5F00_2.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2260.image_5F00_thumb.png" width="332" height="306" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the code to build the page is easy:&lt;/p&gt;

&lt;pre class="code"&gt;strResp = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;netduino sprinkler&amp;lt;p&amp;gt;&amp;quot;&lt;/span&gt;;
&lt;span style="color: green;"&gt;// need to test!
&lt;/span&gt;strResp = &lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.OutPutStream(response, strResp);
&lt;span style="color: blue;"&gt;for &lt;/span&gt;(&lt;span style="color: blue;"&gt;int &lt;/span&gt;i = 0; i &amp;lt; NUMBER_SPRINKLERS; i++)
{
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Springler &amp;quot; &lt;/span&gt;+ Sprinklers[i].Name + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;: &amp;lt;a href='/&amp;quot; &lt;br /&gt;&lt;/span&gt;+ paramPageSprinkler + ParamStart + securityKey + ParamSeparator &lt;br /&gt;+ paramSpr + i + ParamEqual + !Sprinklers[i].Open + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;'&amp;gt;&amp;quot; &lt;br /&gt;&lt;/span&gt;+ Sprinklers[i].Open + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;a href='/&amp;quot; &lt;/span&gt;+ paramPageCalendar + ParamStart &lt;br /&gt;+ securityKey + ParamSeparator + paramYear + ParamEqual + &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;.Now.Year &lt;br /&gt;+ ParamSeparator + paramMonth + ParamEqual + &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;.Now.Month &lt;br /&gt;+ ParamSeparator + paramSpr + ParamEqual + i + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;'&amp;gt;Program Sprinkler &amp;quot; &lt;br /&gt;&lt;/span&gt;+ Sprinklers[i].Name + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;a href='/&amp;quot; &lt;/span&gt;+ paramPageListPrgm + ParamStart &lt;br /&gt;+ securityKey + ParamSeparator + paramSpr + ParamEqual + i &lt;br /&gt;+ &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;'&amp;gt;List all programs for Sprinkler &amp;quot; &lt;/span&gt;+ Sprinklers[i].Name + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(Sprinklers[i].HumiditySensor != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
    {
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Humidity: &amp;quot; &lt;/span&gt;+ Sprinklers[i].HumiditySensor.Humidity;
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(Sprinklers[i].HumiditySensor.IsHumid)
            strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot; and it is humid&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;
        &lt;span style="color: blue;"&gt;else
            &lt;/span&gt;strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot; and it is time to sprinkle!&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;
    }
    strResp = &lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.OutPutStream(response, strResp);
}
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;p&amp;gt;&amp;lt;a href='/&amp;quot; &lt;/span&gt;+ paramPageUtil + ParamStart &lt;br /&gt;+ securityKey + ParamSeparator + paramClk + ParamEqual &lt;br /&gt;+ &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;1'&amp;gt;Update date and time&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;p&amp;gt;&amp;lt;a href='/&amp;quot; &lt;/span&gt;+ paramPageUtil + ParamStart &lt;br /&gt;+ securityKey + ParamSeparator + paramReboot + ParamEqual &lt;br /&gt;+ &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;1'&amp;gt;Reboot&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;.Now.ToString();
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&amp;quot;&lt;/span&gt;;
strResp = &lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.OutPutStream(response, strResp);

&lt;/pre&gt;

&lt;p&gt;ParamStart = ‘?’, ParamSeparator = ‘&amp;amp;’, ParamEqual = ‘=’, the various paramPage are the name of the page (like “spr.aspx” for paramPageSprinkler). It is mainly about building and URL like spr.aspx?sec=seckey&amp;amp;spr0=True&lt;/p&gt;

&lt;p&gt;I display only the information regarding a humidity sensor if one has been setup. If not, I don’t display anything. And as you can see, it is really simple, the Humidity property return the humidity in percentage. and IsHumid allow to check if it is dry or humid so if it time to sprinkle or not &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1172.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;

&lt;p&gt;You’ve read this blog post up to this point. So I’m sure you still have energy! I’ve build a page to be able to update the various parameters. The page look like this with one humidity sensor. With multiple humidity sensor, it will just display more forms on the same page:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8424.image_5F00_4.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8037.image_5F00_thumb_5F00_1.png" width="328" height="262" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When updates, the result is the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2063.image_5F00_6.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6864.image_5F00_thumb_5F00_2.png" width="328" height="197" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My code allow also to get this information without and UI, just with the data. It allow also to just change one sensor and not all. I will not show all the code, I will just explain the core part with the forms:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;for &lt;/span&gt;(&lt;span style="color: blue;"&gt;int &lt;/span&gt;i = 0; i &amp;lt; NUMBER_SPRINKLERS; i++)
    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(Sprinklers[i].HumiditySensor != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
    {
        &lt;span style="color: green;"&gt;//display a form with all params to be modified
        &lt;/span&gt;strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;form method=\&amp;quot;get\&amp;quot; action=\&amp;quot;&amp;quot; &lt;br /&gt;&lt;/span&gt;+ paramPageHumidity + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot;&amp;gt;&amp;lt;p&amp;gt;Humidity sensor &amp;quot; &lt;br /&gt;&lt;/span&gt;+ Sprinklers[i].Name;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;br /&amp;gt;Humidity = &amp;quot; &lt;br /&gt;&lt;/span&gt;+ Sprinklers[i].HumiditySensor.Humidity + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot; and is Humid = &amp;quot; &lt;br /&gt;&lt;/span&gt;+ Sprinklers[i].HumiditySensor.IsHumid + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Min = &amp;lt;input type=\&amp;quot;text\&amp;quot; name=\&amp;quot;&amp;quot;&lt;br /&gt;&lt;/span&gt;+ paramHumidityMinValue +&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; value=\&amp;quot;&amp;quot; &lt;/span&gt;+ Sprinklers[i].HumiditySensor.MinValue &lt;br /&gt;+ &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Max = &amp;lt;input type=\&amp;quot;text\&amp;quot; name=\&amp;quot;&amp;quot;&lt;br /&gt;&lt;/span&gt;+ paramHumidityMaxValue +&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; value=\&amp;quot;&amp;quot; &lt;/span&gt;+ Sprinklers[i].HumiditySensor.MaxValue &lt;br /&gt;+ &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Decl = &amp;lt;input type=\&amp;quot;text\&amp;quot; name=\&amp;quot;&amp;quot;&lt;br /&gt;&lt;/span&gt;+ paramHumidityDeclValue +&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; value=\&amp;quot;&amp;quot; &lt;/span&gt;+ Sprinklers[i].HumiditySensor.DeclValue &lt;br /&gt;+ &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Time update (sec) = &amp;lt;input type=\&amp;quot;text\&amp;quot; name=\&amp;quot;&amp;quot;&lt;br /&gt;&lt;/span&gt;+ paramHumidityTimeUpdate +&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; value=\&amp;quot;&amp;quot; &lt;br /&gt;&lt;/span&gt;+ Sprinklers[i].HumiditySensor.UpdateTime + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;&amp;lt;input id=\&amp;quot;Submit\&amp;quot; type=\&amp;quot;submit\&amp;quot; value=\&amp;quot;Update\&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;input type=\&amp;quot;hidden\&amp;quot; name=\&amp;quot;&amp;quot; &lt;br /&gt;&lt;/span&gt;+ paramSpr + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; value=\&amp;quot;&amp;quot; &lt;/span&gt;+ i + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;input type=\&amp;quot;hidden\&amp;quot; name=\&amp;quot;&amp;quot; &lt;br /&gt;&lt;/span&gt;+ paramSecurityKey + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot; value=\&amp;quot;&amp;quot; &lt;/span&gt;+ MySecurityKey + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\&amp;quot;&amp;gt;&amp;lt;/form&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;;
        strResp = &lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.OutPutStream(response, strResp);
    }
&lt;/pre&gt;

&lt;p&gt;Nothing really complicated here, it’s just building a HTML page by hands &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1172.wlEmoticon_2D00_smile_5F00_2.png" /&gt; The form will be posted with the GET method. So all parameters will be passed thru the URL. I’ve used this method for all the development I’ve done and you’ll find examples in my previous posts. Including the web server itself.&lt;/p&gt;

&lt;p&gt;So enjoy this humidity sensor &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1172.wlEmoticon_2D00_smile_5F00_2.png" /&gt; And I hope the weather will get dryer in Paris this summer so I’ll be able to calibrate it correctly, find the right level Under which it is interesting to sprinkle. And of course, next step is to automate all this! And let the system manage itself based on the soil humidity. And I will add other sensors like temperature! Stay tune &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1172.wlEmoticon_2D00_smile_5F00_2.png" /&gt; and feedback welcome as usual. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10330920" width="1" height="1"&gt;</description></item><item><title>A low cost humidity sensor for my sprinkler system</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/06/24/a-low-cost-humidity-sensor-for-my-sprinkler-system.aspx</link><pubDate>Sun, 24 Jun 2012 15:23:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10323326</guid><dc:creator>Laurelle</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10323326</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/06/24/a-low-cost-humidity-sensor-for-my-sprinkler-system.aspx#comments</comments><description>&lt;p&gt;I’ve &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/07/managing-my-sprinklers-from-the-cloud.aspx"&gt;developed my own sprinkler system&lt;/a&gt; which embed a web server and allow me to control it remotely where ever I am. I can program when and how long I will sprinkler on which circuit. I have 3 circuits but my system can work with a large number of circuits.&lt;/p&gt;  &lt;p&gt;What I want to do is to be able to add intelligence into my netduino board. This .NET Microframework (NETMF) board runs without any OS. So now Windows, no Linux, no Mac, nothing! Directly .NET on the chip. Not a full .NET of course but all what is necessary to be able to &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/02/17/using-basic-io-with-net-microframework.aspx"&gt;pilot IO&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/29/creating-an-efficient-http-web-server-for-net-microframework-netmf.aspx"&gt;have a web server&lt;/a&gt;, etc. All this in an embedded board smallest of the size of a credit card. &lt;/p&gt;  &lt;p&gt;Part of my project is to be able to measure the soil humidity. So I’ve decided to develop my own sensor. The basic idea is to measure the conductivity (or resistor) of the soil. Any object/material has it’s own resistance. The more conductive it is, the smallest the resistor is and the less conductive, the higher the resistor is. And it does apply to anything. Metals are usually excellent resistors with a very low resistance of less than 1 Ω. And something like a plastic will have more than 1 MΩ resistor. So if you apply a huge voltage, you’ll get a very small current.&lt;/p&gt;  &lt;p&gt;The rule you have to know to do some electronic is U = R x I where U is the voltage (tension in volt V), R is the resistor (in ohm Ω) and I is the intensity of the current (in ampere, A). So I will measure the resistor 'of the soil and I will determine if it is dry or humid.&lt;/p&gt;  &lt;p&gt;Let start wit a bit of theory there regarding soil conductivity. It is possible to measure the soil conductivity with a &lt;a href="http://en.wikipedia.org/wiki/Tellurometer"&gt;Tellurometer&lt;/a&gt;. Soil conductivity is measured by this specific sensor and the resistance of the soil is determined. In my case what will interest me is to be able to measure the difference of conductivity between a humid and a dry soil at the same place. It just need to have 2 stick of copper or any other metal put into the soil and have a current going thru one stick and measuring the difference of voltage from the other.&lt;/p&gt;  &lt;p&gt;When a soil is humid the resistor decrease and when it is dry, it does increase. So imagine I will build something like a voltmeter put into the soil and I will measure the resistance. As my netduino has an analogic input I will use it for this purpose. What I measure here, is a voltage so indirectly this variance or resistance. As per the &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/02/17/using-basic-io-with-net-microframework.aspx"&gt;light sensor&lt;/a&gt;, I’ll use the same principle:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5518.image_5F00_6.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7652.image_5F00_thumb_5F00_2.png" width="283" height="396" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So I will measure the voltage of R3. R3 is a high value of 10K to do a pull down. It is a high resistor which will create a small current between the ground and A0. If I don’t put any resistor,I won’t be able to measure any intensity. And if I place A0 on the ogher side of my sensor and remove R3, I will use more current than in this design. It is possible to do the same as for the light sensor but in my case it will be a bit less efficient I guess.&lt;/p&gt;  &lt;p&gt;R1 is here to reduce a bit the current and I will have to adjust this value regarding of my current soil.&lt;/p&gt;  &lt;p&gt;The code is extremely simple:&lt;/p&gt;  &lt;pre class="code"&gt;SecretLabs.NETMF.Hardware.&lt;span style="color: rgb(43, 145, 175);"&gt;AnalogInput &lt;/span&gt;SoilSensor =&lt;br /&gt; &lt;span style="color: blue;"&gt;new &lt;/span&gt;SecretLabs.NETMF.Hardware.&lt;span style="color: rgb(43, 145, 175);"&gt;AnalogInput&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Pins&lt;/span&gt;.GPIO_PIN_A0);
&lt;span style="color: green;"&gt;//lightSensor.SetRange(0, 100);

&lt;/span&gt;&lt;span style="color: blue;"&gt;int &lt;/span&gt;lSoilSensorReading = 0;
&lt;span style="color: blue;"&gt;while &lt;/span&gt;(&lt;span style="color: blue;"&gt;true&lt;/span&gt;)
{
    SoilSensorReading = SoilSensor.Read();
    &lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(SoilSensorReading.ToString());
    &lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;.Sleep(500);
}
&lt;/pre&gt;

&lt;p&gt;I create an analogic input on port A0. And then I read the value every 500 milliseconds. And that’s it!&lt;/p&gt;

&lt;p&gt;I’ve done the test with real soil, one is very humid, one a bit humid and one is very dry.&lt;/p&gt;

&lt;p&gt;I get the following results:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;very humid = 650&lt;/li&gt;

  &lt;li&gt;a bit humid = 630&lt;/li&gt;

  &lt;li&gt;very dry = 550&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And here is the picture of the prototype:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2860.WP_5F00_000792_5F00_2.jpg"&gt;&lt;img title="WP_000792" style="display: inline; background-image: none;" border="0" alt="WP_000792" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4604.WP_5F00_000792_5F00_thumb.jpg" width="514" height="387" /&gt;&amp;#160;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the analogic port has 1024 values going from 0 to 1023 on 3.3V, I have an amplitude of 100 values which represent a variance of approximately 0.32V.&lt;/p&gt;

&lt;p&gt;So with this prototype I have a difference of 0.32V between dry and very humid with this specific soil.&lt;/p&gt;

&lt;p&gt;I’m sure I can change a bit the sensitivity to use a broader range of the analogic input. I can do like for the light sensor an remove the R3 resistor and measure directly the tension between the sensor and the ground. I can also change R1 to a value close to the middle of the resistance of the soil. I can also change the alimentation value to 5V or so. &lt;/p&gt;

&lt;p&gt;That was just a first experiment! Just to prove it is working &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4101.wlEmoticon_2D00_smile_5F00_2.png" /&gt; Now, I need to improve a bit the system and see how far I can go. Any feedback from an electronic guy welcome.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10323326" width="1" height="1"&gt;</description></item><item><title>Using XMLHttpRequest to pilot a Lego train dynamically in HTML 5</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/06/20/using-xmlhttprequest-to-pilot-a-lego-train-dynamically-in-html-5.aspx</link><pubDate>Wed, 20 Jun 2012 20:51:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10322348</guid><dc:creator>Laurelle</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10322348</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/06/20/using-xmlhttprequest-to-pilot-a-lego-train-dynamically-in-html-5.aspx#comments</comments><description>&lt;p&gt;It’s a long time I did not write a blog post. I was very busy and had no time to write and code anything in the last weeks. I still have a lot of work but I need an intellectual break for the evening. So I do not write this post from a plane but from an hotel room. In my past &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/04/26/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-3.aspx"&gt;blog posts&lt;/a&gt; I’ve explained how to pilot any Lego Power System with a &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/09/netduino-board-geek-tool-for-net-microframework.aspx"&gt;Netduino&lt;/a&gt; using .NET Microframework. &lt;/p&gt;  &lt;p&gt;In the &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/29/creating-an-efficient-http-web-server-for-net-microframework-netmf.aspx"&gt;HTTP Web server I’ve implemented&lt;/a&gt;, I command the train thru a URL with arguments. Those arguments are transformed into parameters which are given to a class. This class output a wave form into an infrared led amplified by a transistor. This is a simple and efficient way to command anything. I do the same for &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/05/07/managing-my-sprinklers-from-the-cloud.aspx"&gt;my sprinkler system&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Now if you want to pilot in a web interface multiple trains, and click on buttons or pictures to get an action without opening a new web page or refreshing the page, you need to do some Scripting in your HTML page. I’m not a web developer, I don’t like Scripting languages as they are not strict enough to write correct code and imply too many errors. They drastically increase your development time! I truly prefer a good language like C#, VB or even Java and I can go up to C/C++ &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8030.wlEmoticon_2D00_smile_5F00_2.png" /&gt; Now, if I want to avoid any problem, I can jump into Eiffel &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8030.wlEmoticon_2D00_smile_5F00_2.png" /&gt; OK, I won’t go up to there, I’ll stay with java script in an HTML5 page.&lt;/p&gt;  &lt;p&gt;What I want is to call my command page in the background of the page and stay in the HTML page when I click on a button. There is a nice object in HTML which allow you to do that which is XMLHttpRequest. It is implemented in all decent browsers.&lt;/p&gt;  &lt;p&gt;Here is the code that I generate dynamically (I’ll show you the code later) and I’ll explain you how it works:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;html &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;head&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;head&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;body&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;SCRIPT &lt;/span&gt;&lt;span style="color: red;"&gt;language&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;JavaScript&amp;quot;&amp;gt;
var &lt;/span&gt;xhr = &lt;span style="color: blue;"&gt;new &lt;/span&gt;XMLHttpRequest();
&lt;span style="color: blue;"&gt;function &lt;/span&gt;btnclicked(boxMSG, cmdSend) {
    boxMSG.innerHTML = &lt;span style="color: maroon;"&gt;&amp;quot;Waiting&amp;quot;&lt;/span&gt;;
    xhr.open(&lt;span style="color: maroon;"&gt;'GET'&lt;/span&gt;, &lt;span style="color: maroon;"&gt;'singlepwm.aspx?' &lt;/span&gt;+ cmdSend + &lt;span style="color: maroon;"&gt;'&amp;amp;sec='&lt;/span&gt;);
    xhr.send(&lt;span style="color: blue;"&gt;null&lt;/span&gt;);
    xhr.onreadystatechange = &lt;span style="color: blue;"&gt;function &lt;/span&gt;() {
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(xhr.readyState == 4)
        { boxMSG.innerHTML = xhr.responseText; } 
};
}
&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;SCRIPT&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;TABLE &lt;/span&gt;&lt;span style="color: red;"&gt;BORDER&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;TR&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;FORM&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Super train&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;INPUT &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;button&amp;quot; 
&lt;/span&gt;&lt;span style="color: red;"&gt;onClick&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;btnclicked(document.getElementById('train0'),
'pw=11&amp;amp;op=0&amp;amp;ch=254')&amp;quot; 
&lt;/span&gt;&lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;&amp;lt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;INPUT &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;button&amp;quot; 
&lt;/span&gt;&lt;span style="color: red;"&gt;onClick&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;btnclicked(document.getElementById('train0'),
'pw=8&amp;amp;op=0&amp;amp;ch=254')&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;Stop&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;INPUT &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;button&amp;quot; 
&lt;/span&gt;&lt;span style="color: red;"&gt;onClick&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;btnclicked(document.getElementById('train0'),
'pw=5&amp;amp;op=0&amp;amp;ch=254')&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;&amp;gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;span &lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;='train0'&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;FORM&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;TD&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;TR&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;

&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;In the script part of the page, I have created a simple script. Those lines of code is what is necessary to do a synchronous call of an HTTP page and display the result in the page. &lt;/p&gt;

&lt;p&gt;I create an XMLHttpRequest object which I call xhr. The function call btnclicked takes 2 arguments. the first one is the element of the page I will put the results of the request. And the second one is the command (the parameters) to pass to the URL which will pilot the infrared led as explain previously.&lt;/p&gt;

&lt;p&gt;The function is very simple. First, I put “Waiting” in the element. Then I open the XMLHttpRequest object. I open it with GET and pass the overall URL.&lt;/p&gt;

&lt;p&gt;The request is done when the send function is called. It is a synchronous call, so it get to the onreadystatechange when it is finished. &lt;/p&gt;

&lt;p&gt;Here, when you read the documentation, the readyState 4 mean that everything went well and you have your data back. My function return “OK” when everything is OK and “Problem” if there is a problem.&lt;/p&gt;

&lt;p&gt;Now let have a look at the rest of the HTML page. I decided to create a form with button input. Each button input has a onClick event. This event can be linked to a script. So I will call the fucntion describe before and give a span element (here train0) and the URL. The URL is different depending if you want to train to go forward, backward or stop. And I put all this in a nice table top be able to have multiple trains.&lt;/p&gt;

&lt;p&gt;The page with 4 trains looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5807.image_5F00_2.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7360.image_5F00_thumb.png" width="371" height="282" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve clicked on the forward button, “Wainting” is displayed in span. And as soon as the command will finish, it will either display OK or Problem. In my case, Problem will be displayed as in the Emulator, there is no SPI port!&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: green;"&gt;// Start HTML document
&lt;/span&gt;strResp = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;!DOCTYPE html PUBLIC \&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN\&amp;quot;&lt;br /&gt; \&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;html xmlns=\&amp;quot;http://www.w3.org/1999/xhtml\&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;quot;&lt;/span&gt;;
&lt;span style="color: green;"&gt;//creat the script part
&lt;/span&gt;strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;SCRIPT language=\&amp;quot;JavaScript\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;var xhr = new XMLHttpRequest(); function btnclicked(boxMSG, cmdSend) &lt;br /&gt;{ boxMSG.innerHTML=\&amp;quot;Waiting\&amp;quot;;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;xhr.open('GET', 'singlepwm.aspx?' + cmdSend + '&amp;amp;&amp;quot; &lt;/span&gt;+ securityKey + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;');&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;xhr.send(null); xhr.onreadystatechange = function() &lt;br /&gt;{if (xhr.readyState == 4) {boxMSG.innerHTML=xhr.responseText;}};}&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/SCRIPT&amp;gt;&amp;quot;&lt;/span&gt;;
strResp = &lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.OutPutStream(response, strResp);
&lt;span style="color: green;"&gt;// Create one section for each train
&lt;/span&gt;strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;TABLE BORDER=\&amp;quot;0\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;
&lt;span style="color: blue;"&gt;for &lt;/span&gt;(&lt;span style="color: blue;"&gt;byte &lt;/span&gt;i = 0; i &amp;lt; myParamRail.NumberOfTrains; i++)
{
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;&amp;lt;FORM&amp;gt;&amp;quot; &lt;/span&gt;+ myParamRail.Trains[i].TrainName + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/TD&amp;gt;&lt;br /&gt;&amp;lt;TD&amp;gt;&amp;lt;INPUT type=\&amp;quot;button\&amp;quot; &lt;br /&gt;onClick=\&amp;quot;btnclicked(document.getElementById('train&amp;quot; &lt;/span&gt;+ i + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;')&lt;br /&gt;,'pw=&amp;quot; &lt;/span&gt;+ (16 - myParamRail.Trains[i].Speed);
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;amp;op=&amp;quot;&lt;/span&gt;+ myParamRail.Trains[i].RedBlue + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;amp;ch=&amp;quot; &lt;/span&gt;+ &lt;br /&gt;(myParamRail.Trains[i].Channel - 1) + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;')\&amp;quot; value=\&amp;quot;&amp;lt;\&amp;quot;&amp;gt;&amp;lt;/TD&amp;gt;&amp;quot;&lt;/span&gt;;
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;TD&amp;gt;&amp;lt;INPUT type=\&amp;quot;button\&amp;quot; &lt;br /&gt;onClick=\&amp;quot;btnclicked(document.getElementById('train&amp;quot; &lt;/span&gt;+ i + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;'),'pw=8&amp;quot;&lt;/span&gt;;
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;amp;op=&amp;quot; &lt;/span&gt;+ myParamRail.Trains[i].RedBlue + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;amp;ch=&amp;quot; &lt;/span&gt;+ &lt;br /&gt;(myParamRail.Trains[i].Channel - 1) + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;')\&amp;quot; value=\&amp;quot;Stop\&amp;quot;&amp;gt;&amp;lt;/TD&amp;gt;&amp;quot;&lt;/span&gt;;
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;TD&amp;gt;&amp;lt;INPUT type=\&amp;quot;button\&amp;quot; &lt;br /&gt;onClick=\&amp;quot;btnclicked(document.getElementById('train&amp;quot; &lt;/span&gt;+ i + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;'),&lt;br /&gt;'pw=&amp;quot; &lt;/span&gt;+ myParamRail.Trains[i].Speed;
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;amp;op=&amp;quot; &lt;/span&gt;+ myParamRail.Trains[i].RedBlue + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;amp;ch=&amp;quot; &lt;/span&gt;+ &lt;br /&gt;(myParamRail.Trains[i].Channel - 1) + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;')\&amp;quot; value=\&amp;quot;&amp;gt;\&amp;quot;&amp;gt;&amp;lt;/TD&amp;gt;&amp;quot;&lt;/span&gt;;
    strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;TD&amp;gt;&amp;lt;span id='train&amp;quot; &lt;/span&gt;+ i + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;'&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/FORM&amp;gt;&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&amp;quot;&lt;/span&gt;; 
    strResp = &lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.OutPutStream(response, strResp);
}
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/TABLE&amp;gt;&amp;lt;br&amp;gt;&amp;lt;a href='all.aspx?&amp;quot; &lt;/span&gt;+ securityKey + &lt;br /&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;'&amp;gt;Display all page&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;/span&gt;;
strResp = &lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.OutPutStream(response, strResp);
&lt;/pre&gt;

&lt;p&gt;The code to generate the HMTL page is here. As you see it is manually generated. The table which contains the name of the train, the backward, stop and forward button is created totally dynamically. Each train may have a different speed and use different channels so the URL is generated dynamically. &lt;/p&gt;

&lt;p&gt;All this takes time to generate and to output in the Stream. So it’s much better to do it only 1 time and then call a simple and small function which will return just a bit of text.&lt;/p&gt;

&lt;p&gt;Last part, on the server header, you have to make sure you add “Cache-Control: no-cache” in the response header. If you don’t do it, only the first request will be send to the netduino board back. XMLHttpRequest will consider that the page will never expire. So I’ve modified the header code of my HTTP Server like this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;string &lt;/span&gt;header = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;HTTP/1.1 200 OK\r\nContent-Type: text/html; &lt;br /&gt;charset=utf-8\r\nCache-Control: no-cache\r\nConnection: &lt;br /&gt;close\r\n\r\n&amp;quot;&lt;/span&gt;;
connection.Send(&lt;span style="color: rgb(43, 145, 175);"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(header), header.Length, &lt;br /&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SocketFlags&lt;/span&gt;.None);

&lt;/pre&gt;

&lt;p&gt;What is interesting there is that I can now pilot up to 8 Lego trains using this very simple interface and without having to refresh the page.&lt;/p&gt;

&lt;p&gt;And the excellent news is that it is working from my Windows Phone so it’s even cool to pilot your Lego train from your Windows Phone. I haven’t tested from an Android or iPhone but I’m quite sure it will work the same way. Remember that all the code is sitting in a very small hardware with no OS, just .NET Microframework! As always, do not hesitate to send me your comments &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8030.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10322348" width="1" height="1"&gt;</description></item><item><title>Creating an efficient HTTP Web Server for .NET Microframework (NETMF)</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/05/29/creating-an-efficient-http-web-server-for-net-microframework-netmf.aspx</link><pubDate>Tue, 29 May 2012 16:36:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10311391</guid><dc:creator>Laurelle</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10311391</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/05/29/creating-an-efficient-http-web-server-for-net-microframework-netmf.aspx#comments</comments><description>&lt;p&gt;That’s not the first post I’m doing on incorporating a Web Server in .NET Microframework (NETMF). In some of &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/12/07/creating-dynamically-a-web-page-using-net-micro-framework.aspx"&gt;my previous posts&lt;/a&gt;, I’ve explain how to do it using the existing .NET classes for this. And it is working very well!&lt;/p&gt;  &lt;p&gt;The main concerns I have is that I’m using a &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/09/netduino-board-geek-tool-for-net-microframework.aspx"&gt;netduino&lt;/a&gt; board. This board is great, I love it. But there is a very limited amount of memory available and limited amount of space to store the programs. Total storage is 64Kb and what is left when the code is in is about 48K… So very little amount of memory. And the http .NET classes are great and use stream but they are intense in terms of memory and also the main http class is huge… &lt;/p&gt;  &lt;p&gt;So I had to find a solution and it was to redevelop a web server like IIS or Apache. OK, I can’t compare &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6862.wlEmoticon_2D00_smile_5F00_2.png"&gt; I just want a web server which handle GET answers and respond a simple web page. The other challenge I have is to be able to reuse the code I4ve already written for my Sprinkler, to pilot my Lego city and my Lego infrared receiver like my Lego trains…&lt;/p&gt;  &lt;p&gt;So I was searching for code to reuse on the Internet and found some code. So I did a mix of existing code and spend some time testing various solutions &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6862.wlEmoticon_2D00_smile_5F00_2.png"&gt; Most of the existing code is not really robust. It does fail if there is a network problem, if 2 requests arrive at the same time, etc. I’m not saying my code is perfect but it is working and working well for the last month with no problem at all.&lt;/p&gt;  &lt;p&gt;A web server is simple, it’s just a connection on a socket and a protocol of communication which is HTTP. It is also very simple as it is text based. What is interesting is to see all what you can do with such a simple protocol and such a simple markup language like HTML and some javascript.&lt;/p&gt;  &lt;p&gt;OK, so let start with what is necessary: a thread that will run all the time and handle socket requests. So we need also a socket. And a way to stop the thread.&lt;/p&gt;  &lt;pre class="code"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private bool &lt;/span&gt;cancel = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;
&lt;span style="color: blue;"&gt;private &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Thread &lt;/span&gt;serverThread = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;
&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public &lt;/span&gt;WebServer(&lt;span style="color: blue;"&gt;int &lt;/span&gt;port, &lt;span style="color: blue;"&gt;int &lt;/span&gt;timeout)
{
    &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Timeout = timeout;
    &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Port = port;
    &lt;span style="color: blue;"&gt;this&lt;/span&gt;.serverThread = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;(StartServer);
    &lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;"Web server started on port " &lt;/span&gt;+ port.ToString());
}
&lt;/pre&gt;&lt;p&gt;As you can see, it is quite simple, the WebServer object is initialize with a specific port and a timeout. By default, the http port is 80 but it can be anything. There is no limitation. And as it’s easy to implement, let make the code generic enough to be able to be use with different ports. And a new Thread is created to point on function StartServer. I will detail it later. I will explain also why we need a timeout later.&lt;/p&gt;

&lt;p&gt;Now we have this object initialize, let start the Webserver:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public bool &lt;/span&gt;Start()
{
    &lt;span style="color: blue;"&gt;bool &lt;/span&gt;bStarted = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;
    &lt;span style="color: green;"&gt;// start server           
    &lt;/span&gt;&lt;span style="color: blue;"&gt;try
    &lt;/span&gt;{
        cancel = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;
        serverThread.Start();
        &lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;"Started server in thread " &lt;/span&gt;+ serverThread.GetHashCode().ToString());
    }
    &lt;span style="color: blue;"&gt;catch
    &lt;/span&gt;{   &lt;span style="color: green;"&gt;//if there is a problem, maybe due to the fact we did not wait engouth
        &lt;/span&gt;cancel = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;
        bStarted = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;
    }
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;bStarted;
}
&lt;/pre&gt;&lt;pre class="code"&gt;&lt;/pre&gt;

&lt;p&gt;That is where the fun being! We start listening and initialize a variable we will use later to stop the server if needed. The catch can contain something to retry to start, here, it just return if it is started or not. At this stage, it should work with no problem as it is only a thread starting. But who knows &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6862.wlEmoticon_2D00_smile_5F00_2.png"&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;StartServer()
{
    &lt;span style="color: blue;"&gt;using &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Socket &lt;/span&gt;server = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Socket&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;AddressFamily&lt;/span&gt;.InterNetwork, &lt;span style="color: rgb(43, 145, 175);"&gt;SocketType&lt;/span&gt;.Stream, &lt;span style="color: rgb(43, 145, 175);"&gt;ProtocolType&lt;/span&gt;.Tcp))
    {
        &lt;span style="color: green;"&gt;//set a receive Timeout to avoid too long connection 
        &lt;/span&gt;server.ReceiveTimeout = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Timeout;
        server.Bind(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IPEndPoint&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;IPAddress&lt;/span&gt;.Any, &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Port));
        server.Listen(&lt;span style="color: blue;"&gt;int&lt;/span&gt;.MaxValue);
        &lt;span style="color: blue;"&gt;while &lt;/span&gt;(!cancel)
        {
            &lt;span style="color: blue;"&gt;try
            &lt;/span&gt;{

                &lt;span style="color: blue;"&gt;using &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Socket &lt;/span&gt;connection = server.Accept())
                {
                    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(connection.Poll(-1, &lt;span style="color: rgb(43, 145, 175);"&gt;SelectMode&lt;/span&gt;.SelectRead))
                    {
                        &lt;span style="color: green;"&gt;// Create buffer and receive raw bytes.
                        &lt;/span&gt;&lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] bytes = &lt;span style="color: blue;"&gt;new byte&lt;/span&gt;[connection.Available];
                        &lt;span style="color: blue;"&gt;int &lt;/span&gt;count = connection.Receive(bytes);
                        &lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;"Request received from " &lt;br&gt;&lt;/span&gt;+ connection.RemoteEndPoint.ToString() + &lt;span style="color: rgb(163, 21, 21);"&gt;" at " &lt;/span&gt;+ &lt;span style="color: rgb(43, 145, 175);"&gt;DateTime&lt;/span&gt;.Now.ToString(&lt;span style="color: rgb(163, 21, 21);"&gt;"dd MMM yyyy HH:mm:ss"&lt;/span&gt;));
                        &lt;span style="color: green;"&gt;//stup some time for send timeout as 10s.
                        //necessary to avoid any problem when multiple requests are done the same time.
                        &lt;/span&gt;connection.SendTimeout = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Timeout; ;
                        &lt;span style="color: green;"&gt;// Convert to string, will include HTTP headers.
                        &lt;/span&gt;&lt;span style="color: blue;"&gt;string &lt;/span&gt;rawData = &lt;span style="color: blue;"&gt;new string&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Encoding&lt;/span&gt;.UTF8.GetChars(bytes));
                        &lt;span style="color: blue;"&gt;string &lt;/span&gt;mURI;

                        &lt;span style="color: green;"&gt;// Remove GET + Space
                        // pull out uri and remove the first /
                        &lt;/span&gt;&lt;span style="color: blue;"&gt;if &lt;/span&gt;(rawData.Length &amp;gt; 5)
                        {
                            &lt;span style="color: blue;"&gt;int &lt;/span&gt;uriStart = rawData.IndexOf(&lt;span style="color: rgb(163, 21, 21);"&gt;' '&lt;/span&gt;) + 2;
                            mURI = rawData.Substring(uriStart, rawData.IndexOf(&lt;span style="color: rgb(163, 21, 21);"&gt;' '&lt;/span&gt;, uriStart) - uriStart);
                        }
                        &lt;span style="color: blue;"&gt;else
                            &lt;/span&gt;mURI = &lt;span style="color: rgb(163, 21, 21);"&gt;""&lt;/span&gt;;
                        &lt;span style="color: green;"&gt;// return a simple header
                        &lt;/span&gt;&lt;span style="color: blue;"&gt;string &lt;/span&gt;header = &lt;span style="color: rgb(163, 21, 21);"&gt;"HTTP/1.1 200 OK\r\nContent-Type: text/html&lt;br&gt;; charset=utf-8\r\nConnection: close\r\n\r\n"&lt;/span&gt;;
                        connection.Send(&lt;span style="color: rgb(43, 145, 175);"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(header), header.Length, &lt;span style="color: rgb(43, 145, 175);"&gt;SocketFlags&lt;/span&gt;.None);
                        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(CommandReceived != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
                            CommandReceived(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;WebServerEventArgs&lt;/span&gt;(connection, mURI));
                    }
                }
            }
            &lt;span style="color: blue;"&gt;catch &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Exception &lt;/span&gt;e)
            {
                &lt;span style="color: green;"&gt;//this may be due to a bad IP address
                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(e.Message);
            }
        }
    }
}
&lt;/pre&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;This function will run all the time in a thread. It’s in an infinite loop which can be break by the cancel variable. First, we need to initialize the Socket. We will use IPv4 with a stream and the TCP protocol. No timeout to receive the request. The, you’ll have to bind this socket to a physical IP address. In our case, we will use all IP address on the port initialized before. Any IP address mean all addresses and in our case only 1 IP address as we do have only 1 Ethernet interface.  We are using '”using” to make sure the server Socket will be closed and cleaned properly after usage.&lt;/p&gt;&lt;p&gt;The way it is working is not too complicated. Remember that we’ve open a Socket named Server, setup it to listen to port 80. This is running in a separate thread in this thread. So in order to analyze the information returned when a connection is accepted (so when a Browser ask for a page), we need to create another Socket pointing to the same Socket, here “using (Socket connection = server.Accept())”. In this case “using” allow the code to clean in the “proper way” when the thread will be finished or then the loop end or when it goes back to the initial loop. It’s thread in thread and if you don’t close things correctly, it can quickly let lots of objects in the memory, objects which will be seen as alive by the garbage collector.&lt;/p&gt;

&lt;p&gt;When there are bytes ready to read with connection.Poll, we just read them. The request is transformed into a string. An http request look like “GET /folder/name.ext?param1=foo&amp;amp;param2=bar HTTP/1.1”. Areal life example looks more like this: "GET /folder/name.ext?param1=foo&amp;amp;param2=bar HTTP/1.1\r\nAccept: text/html, application/xhtml+xml, */*\r\nAccept-Language: fr-FR,fr;q=0.8,en-US;q=0.5,en;q=0.3\r\nUser-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)\r\nAccept-Encoding: gzip, deflate, peerdist\r\nHost: localhost:81\r\nConnection: Keep-Alive\r\nX-P2P-PeerDist: Version=1.1\r\nX-P2P-PeerDistEx: MinContentInformation=1.0, MaxContentInformation=1.0\r\n\r\n"&lt;/p&gt;

&lt;p&gt;For a normal, full web server like IIS or Apache, you’ll analyze all those parameters, and there are lots, see the W3C protocol &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"&gt;here&lt;/a&gt;. For our usage, the only thing that interest us is the full URL. And it is located between the 2 first spaces. And we will extract the URL, remove the first ‘/’ as I will not use it in the rest of the code.&lt;/p&gt;

&lt;p&gt;Now, the next step is to start answering the request. When someone ask you something, it’s polite to answer &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6862.wlEmoticon_2D00_smile_5F00_2.png"&gt; Like for the request, the response need to have couple of header information. And as my usage is extremely simple, I will always consider that it is OK, I’m only delivering text content and that the connection can be closed. By the way, whatever you put there, HTTP is a disconnected protocol, so you should never consider that you are always connected! It’s an error and can drive you to very bad behaviors.&lt;/p&gt;

&lt;p&gt;connection.Send return the first part of the message and then I call an event to tell the creator of the WebServer object that something happened. I send of course the connection object so that the caller will be able to create an HTML page and answer and also the URL so that it can analyze it. &lt;/p&gt;

&lt;p&gt;Last but not least, the try and catch is extremely important. With Sockets a problem can quickly arrive due to a network problem. And I’ve seen it happening on the netduino for no reason. Just capturing the problem and not doing anything makes the web server working for months! Even if you loose the network, the catch will capture the problem and the server will continue to work up to the point the network will work again. The other reason to use it is because of the timeout. If something happen between the client and our webserver, after the timeout, you’ll get in this catch and you’ll start a new socket and the process will go back to something normal. It can happen and happened to me with very long HTML pages I was generating. When I was interrupting the creation and ask for a new page, the socket went into a kind of infinite loop waiting for a request. There should be a smart way to check is something goes well or not but it’s an easy way. &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public delegate void &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;GetRequestHandler&lt;/span&gt;(&lt;span style="color: blue;"&gt;object &lt;/span&gt;obj, &lt;span style="color: rgb(43, 145, 175);"&gt;WebServerEventArgs &lt;/span&gt;e);
&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;WebServerEventArgs&lt;/span&gt;: &lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs
&lt;/span&gt;{
    &lt;span style="color: blue;"&gt;public &lt;/span&gt;WebServerEventArgs(&lt;span style="color: rgb(43, 145, 175);"&gt;Socket &lt;/span&gt;mresponse, &lt;span style="color: blue;"&gt;string &lt;/span&gt;mrawURL)
    {
        &lt;span style="color: blue;"&gt;this&lt;/span&gt;.response = mresponse;
        &lt;span style="color: blue;"&gt;this&lt;/span&gt;.rawURL = mrawURL;
    }
    &lt;span style="color: blue;"&gt;public &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Socket &lt;/span&gt;response { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;protected set&lt;/span&gt;;  }
    &lt;span style="color: blue;"&gt;public string &lt;/span&gt;rawURL { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;protected set&lt;/span&gt;; }

}

&lt;span style="color: blue;"&gt;public event &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;GetRequestHandler &lt;/span&gt;CommandReceived;
&lt;/pre&gt;

&lt;p&gt;Right after the header is sent back, an event is raised. The arguments are simple here, we do send the Socket object and the URL. If you want to enrich the web server, you can add other elements like the header element rather than sending them right away, the browser requesting the page, the IP address or whatever you want! Again, simple and efficient there.&lt;/p&gt;&lt;p&gt;Last but not least if you need to stop the Server, you’ll need a function to this and also to clean the code at the end:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private bool &lt;/span&gt;Restart()
{
    Stop();
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;Start();
}
&lt;/pre&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public void &lt;/span&gt;Stop()
{
    cancel = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;
    &lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;.Sleep(100);
    serverThread.Suspend();
    &lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;"Stoped server in thread "&lt;/span&gt;);
}
&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public void &lt;/span&gt;Dispose()
{
    Dispose(&lt;span style="color: blue;"&gt;true&lt;/span&gt;);
    &lt;span style="color: rgb(43, 145, 175);"&gt;GC&lt;/span&gt;.SuppressFinalize(&lt;span style="color: blue;"&gt;this&lt;/span&gt;);
}

&lt;span style="color: blue;"&gt;protected virtual void &lt;/span&gt;Dispose(&lt;span style="color: blue;"&gt;bool &lt;/span&gt;disposing)
{
    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(disposing)
    {
        serverThread = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;
    }
}
&lt;/pre&gt;

&lt;p&gt;Nothing too complex there, it’s just about pausing the thread (remember, there are other tread attached in it), closing the other thread leaving in the Server object and cleaning everything. I hope it’s the good code to let it clean &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6862.wlEmoticon_2D00_smile_5F00_2.png"&gt; But at the end of the day, my only interest is to let this server running all the time. So I don not really care if it will stop correctly! &lt;/p&gt;

&lt;p&gt;Now, to use the server, easy:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private static &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;WebServer &lt;/span&gt;server;
&lt;/pre&gt;

&lt;pre class="code"&gt;&lt;span style="color: green;"&gt;// Start the HTTP Server
&lt;/span&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;WebServer &lt;/span&gt;server = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;(80, 10000);
server.CommandReceived += &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;GetRequestHandler&lt;/span&gt;(ProcessClientGetRequest);
&lt;span style="color: green;"&gt;// Start the server.
&lt;/span&gt;server.Start();
&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Declare a static WebServer if you want it to be unique. Technically, you can have multiple servers running on different port. In my case, no need for this. Then, it’s about creating the object, adding an event and starting the server!&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private static void &lt;/span&gt;ProcessClientGetRequest(&lt;span style="color: blue;"&gt;object &lt;/span&gt;obj, &lt;span style="color: rgb(43, 145, 175);"&gt;WebServer&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;WebServerEventArgs &lt;/span&gt;e)
&lt;/pre&gt;

&lt;p&gt;And you are ready to do some treatment into this function. To return part of the answer, just use e.response.Send as for the header part and you’re done!&lt;/p&gt;

&lt;p&gt;To simplify the process, as it’s a function which you’ll have to call often, I’ve created a function to do this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public static string &lt;/span&gt;OutPutStream(&lt;span style="color: rgb(43, 145, 175);"&gt;Socket &lt;/span&gt;response, &lt;span style="color: blue;"&gt;string &lt;/span&gt;strResponse)
{
    &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] messageBody = &lt;span style="color: rgb(43, 145, 175);"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(strResponse);
    response.Send(messageBody, 0, messageBody.Length, &lt;span style="color: rgb(43, 145, 175);"&gt;SocketFlags&lt;/span&gt;.None);
    &lt;span style="color: green;"&gt;//allow time to physically send the bits
    &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;.Sleep(10);
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;""&lt;/span&gt;;
}
&lt;/pre&gt;

&lt;p&gt;This can be a function you add in your main code or can add in the Web Server code. &lt;/p&gt;

&lt;p&gt;Now you have a fully functional simple Web Server. You can &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/12/implementing-a-simple-http-server-in-net-microframework.aspx"&gt;read the previous article&lt;/a&gt; on how to handle parameters and analyzing them. The code to manage the parameter is now in the WebServer class. &lt;/p&gt;&lt;p&gt;I’ll post the code in CodePlex so anyone will be able to use it as a helper.&lt;/p&gt;&lt;p&gt;Enjoy this code &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6862.wlEmoticon_2D00_smile_5F00_2.png"&gt; Again, I’m just a marketing director doing some code. And it’s the code running in my sprinkler management system for the last month without any problem! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10311391" width="1" height="1"&gt;</description></item><item><title>Using a SPI device with netduino and .NET micro framework</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/05/22/using-a-spi-device-with-netduino-and-net-micro-framework.aspx</link><pubDate>Tue, 22 May 2012 18:27:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10309055</guid><dc:creator>Laurelle</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10309055</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/05/22/using-a-spi-device-with-netduino-and-net-micro-framework.aspx#comments</comments><description>&lt;p&gt;After playing with I2C, with various IO, I’ve decided to play a bit with SPI &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/43278.wlEmoticon_2D00_smile_5F00_2.png" /&gt; The real project behind using a SPI device is to be able to use it a a multiplexer/demultipler of IO.&lt;/p&gt;  &lt;p&gt;I want to pilot lights for my Lego train. The idea is to have the ability to switch a signal light to green or red. I want to be able to have 16 lights. The netduino board have only 14 digital IO and 6 analogic. And I’m already using some to pilot the Lego train thru infrared. &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/04/07/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-1.aspx"&gt;See previous article&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;So I have to find a multiplexing solution. And one is used by most of the netduino fan: SPI. In terms of electronic it’s simple, it is a serial to parallel (and vice versa as you can read also). The component the most used for this is &lt;a href="http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf"&gt;74HC595&lt;/a&gt;. There are couple of basics explanations on the &lt;a href="http://wiki.netduino.com/SPI-Configuration-Example-74HC595.ashx"&gt;netduino wiki&lt;/a&gt; and also good examples as always on &lt;a href="http://highfieldtales.wordpress.com/"&gt;Mario Vernari blog&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Each 74HC595 can have 8 output and they can be chained. Which mean that you can use 2 component to have 16 output. And you basically put them in series. One output of one 74HC595 to the input of the others.&lt;/p&gt;  &lt;p&gt;I spend quite a bit of time to understand how to plug the 74HC595 to the netduino. So here is what to do:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Pin 8 is ground&lt;/li&gt;    &lt;li&gt;Pin 16 is VCC (+5V recommended)&lt;/li&gt;    &lt;li&gt;Pin 14 to netduino pin D11 (called MOSI) for the first 74HC595 of the chain. For the next one it has to be linked to the Pin 9 of the previous 74HC595&lt;/li&gt;    &lt;li&gt;Pin 13 to ground (used to activate or not the 8 output)&lt;/li&gt;    &lt;li&gt;Pin 12 to one output port you’ll choose on the netduino. Let say pin D10. This one is used to select the 74HC595 when you have multiple 74HC595 used in parallel for different purposes (called SS)&lt;/li&gt;    &lt;li&gt;Pin 11 to netduino pin D13 (called SCLK)&lt;/li&gt;    &lt;li&gt;Pin 10 to +VSS (this one is used to reset if needed)&lt;/li&gt;    &lt;li&gt;Pin 15, 1, 2, 3, 4, 5, 6, 7 are the output pin&lt;/li&gt;    &lt;li&gt;Pin 9 has to be linked to the next 74HC595 of the chain if there are more than 1.&lt;/li&gt;  &lt;/ul&gt;  &lt;p&gt;And that’s it for the basics! Now what I want to do with the output is to be able to light one led green or switch it to red. So I’ll use the output of the 74HC595. When it will be 1, I’ll light the green one, when it will be 0, I’ll light the red one. Here is the hardware to schematic:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7776.image_5F00_2.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3073.image_5F00_thumb.png" width="417" height="183" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When the signal will be 1, the current will go thru the green light light. And when it will be 0, the inverter will switch to 1 and the red light will light. It just need 3 cables per light and the current can be transported on long distance. The RS resistor can be adapted with a lower resistor to 100 or something like this in order to send a more intense current in the cable as there will be some loss if it is very long. by the way I recommend to read the excellent article on the length of cable and impact on signal noise from &lt;a href="http://highfieldtales.wordpress.com/2012/04/25/effect-of-long-wiring-on-digital-signals/"&gt;Mario&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Now, in terms of software, It’s not so difficult. In my project, I’m using the SPI for multiple purpose. So I need to use it in a smart way. SPI can be shared and the only thing to do is to change the configuration and write (and read) right after. So I’m using the MultiSPI class from the &lt;a href="http://www.netmftoolbox.com/"&gt;NETMF Toolbox&lt;/a&gt;. It’s an impressive toolbox containing lots of helpers. It goes from hardware to HTTP web client. There is a 74HC595 also but I found it more complex to use that just directly using the MultiSPI class.&lt;/p&gt;  &lt;p&gt;Here the example of class to switch to green (1) or red (0) a specific output of the 2 74HC595:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Signal
&lt;/span&gt;{
    &lt;span style="color: blue;"&gt;private byte &lt;/span&gt;mNumberSignal;
    &lt;span style="color: blue;"&gt;private bool&lt;/span&gt;[] mSignalStatus;
    &lt;span style="color: blue;"&gt;public const byte &lt;/span&gt;NUMBER_SIGNAL_MAX = 16;
    &lt;span style="color: blue;"&gt;private &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;MultiSPI &lt;/span&gt;MySignal;

    &lt;span style="color: blue;"&gt;public &lt;/span&gt;Signal(&lt;span style="color: blue;"&gt;byte &lt;/span&gt;NumberOfSignal)
    {
        mNumberSignal = NumberOfSignal;
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;((mNumberSignal &amp;lt;= 0) &amp;amp;&amp;amp; (mNumberSignal &amp;gt; NUMBER_SIGNAL_MAX))
            &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Exception&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Not correct number of Signals&amp;quot;&lt;/span&gt;);
        mSignalStatus = &lt;span style="color: blue;"&gt;new bool&lt;/span&gt;[mNumberSignal];
        &lt;span style="color: green;"&gt;// open a SPI
        &lt;/span&gt;MySignal = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;MultiSPI&lt;/span&gt;(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;Configuration&lt;/span&gt;(
            &lt;span style="color: rgb(43, 145, 175);"&gt;Pins&lt;/span&gt;.GPIO_PIN_D10, &lt;span style="color: green;"&gt;// SS-pin
            &lt;/span&gt;&lt;span style="color: blue;"&gt;false&lt;/span&gt;,             &lt;span style="color: green;"&gt;// SS-pin active state
            &lt;/span&gt;0,                 &lt;span style="color: green;"&gt;// The setup time for the SS port
            &lt;/span&gt;0,                 &lt;span style="color: green;"&gt;// The hold time for the SS port
            &lt;/span&gt;&lt;span style="color: blue;"&gt;false&lt;/span&gt;,              &lt;span style="color: green;"&gt;// The idle state of the clock
            &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;,             &lt;span style="color: green;"&gt;// The sampling clock edge
            &lt;/span&gt;1000,              &lt;span style="color: green;"&gt;// The SPI clock rate in KHz
            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI_Devices&lt;/span&gt;.SPI1));   &lt;span style="color: green;"&gt;// The used SPI bus (refers to a MOSI MISO and SCLK pinset)

        //initialise all signals to &amp;quot;false&amp;quot;
        &lt;/span&gt;&lt;span style="color: blue;"&gt;for &lt;/span&gt;(&lt;span style="color: blue;"&gt;byte &lt;/span&gt;i = 0; i &amp;lt; mNumberSignal; i++)
            ChangeSignal(i, &lt;span style="color: blue;"&gt;true&lt;/span&gt;);
    }

    &lt;span style="color: blue;"&gt;public byte &lt;/span&gt;NumberOfSignals
    { &lt;span style="color: blue;"&gt;get &lt;/span&gt;{ &lt;span style="color: blue;"&gt;return &lt;/span&gt;mNumberSignal; } }

    &lt;span style="color: blue;"&gt;public void &lt;/span&gt;ChangeSignal(&lt;span style="color: blue;"&gt;byte &lt;/span&gt;NumSignal, &lt;span style="color: blue;"&gt;bool &lt;/span&gt;value)
    {
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;((NumSignal &amp;lt;= 0) &amp;amp;&amp;amp; (NumSignal &amp;gt; mNumberSignal))
            &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Exception&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Not correct number of Signals&amp;quot;&lt;/span&gt;);
        &lt;span style="color: green;"&gt;//need to convert to select the right Signal
        &lt;/span&gt;mSignalStatus[NumSignal] = value;
        &lt;span style="color: green;"&gt;// fill the buffer to be sent
        &lt;/span&gt;&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;[] mySign = &lt;span style="color: blue;"&gt;new ushort&lt;/span&gt;[1] { 0 };
        &lt;span style="color: blue;"&gt;for &lt;/span&gt;(&lt;span style="color: blue;"&gt;ushort &lt;/span&gt;i = 0; i &amp;lt; mNumberSignal; i++)
            &lt;span style="color: blue;"&gt;if &lt;/span&gt;(mSignalStatus[i])
                mySign[0] = (&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;)(mySign[0] | (&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;)(1 &amp;lt;&amp;lt; i));
        &lt;span style="color: green;"&gt;//send the bytes
        &lt;/span&gt;MySignal.Write(mySign);
        

    }

    &lt;span style="color: blue;"&gt;public bool &lt;/span&gt;GetSignal(&lt;span style="color: blue;"&gt;byte &lt;/span&gt;NumSignal)
    {
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;((NumSignal &amp;lt;= 0) &amp;amp;&amp;amp; (NumSignal &amp;gt; mNumberSignal))
            &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Exception&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Not correct number of Signals&amp;quot;&lt;/span&gt;);
&lt;span style="color: green;"&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return &lt;/span&gt;mSignalStatus[NumSignal];
    }
}
&lt;/pre&gt;

&lt;p&gt;I just need to declare a MultiSPI. The SPI Configuration contains the necessary information to setup the 74HC595. The SS pin is set to D10. So I can use the SPI for other purposed to pilot my Lego infrared modules. And in the Lego module, I’ll have also to declare the SPI as MultiSPI.&lt;/p&gt;

&lt;p&gt;What the MultiSPI class is doing is very simple. It has a static SPI in its private variables. And a SPI.Configuration which is not static.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: gray;"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;Reference to the SPI Device. All MultiSPI &lt;br /&gt;devices use the same SPI class from the NETMF, so this reference is static&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;span style="color: blue;"&gt;private static &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI &lt;/span&gt;_SPIDevice;
&lt;span style="color: gray;"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: green;"&gt;SPI Configuration. Different for each device, so not a static reference&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;span style="color: blue;"&gt;private &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;Configuration &lt;/span&gt;_Configuration;
&lt;/pre&gt;

&lt;pre class="code"&gt;&lt;span style="color: green;"&gt;// Store the configuration file for each MultiSPI instance&lt;br /&gt;Sets the configuration in a local value
&lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;._Configuration = config;

&lt;span style="color: green;"&gt;// If no SPI Device exists yet, we create it's first instance
&lt;/span&gt;&lt;span style="color: blue;"&gt;if &lt;/span&gt;(_SPIDevice == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
{
    &lt;span style="color: green;"&gt;// Creates the SPI Device only 1 time as it is a static!
    &lt;/span&gt;_SPIDevice = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI&lt;/span&gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt;._Configuration);
}
&lt;/pre&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public void &lt;/span&gt;Write(&lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] WriteBuffer)
{
    _SPIDevice.Config = &lt;span style="color: blue;"&gt;this&lt;/span&gt;._Configuration;
    _SPIDevice.Write(WriteBuffer);
}
&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;So each time a program want to write in a SPI, the right configuration is selected and the write command is send. It’s working like this to read. The full class is a bit more complex but the main principle is there.&lt;/p&gt;

&lt;p&gt;The rest of my code is very simple and I’m sure I would have been to write it in a better way. I’m just storing the state of a signal and then output all the buffer to the SPI. &lt;/p&gt;

&lt;p&gt;So bottom line, it is very easy to use SPI as a multiplexer/demultipler for IO. That was what I needed. I did not tested yet how to read the data but it should be as simple!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10309055" width="1" height="1"&gt;</description></item><item><title>Managing my Sprinklers from the Cloud</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/05/07/managing-my-sprinklers-from-the-cloud.aspx</link><pubDate>Mon, 07 May 2012 06:32:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10301697</guid><dc:creator>Laurelle</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10301697</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/05/07/managing-my-sprinklers-from-the-cloud.aspx#comments</comments><description>&lt;p&gt;I’ve started a project to pilot my sprinklers remotely and make them smart almost &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/09/netduino-board-geek-tool-for-net-microframework.aspx"&gt;9 months ago&lt;/a&gt;. The idea is to be able to remotely open and close my sprinklers but also be able to launch automatic sprinkling cycles. &lt;/p&gt;  &lt;p&gt;After some software and hardware development, I now have a fully working solution:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4721.WP_5F00_000611_5F00_2.jpg"&gt;&lt;img title="WP_000611" style="display: inline; background-image: none;" border="0" alt="WP_000611" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8372.WP_5F00_000611_5F00_thumb.jpg" width="543" height="408" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can see the netduino .NET Microframework board where all the smart is happening. I wrote couple of articles already to show &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/12/implementing-a-simple-http-server-in-net-microframework.aspx"&gt;how to implement a web server&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/27/program-a-date-time-and-duration-for-a-sprinkler-in-net-microframework-and-netduino.aspx"&gt;launch timers&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/20/displaying-a-calendar-in-a-web-page-using-net-microframework.aspx"&gt;create calendars&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/13/setup-a-time-and-date-using-net-microframework.aspx"&gt;get the date and time&lt;/a&gt;. I’ve also wrote couple of articles on hardware. &lt;/p&gt;  &lt;p&gt;Recently, I’ve met with Alain, a Lego fan like me and I show him the way I can control any Lego Power Function element using .NET Microframework. And we discussed about my sprinkler project. I was about to implement the final solution with my existing 9V Gardena electro valves. And he challenged ma on this telling me that I will never know the status of the electro valve if I hacked the Gardena system. And he tell me to go for a 24V DC electro valve. The big advantage is that when you switch on the current, it open the valve, when it’s off, it close. So no unknown state like with the bistable&amp;#160; valve from Gardena. So I bought 3 24V DC electro valve for 22€ each plus couple of cents for the diode (never forget to add a return current diode on a solenoid &lt;img class="wlEmoticon wlEmoticon-smile" style="style" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6886.wlEmoticon_2D00_smile_5F00_2.png" /&gt;).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6886.WP_5F00_000612_5F00_2.jpg"&gt;&lt;img title="WP_000612" style="display: inline; background-image: none;" border="0" alt="WP_000612" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5807.WP_5F00_000612_5F00_thumb.jpg" width="544" height="409" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And the display screen with the button you see is a Crouzet automate. It’s a gift from Alain and it’s really cool to have it. For my project, it can be replaced by 3 buttons, 3 leds and 3 transistors but it’s just more cool &lt;img class="wlEmoticon wlEmoticon-smile" style="style" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6886.wlEmoticon_2D00_smile_5F00_2.png" /&gt; The netduino enter in the DC input section and when the voltage is higher than 2V (normal high level is 3.3V), it just switch on an electro valve. So nothing complicated there.&lt;/p&gt;  &lt;p&gt;What has been long is to bring electricity when I wanted this box to be plus networking plus bring cables to all the places where I have electro valves. And as I have in front and rear of the house, I have lots of cables to install nicely in the basement. And just this took 1 full day with a friend who helped me. Thanks Thomas by the way &lt;img class="wlEmoticon wlEmoticon-smile" style="style" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6886.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;And now from my Windows Phone or a PC or any other device which support HTML, I can open, close and program my sprinklers:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4743.image_5F00_2.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5314.image_5F00_thumb.png" width="228" height="280" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I’m an happy geek &lt;img class="wlEmoticon wlEmoticon-smile" style="style" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6886.wlEmoticon_2D00_smile_5F00_2.png" /&gt; And as there are always some improvement to do, next step is to add a &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/02/21/using-one-temperature-sensor-with-i2c-protocol-and-net-micro-framework-on-netduino-board.aspx"&gt;I2C temperature sensor&lt;/a&gt; to get information on the temperature outside and implement automatic rules.&lt;/p&gt;  &lt;p&gt;Stay tune!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10301697" width="1" height="1"&gt;</description></item><item><title>Using netduino and .NET Microframework to pilot any Lego Power Function thru Infrared (part 3)</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/04/26/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-3.aspx</link><pubDate>Thu, 26 Apr 2012 17:39:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10298154</guid><dc:creator>Laurelle</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10298154</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/04/26/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-3.aspx#comments</comments><description>&lt;p&gt;In the &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/04/07/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-1.aspx"&gt;previous post&lt;/a&gt;, I’ve explain how to create a class and the hardware that will be able to pilot any Lego Power Function. In this article, I will explain how to create a web server (like IIS or Apache but much much much more simpler) and create a simple way to call the class. &lt;/p&gt;  &lt;p&gt;I’ve already explained how to &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/12/implementing-a-simple-http-server-in-net-microframework.aspx"&gt;create such a web server&lt;/a&gt; into one of my previous article. So Il will use the same idea. I will only explain the implementation of the specific part to call the Combo Mode function as I already take it in &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/04/17/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-2.aspx"&gt;the past articles&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The function is part of the LegoInfrared class and looks like&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public bool &lt;/span&gt;ComboMode(&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed &lt;/span&gt;blue_speed, &lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed &lt;/span&gt;red_speed, &lt;span style="color: rgb(43, 145, 175);"&gt;LegoChannel &lt;/span&gt;channel)
&lt;/pre&gt;

&lt;p&gt;LegoSpeed and LegoChannel are both enums.&lt;/p&gt;

&lt;p&gt;The simple view of the HTTPServer Class is the following:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public static class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;MyHttpServer
&lt;/span&gt;{
    &lt;span style="color: blue;"&gt;const int &lt;/span&gt;BUFFER_SIZE = 1024;
    &lt;span style="color: green;"&gt;// Strings to be used for the page names
    &lt;/span&gt;&lt;span style="color: blue;"&gt;const string &lt;/span&gt;pageDefault  = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;default.aspx&amp;quot;&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;const string &lt;/span&gt;pageCombo  = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;combo.aspx&amp;quot;&lt;/span&gt;;
    &lt;span style="color: green;"&gt;// Strings to be used for the param names
    &lt;/span&gt;&lt;span style="color: blue;"&gt;const string &lt;/span&gt;paramComboBlue = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;bl&amp;quot;&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;const string &lt;/span&gt;paramComboRed = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;rd&amp;quot;&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;const string &lt;/span&gt;paramChannel = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;ch&amp;quot;&lt;/span&gt;;
    &lt;span style="color: green;"&gt;// Strings to be used for separators and returns
    &lt;/span&gt;&lt;span style="color: blue;"&gt;const char &lt;/span&gt;ParamSeparator = &lt;span style="color: rgb(163, 21, 21);"&gt;'&amp;amp;'&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;const char &lt;/span&gt;ParamStart = &lt;span style="color: rgb(163, 21, 21);"&gt;'?'&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;const char &lt;/span&gt;ParamEqual = &lt;span style="color: rgb(163, 21, 21);"&gt;'='&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;const string &lt;/span&gt;strOK = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;OK&amp;quot;&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;const string &lt;/span&gt;strProblem = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Problem&amp;quot;&lt;/span&gt;;
    
    &lt;span style="color: green;"&gt;// Class to be used to find the parameters
    &lt;/span&gt;&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Param
&lt;/span&gt;    &lt;span style="color: green;"&gt;// Create a Lego Infrared object
    &lt;/span&gt;&lt;span style="color: blue;"&gt;private static &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared &lt;/span&gt;myLego = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;();
    &lt;span style="color: blue;"&gt;public static void &lt;/span&gt;StartHTTPServer()
    {
        &lt;span style="color: green;"&gt;// Wait for DHCP (on LWIP devices)
        &lt;/span&gt;&lt;span style="color: blue;"&gt;while &lt;/span&gt;(&lt;span style="color: blue;"&gt;true&lt;/span&gt;)
        {
            &lt;span style="color: rgb(43, 145, 175);"&gt;IPAddress &lt;/span&gt;ip = &lt;span style="color: rgb(43, 145, 175);"&gt;IPAddress&lt;/span&gt;.GetDefaultLocalAddress();

            &lt;span style="color: blue;"&gt;if &lt;/span&gt;(ip != &lt;span style="color: rgb(43, 145, 175);"&gt;IPAddress&lt;/span&gt;.Any) 
            {
                &lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(ip.ToString());   
                &lt;span style="color: blue;"&gt;break&lt;/span&gt;;
            }

            &lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;.Sleep(1000);
        }
&lt;span style="color: green;"&gt;        

        // Starts http server in another thread.
        &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Thread &lt;/span&gt;httpThread = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;((&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;PrefixKeeper&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;http&amp;quot;&lt;/span&gt;)).RunServerDelegate);
        httpThread.Start();

        &lt;span style="color: green;"&gt;// Everything is started, waiting for commands :-)
        &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Everything is started, waiting for command&amp;quot;&lt;/span&gt;);
    }
&lt;/pre&gt;

&lt;p&gt;There are of course couple of other functions part of the class but I make it simple here. I created couple of const to be able to handle the name of pages and as explained in past articles, I will use URL like combo.aspx?bl=8&amp;amp;rd=2&amp;amp;ch=1&lt;/p&gt;

&lt;p&gt;Here by convention, bl will contains the value of the blue speed, rd, the red one and ch the Channel. the combo.aspx is the page name to call the ComboMode function. And yes, I do not need to use any extention, I can use just combo? or cb? or whatever I want. But I feel it’s cool to see .aspx as an extension in a board with only couple of kb of memory &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0624.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;

&lt;p&gt;Now let have a look at the ProcessClientGetRequest function which will allow us to switch from one page to another.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private static void &lt;/span&gt;ProcessClientGetRequest(&lt;span style="color: rgb(43, 145, 175);"&gt;HttpListenerContext &lt;/span&gt;context)
{

&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;font color="#333333"&gt;    &lt;/font&gt;HttpListenerRequest &lt;/span&gt;request = context.Request;
    &lt;span style="color: rgb(43, 145, 175);"&gt;HttpListenerResponse &lt;/span&gt;response = context.Response;

    &lt;span style="color: blue;"&gt;string &lt;/span&gt;strFilePath = request.RawUrl;
    &lt;span style="color: green;"&gt;// Switch to the right page 
&lt;/span&gt;    &lt;span style="color: green;"&gt;// Page Combo
    &lt;/span&gt;&lt;span style="color: blue;"&gt;if &lt;/span&gt;(strFilePath.Length &amp;gt; pageCombo.Length)
    {
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(strFilePath.Substring(1, pageCombo.Length).ToLower() == pageCombo)
        {
            ProcessCombo(context);
            &lt;span style="color: blue;"&gt;return&lt;/span&gt;;
        }
     }
     &lt;span style="color: green;"&gt;// Brunch other pages + Start HTML document
}
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;This function is called when a GET request is done to the Web Server. The request.RawURL return the name of the URL with all the parameters. So we just need to compare the name of the page with the first part of the URL. All URL start with /, so we start at position 1. If it does match, then, go to the ProcessCombo function. Otherwise, continue and do switches like that for all needed pages. And finally, you can build your own code. And that is what we will do later. Yes, we will generate a bit of HTML &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0624.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private static void &lt;/span&gt;ProcessCombo(&lt;span style="color: rgb(43, 145, 175);"&gt;HttpListenerContext &lt;/span&gt;context)
{
    &lt;span style="color: rgb(43, 145, 175);"&gt;HttpListenerRequest &lt;/span&gt;request = context.Request;
    &lt;span style="color: rgb(43, 145, 175);"&gt;HttpListenerResponse &lt;/span&gt;response = context.Response;
    &lt;span style="color: blue;"&gt;string &lt;/span&gt;strParam = request.RawUrl;
    &lt;span style="color: blue;"&gt;string &lt;/span&gt;strResp = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(DecryptCombo(strParam))
        strResp = strOK;
    &lt;span style="color: blue;"&gt;else
        &lt;/span&gt;strResp = strProblem;
    OutPutStream(response, strResp);
}

&lt;/pre&gt;

&lt;p&gt;This function is very simple and just do a branch depending on the result of the DecryptCombo function. If it is successful, then it will return OK, if not, it will return Problem.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private static bool &lt;/span&gt;DecryptCombo(&lt;span style="color: blue;"&gt;string &lt;/span&gt;StrDecrypt)
{
    &lt;span style="color: green;"&gt;// decode params
    &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Param&lt;/span&gt;[] Params = decryptParam(StrDecrypt);
    &lt;span style="color: blue;"&gt;int &lt;/span&gt;mChannel = -1;
    &lt;span style="color: blue;"&gt;int &lt;/span&gt;mComboBlue = -1;
    &lt;span style="color: blue;"&gt;int &lt;/span&gt;mComboRed = -1;
    &lt;span style="color: blue;"&gt;bool &lt;/span&gt;isvalid = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(Params != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
    {
        &lt;span style="color: blue;"&gt;for &lt;/span&gt;(&lt;span style="color: blue;"&gt;int &lt;/span&gt;i = 0; i &amp;lt; Params.Length; i++)
        {
            &lt;span style="color: green;"&gt;//on cherche le paramètre strMonth
            &lt;/span&gt;&lt;span style="color: blue;"&gt;int &lt;/span&gt;j = Params[i].Name.ToLower().IndexOf(paramChannel);
            &lt;span style="color: blue;"&gt;if &lt;/span&gt;(j == 0)
            {
                mChannel = &lt;span style="color: rgb(43, 145, 175);"&gt;Convert&lt;/span&gt;.ToInt32(Params[i].Value);
                &lt;span style="color: blue;"&gt;if &lt;/span&gt;(!((mChannel &amp;gt;= (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoChannel&lt;/span&gt;.CH1)&lt;br /&gt; &amp;amp;&amp;amp; (mChannel &amp;lt;= (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoChannel&lt;/span&gt;.CH4)))
                    isvalid = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;
            }
            j = Params[i].Name.ToLower().IndexOf(paramComboBlue);
            &lt;span style="color: blue;"&gt;if &lt;/span&gt;(j == 0)
            {
                mComboBlue = &lt;span style="color: rgb(43, 145, 175);"&gt;Convert&lt;/span&gt;.ToInt32(Params[i].Value);
                &lt;span style="color: blue;"&gt;if &lt;/span&gt;(!((mComboBlue == (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;.BLUE_BRK)&lt;br /&gt; || (mComboBlue == (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;.BLUE_FLT) ||
                    (mComboBlue == (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;.BLUE_FWD)&lt;br /&gt; || (mComboBlue == (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;.BLUE_REV)))
                    isvalid = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;

            }
            j = Params[i].Name.ToLower().IndexOf(paramComboRed);
            &lt;span style="color: blue;"&gt;if &lt;/span&gt;(j == 0)
            {
                mComboRed = &lt;span style="color: rgb(43, 145, 175);"&gt;Convert&lt;/span&gt;.ToInt32(Params[i].Value);
                &lt;span style="color: blue;"&gt;if &lt;/span&gt;(!((mComboRed &amp;gt;= (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;.RED_FLT)&lt;br /&gt; &amp;amp;&amp;amp; (mComboRed &amp;lt;= (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;.RED_BRK)))
                    isvalid = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;

            }
        }
    }
    &lt;span style="color: green;"&gt;// check if all params are correct

    &lt;/span&gt;&lt;span style="color: blue;"&gt;if &lt;/span&gt;((isvalid) &amp;amp;&amp;amp; (mComboRed != -1) &amp;amp;&amp;amp; (mChannel != -1) &amp;amp;&amp;amp; (mComboBlue != -1))
    {
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(!Microsoft.SPOT.Hardware.&lt;span style="color: rgb(43, 145, 175);"&gt;SystemInfo&lt;/span&gt;.IsEmulator)
                isvalid = myLego.ComboMode((&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;)mComboBlue,&lt;br /&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;)mComboRed, (&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoChannel&lt;/span&gt;)mChannel);
        &lt;span style="color: blue;"&gt;else
            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Sent Combo blue &amp;quot; &lt;/span&gt;+ mComboBlue.ToString()&lt;br /&gt; + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot; red &amp;quot; &lt;/span&gt;+ mComboRed.ToString() + &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot; channel &amp;quot; &lt;/span&gt;+ mChannel.ToString());
    }
    &lt;span style="color: blue;"&gt;else
        &lt;/span&gt;isvalid = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;isvalid;

}

&lt;/pre&gt;

&lt;p&gt;I’ve been thru this kind of explanation couple of times in the &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/12/implementing-a-simple-http-server-in-net-microframework.aspx"&gt;previous examples&lt;/a&gt;. The code is quite simple, it first call a decrypt function that will return a table containing the parameter name and the value, both as string. More info here. If I take the previous example combo.aspx?bl=8&amp;amp;rd=2&amp;amp;ch=1, it will return 3 params with the pair (bl, 8), (rd, 2), (ch, 1). The idea is to convert and validate those parameters. When one is found, it is converted to the right type and compare to the enums values to check is everything is correct.&lt;/p&gt;

&lt;p&gt;If all parameters are converted correctly and the values are valid, then the ComboMode function is called. If the function is successful, then the value true is return form the function and see the previous section, it will return OK. If not, Problem will be returned.&lt;/p&gt;

&lt;p&gt;As you can see, I check if I’m in the emulator or in a real board. If I’m in the emulator, I will not physically send the signal as it is just an emulator &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0624.wlEmoticon_2D00_smile_5F00_2.png" /&gt; That allow me to do development in the planes and test the code. Of course, back home, I test them for real, just in case &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0624.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;

&lt;p&gt;So we now have a way to call our ComboMode function thru a simple URL. I can also create a simple UI to be able to send commands very simply thru a web page. For this, I’ll need to do some HTML. And I have to admit, I don’t really like HTML… The idea of this simple UI is to be able to have dropdown box to select the speed for both the Blue and the Red output but also select the channel. At the end, the UI will looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/5736.image_5F00_2.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7571.image_5F00_thumb.png" width="437" height="280" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The HTML code to do it is the following for the ComboMode:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: maroon;"&gt;DOCTYPE &lt;/span&gt;&lt;span style="color: red;"&gt;html PUBLIC &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;html &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;head&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;head&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;body&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;form &lt;/span&gt;&lt;span style="color: red;"&gt;method&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;get&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;action&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;combo.aspx&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;target&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;_blank&amp;quot;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;p&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Combo Mode&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;br &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;
&lt;/span&gt;Speed Red&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;select &lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;RedSpeed&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;rd&amp;quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='RED_FLT'&amp;gt;&lt;/span&gt;0&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='RED_FWD'&amp;gt;&lt;/span&gt;1&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='RED_REV'&amp;gt;&lt;/span&gt;2&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='RED_BRK'&amp;gt;&lt;/span&gt;3&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt; &lt;/span&gt;Speed Blue&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;select &lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;BlueSpeed&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;bl&amp;quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='BLUE_FLT'&amp;gt;&lt;/span&gt;0&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='BLUE_FWD'&amp;gt;&lt;/span&gt;4&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='BLUE_REV'&amp;gt;&lt;/span&gt;8&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='BLUE_BRK'&amp;gt;&lt;/span&gt;12&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt; &lt;/span&gt;Channel&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;select &lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;Channel&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;ch&amp;quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='CH1'&amp;gt;&lt;/span&gt;0&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='CH2'&amp;gt;&lt;/span&gt;1&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='CH3'&amp;gt;&lt;/span&gt;2&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;option &lt;/span&gt;&lt;span style="color: red;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;='CH4'&amp;gt;&lt;/span&gt;3&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;option&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: red;"&gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;input &lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;Submit1&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;submit&amp;quot; &lt;/span&gt;&lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;=&amp;quot;Send&amp;quot; /&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;p&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;form&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;body&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;html&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Nothing rocket science, just a bit of HTML. Please note that the form will be send in get mode so with a URL exactly like the one we want. the target=”_blank” attibute of form is to open it in a new window when the submit button will be clicked. I prefer this as it allow to keep the main windows open and change easily one of the value without changing everything. &lt;/p&gt;

&lt;p&gt;The label attibute of the option tag in a select allow you to put the name you want in the combo list. The value inside the option tag is what will be send. So you can display a friendly name instead of a “stupid” number. &lt;/p&gt;

&lt;p&gt;In terms of code, here is what I have done. This code is part of the ProcessClientGetRequest function:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: green;"&gt;// Start HTML document
&lt;/span&gt;&lt;span style="color: blue;"&gt;string &lt;/span&gt;strResp = &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;!DOCTYPE html PUBLIC \&amp;quot;-//W3C//DTD XHTML 1.0 Transitional&lt;br /&gt;//EN\&amp;quot; \&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;html xmlns=\&amp;quot;http://www.w3.org/1999/xhtml\&amp;quot;&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;quot;&lt;/span&gt;;
&lt;span style="color: green;"&gt;// first form is for Combo mode
&lt;/span&gt;strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;form method=\&amp;quot;get\&amp;quot; action=\&amp;quot;combo.aspx\&amp;quot; target=\&amp;quot;_blank\&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;Combo Mode&amp;lt;br /&amp;gt;Speed Red&amp;lt;select id=\&amp;quot;RedSpeed\&amp;quot; name=\&amp;quot;rd\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;option label='RED_FLT'&amp;gt;0&amp;lt;/option&amp;gt;&amp;lt;option label='RED_FWD'&amp;gt;1&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option label='RED_REV'&amp;gt;2&amp;lt;/option&amp;gt;&amp;lt;option label='RED_BRK'&amp;gt;3&amp;lt;/option&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/select&amp;gt; Speed Blue&amp;lt;select id=\&amp;quot;BlueSpeed\&amp;quot; name=\&amp;quot;bl\&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;option label='BLUE_FLT'&amp;gt;0&amp;lt;/option&amp;gt;&amp;lt;option label='BLUE_FWD'&amp;gt;4&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option label='BLUE_REV'&amp;gt;8&amp;lt;/option&amp;gt;&amp;lt;option label='BLUE_BRK'&amp;gt;12&amp;lt;/option&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/select&amp;gt; Channel&amp;lt;select id=\&amp;quot;Channel\&amp;quot; name=\&amp;quot;ch\&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;option label='CH1'&amp;gt;0&amp;lt;/option&amp;gt;&amp;lt;option label='CH2'&amp;gt;1&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option label='CH3'&amp;gt;2&amp;lt;/option&amp;gt;&amp;lt;option label='CH4'&amp;gt;3&amp;lt;/option&amp;gt;&amp;quot;&lt;/span&gt;;
strResp += &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;&amp;lt;/select&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;&amp;lt;input id=\&amp;quot;Submit1\&amp;quot; type=\&amp;quot;submit\&amp;quot; value=\&amp;quot;Send\&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/form&amp;gt;&amp;quot;&lt;/span&gt;;
strResp = OutPutStream(response, strResp);
&lt;/pre&gt;

&lt;p&gt;I just create the form as it should be, very simply. Filling a string and outputting the string to the response object. Be careful as in netduino, the maximum size of any object, so including strings is 1024. The strResp object can’t contain more than 1024 caracters, so it is necessary to empty it. The way I do it is thru the OutPutStream function which output the string value into the response stream. I’ve already explained it in a past article.&lt;/p&gt;

&lt;p&gt;So here is it for this part. I’ve explained how to be able to create a set of Web API, very simple to control this infrared emitter. This principle can be apply to anything! I have couple of ideas for the next step. I can implement a system with sensors (can be ILS for examples) and signals (green/red lights) and switch management. But I’m not there yet! Any feedback and ideas welcome.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10298154" width="1" height="1"&gt;</description></item><item><title>Using netduino and .NET Microframework to pilot any Lego Power Function thru Infrared (part 2)</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/04/17/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-2.aspx</link><pubDate>Tue, 17 Apr 2012 17:13:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10294573</guid><dc:creator>Laurelle</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10294573</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/04/17/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-2.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/04/07/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-1.aspx"&gt;In a previous post&lt;/a&gt;, I’ve started to describe the Lego Power Function protocol and how I’ve implemented it on a netduino board using .NET Microframework. My work is based on &lt;a href="http://highfieldtales.wordpress.com/2012/02/07/infrared-transmitter-driver-for-netduino/"&gt;ideas and implementation Mario explain in his blog.&lt;/a&gt; We’ve exchange couple of emails to make both our projects work &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2605.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;To continue where I stopped, The message_pause function is like this:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;message_pause(&lt;span style="color: blue;"&gt;uint &lt;/span&gt;channel, &lt;span style="color: blue;"&gt;uint &lt;/span&gt;count)
{

    &lt;span style="color: blue;"&gt;int &lt;/span&gt;a = 0;
    &lt;span style="color: green;"&gt;// delay for first message
    // (4 - Ch) * Tm
    &lt;/span&gt;&lt;span style="color: blue;"&gt;if &lt;/span&gt;(count == 0)
        a = 4 - (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)channel + 1;
    &lt;span style="color: green;"&gt;// next 2 messages
    // 5 * Tm
    &lt;/span&gt;&lt;span style="color: blue;"&gt;else if &lt;/span&gt;(count == 1 || count == 2)
        a = 5;
    &lt;span style="color: green;"&gt;// last 2 messages
    // (6+2*Ch) * Tm
    &lt;/span&gt;&lt;span style="color: blue;"&gt;else if &lt;/span&gt;(count == 3 || count == 4)
        a = 5 + ((&lt;span style="color: blue;"&gt;int&lt;/span&gt;)channel + 1) * 2;

    &lt;span style="color: green;"&gt;// Tm = 16 ms (in theory 13.7 ms)
    &lt;/span&gt;System.Threading.&lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;.Sleep(a * 16);
&lt;/pre&gt;

&lt;p&gt;It is a bit more comprehensive if you look at this picture. Each dot represent a signal sent. and each space the time you have to wait.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6332.image_5F00_thumb_5B00_10_5D005F00_2.png"&gt;&lt;img title="image_thumb[10]" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="image_thumb[10]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2781.image_5F00_thumb_5B00_10_5D005F00_thumb.png" width="482" height="107" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Lego protocol says you have to wait 16 ms minimum between 2 messages as it is the max size of a message. How did they arrive to this magic number?&lt;/p&gt;

&lt;p&gt;Back to our protocol, we know that the frequency is 38KHz, that the structure of a message starts and stop with a start/stop bit which is composed by 6 pulses IR and 39 pauses. A low bit is a 6 IR pulse and 10 pauses, a high bit a 6 IR pulse and 21 pauses. So we can do a ^simple table like this to have the length in µ seconds and the length in ushort:&lt;/p&gt;
&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;

&lt;table style="line-height: normal; list-style-type: disc; border-collapse: collapse;" cellspacing="0" cellpadding="0" width="202" border="0"&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 4608;" width="126" /&gt;&lt;/colgroup&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 2779;" width="76" /&gt;&lt;/colgroup&gt;&lt;tbody&gt;
    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl65" style="border-width: 1pt 0.5pt 0.5pt 1pt; border-style: solid; border-color: windowtext; vertical-align: bottom; white-space: nowrap;" height="20" width="126"&gt;&lt;font style="font-size: 11pt;"&gt;Type&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl66" style="border-width: 1pt 1pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="76"&gt;&lt;font style="font-size: 11pt;"&gt;Total&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl67" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;start µs&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl68" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt;"&gt;1 184&lt;/font&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl67" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;start ushort&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl68" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt;"&gt;45&lt;/font&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl67" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;stop µs&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl68" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt;"&gt;1 184&lt;/font&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl67" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;stop ushort&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl68" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt;"&gt;45&lt;/font&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl67" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;low µs&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl68" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl67" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;low ushort&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl68" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl67" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;hight µs&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl68" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15.75pt;" height="21"&gt;
      &lt;td class="xl69" style="border-width: medium 0.5pt 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="21"&gt;&lt;font style="font-size: 11pt;"&gt;hight ushort&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;And we can also have the view of the full size of a message. The minimum size (if all bits are low) and the maximum one (if all bits are high):&lt;/p&gt;
&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;

&lt;table style="line-height: normal; list-style-type: disc; border-collapse: collapse;" cellspacing="0" cellpadding="0" width="762" border="0"&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 4608;" width="126" /&gt;&lt;/colgroup&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 2779;" width="76" /&gt;&lt;/colgroup&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 1316;" width="36" /&gt;&lt;/colgroup&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 1755;" width="48" /&gt;&lt;/colgroup&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 1792;" width="49" /&gt;&lt;/colgroup&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 1024;" width="28" /&gt;&lt;/colgroup&gt;&lt;colgroup&gt;&lt;col style="mso-width-source: userset; mso-width-alt: 1280;" width="34" /&gt;&lt;/colgroup&gt;&lt;tbody&gt;
    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl66" style="border-width: 1pt 0.5pt 0.5pt 1pt; border-style: solid; border-color: windowtext; vertical-align: bottom; white-space: nowrap;" height="20" width="126"&gt;&lt;font style="font-size: 11pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl67" style="border-width: 1pt 1pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="76"&gt;&lt;font style="font-size: 11pt;"&gt;Total&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl74" style="vertical-align: bottom; border-top-color: windowtext; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: 1pt; border-right-width: 0.5pt; border-bottom-width: 0.5pt; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; white-space: nowrap;" width="36"&gt;&lt;font style="font-size: 11pt;"&gt;Start&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="48"&gt;&lt;font style="font-size: 11pt;"&gt;Toggle&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="49"&gt;&lt;font style="font-size: 11pt;"&gt;Escape&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;C&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;C&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;a&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;M&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;M&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;M&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;D&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;D&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;D&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;D&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;L&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;L&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;L&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl70" style="border-width: 1pt 0.5pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="28"&gt;&lt;font style="font-size: 11pt;"&gt;L&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl67" style="border-width: 1pt 1pt 0.5pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" width="34"&gt;&lt;font style="font-size: 11pt;"&gt;stop&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl68" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;Min size µs&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl71" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;9104&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl75" style="vertical-align: bottom; border-top-color: currentcolor; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: medium; border-right-width: 0.5pt; border-bottom-width: 0.5pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;1184&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;421&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl71" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;1184&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl68" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;Min size ushort&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl71" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;346&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl75" style="vertical-align: bottom; border-top-color: currentcolor; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: medium; border-right-width: 0.5pt; border-bottom-width: 0.5pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;45&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;16&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl71" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;45&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15pt;" height="20"&gt;
      &lt;td class="xl68" style="border-width: medium 0.5pt 0.5pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="20"&gt;&lt;font style="font-size: 11pt;"&gt;Max size µs&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl71" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;13744&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl75" style="vertical-align: bottom; border-top-color: currentcolor; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: medium; border-right-width: 0.5pt; border-bottom-width: 0.5pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;1184&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl65" style="border-width: medium 0.5pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;711&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl71" style="border-width: medium 1pt 0.5pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;1184&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr style="height: 15.75pt;" height="21"&gt;
      &lt;td class="xl69" style="border-width: medium 0.5pt 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; vertical-align: bottom; white-space: nowrap;" height="21"&gt;&lt;font style="font-size: 11pt;"&gt;Max size ushort&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl73" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;522&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl76" style="vertical-align: bottom; border-top-color: currentcolor; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: medium; border-right-width: 0.5pt; border-bottom-width: 1pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;45&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl72" style="border-width: medium 0.5pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;27&lt;/font&gt;&lt;/td&gt;

      &lt;td class="xl73" style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; vertical-align: bottom; white-space: nowrap;" align="right"&gt;&lt;font style="font-size: 11pt;"&gt;45&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;So if you do the sum, you can see that the maximum length is 13 744 µ seconds which is 13.744 mili seconds and not 16ms as Lego describe. But lets take the Lego recommendation there. As you can see also the maximum length of a message is 522 ushort. And that’s the perfect transition to have a look at the spi_send function:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;spi_send(&lt;span style="color: blue;"&gt;ushort &lt;/span&gt;code)
{
    &lt;span style="color: blue;"&gt;try
    &lt;/span&gt;{
        &lt;span style="color: blue;"&gt;ushort&lt;/span&gt;[] tosend = &lt;span style="color: blue;"&gt;new ushort&lt;/span&gt;[522]; &lt;span style="color: green;"&gt;// 522 is the max size of the message to be send
        &lt;/span&gt;&lt;span style="color: blue;"&gt;ushort &lt;/span&gt;x = 0x8000;
        &lt;span style="color: blue;"&gt;int &lt;/span&gt;i = 0;

        &lt;span style="color: green;"&gt;//Start bit
        &lt;/span&gt;i = FillStartStop(tosend, i);

        &lt;span style="color: green;"&gt;//encoding the 2 codes
        &lt;/span&gt;&lt;span style="color: blue;"&gt;while &lt;/span&gt;(x != 0)
        {
            &lt;span style="color: blue;"&gt;if &lt;/span&gt;((code &amp;amp; x) != 0)
                i = FillHigh(tosend, i);
            &lt;span style="color: blue;"&gt;else
                &lt;/span&gt;i = FillLow(tosend, i);
            x &amp;gt;&amp;gt;= 1;  &lt;span style="color: green;"&gt;//next bit
        &lt;/span&gt;}
        &lt;span style="color: green;"&gt;//stop bit
        &lt;/span&gt;i = FillStartStop(tosend, i);
        MySerial.Write(tosend);
    }
    &lt;span style="color: blue;"&gt;catch &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Exception &lt;/span&gt;e)
    {
        &lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;error spi send: &amp;quot; &lt;/span&gt;+ e.Message);
    }

}

&lt;/pre&gt;

&lt;p&gt;The code starts with the creation of a ushort buffer of 522 elements. It is the max size of a message. The I create a short “x” (ok, I’m not creative for this little increment, but any developer has to use some crappy small names time to time &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2605.wlEmoticon_2D00_smile_5F00_2.png" /&gt;). I will use it as a mask to see what is the value to send.&lt;/p&gt;

&lt;p&gt;There are now 3 functions called here: FillStartStop, FillHigh and FillLow. They are like this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private int &lt;/span&gt;FillStartStop(&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;[] uBuff, &lt;span style="color: blue;"&gt;int &lt;/span&gt;iStart)
{
    &lt;span style="color: green;"&gt;//Bit Start/stop = 6 x IR + 39 x ZE
    &lt;/span&gt;&lt;span style="color: blue;"&gt;int &lt;/span&gt;inc;
    &lt;span style="color: blue;"&gt;int &lt;/span&gt;i = iStart;
    &lt;span style="color: green;"&gt;//startstop bit
    &lt;/span&gt;&lt;span style="color: blue;"&gt;for &lt;/span&gt;(inc = 0; inc &amp;lt; 6; inc++)
    {
        uBuff[i] = _high;
        i++;
    }
    &lt;span style="color: blue;"&gt;for &lt;/span&gt;(inc = 0; inc &amp;lt; 39; inc++)
    {
        uBuff[i] = _low;
        i++;
    }
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;i;
}

&lt;span style="color: blue;"&gt;private int &lt;/span&gt;FillHigh(&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;[] uBuff, &lt;span style="color: blue;"&gt;int &lt;/span&gt;iStart)
{
    &lt;span style="color: green;"&gt;//Bit high = 6 x IR + 21 x ZE
    &lt;/span&gt;&lt;span style="color: blue;"&gt;int &lt;/span&gt;inc;
    &lt;span style="color: blue;"&gt;int &lt;/span&gt;i = iStart;
    &lt;span style="color: green;"&gt;//High bit
    &lt;/span&gt;&lt;span style="color: blue;"&gt;for &lt;/span&gt;(inc = 0; inc &amp;lt; 6; inc++)
    {
        uBuff[i] = _high;
        i++;
    }
    &lt;span style="color: blue;"&gt;for &lt;/span&gt;(inc = 0; inc &amp;lt; 21; inc++)
    {
        uBuff[i] = _low;
        i++;
    }
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;i;
}

&lt;span style="color: blue;"&gt;private int &lt;/span&gt;FillLow(&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;[] uBuff, &lt;span style="color: blue;"&gt;int &lt;/span&gt;iStart)
{
    &lt;span style="color: green;"&gt;//Bit low = 6 x IR + 10 x ZE
    &lt;/span&gt;&lt;span style="color: blue;"&gt;int &lt;/span&gt;inc;
    &lt;span style="color: blue;"&gt;int &lt;/span&gt;i = iStart;
    &lt;span style="color: green;"&gt;//Low bit
    &lt;/span&gt;&lt;span style="color: blue;"&gt;for &lt;/span&gt;(inc = 0; inc &amp;lt; 6; inc++)
    {
        uBuff[i] = _high;
        i++;
    }
    &lt;span style="color: blue;"&gt;for &lt;/span&gt;(inc = 0; inc &amp;lt; 10; inc++)
    {
        uBuff[i] = _low;
        i++;
    }
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;i;
}
&lt;/pre&gt;

&lt;p&gt;Those functions take the buffer as an input and where to fill it. And then depending if it is a start/stop, low or high bit will fill the buffer correctly. For example, the low bit is 6 times IR pulses (_high = 0xFE00) and 10 times pauses (_low = 0x0000). And it return the new start position.&lt;/p&gt;

&lt;p&gt;Back to the spi_send function, after calling a first time the FillStartStop, the while loop use the “x” variable as a mask, call FillHigh if it is a high bit and FillLow if it is a low bit. And I change the mask for each bit. High bits have to be send first.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;while &lt;/span&gt;(x != 0)
{
    &lt;span style="color: blue;"&gt;if &lt;/span&gt;((code &amp;amp; x) != 0)
        i = FillHigh(tosend, i);
    &lt;span style="color: blue;"&gt;else
        &lt;/span&gt;i = FillLow(tosend, i);
    x &amp;gt;&amp;gt;= 1;  &lt;span style="color: green;"&gt;//next bit
&lt;/span&gt;}
&lt;/pre&gt;

&lt;p&gt;When all the bits are transformed and the waveform is created, the signal is sent with MySerial.Write(tosend);&lt;/p&gt;

&lt;p&gt;The MySerail object is an SPI object:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI &lt;/span&gt;MySerial;
&lt;/pre&gt;

&lt;p&gt;Initialization is done like this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;try
&lt;/span&gt;{
    &lt;span style="color: green;"&gt;//Frequency is 38KHz in the protocol
    &lt;/span&gt;&lt;span style="color: blue;"&gt;float &lt;/span&gt;t_carrier = 1 / 38.0f;
    &lt;span style="color: green;"&gt;//Reality is that there is a 2us difference in the output as there is always a 2us bit on on SPI using MOSI
    &lt;/span&gt;&lt;span style="color: blue;"&gt;float &lt;/span&gt;t_ushort = t_carrier - 2e-3f;
    &lt;span style="color: green;"&gt;//Calulate the outpout frenquency. Here = 16/(1/38 -2^-3) = 658KHz
    &lt;/span&gt;&lt;span style="color: blue;"&gt;uint &lt;/span&gt;freq = (&lt;span style="color: blue;"&gt;uint&lt;/span&gt;)(16.0f / t_ushort);

    &lt;span style="color: rgb(43, 145, 175);"&gt;SPI&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;Configuration &lt;/span&gt;Device1 = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;Configuration&lt;/span&gt;(
    &lt;span style="color: rgb(43, 145, 175);"&gt;Pins&lt;/span&gt;.GPIO_NONE, &lt;span style="color: green;"&gt;// SS-pin
    &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;,             &lt;span style="color: green;"&gt;// SS-pin active state
    &lt;/span&gt;0,                 &lt;span style="color: green;"&gt;// The setup time for the SS port
    &lt;/span&gt;0,                 &lt;span style="color: green;"&gt;// The hold time for the SS port
    &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;,              &lt;span style="color: green;"&gt;// The idle state of the clock
    &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;,             &lt;span style="color: green;"&gt;// The sampling clock edge
    &lt;/span&gt;freq,              &lt;span style="color: green;"&gt;// The SPI clock rate in KHz
    &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI_Devices&lt;/span&gt;.SPI1);   &lt;span style="color: green;"&gt;// The used SPI bus (refers to a MOSI MISO and SCLK pinset)

    &lt;/span&gt;MySerial = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPI&lt;/span&gt;(Device1);

}
&lt;span style="color: blue;"&gt;catch &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Exception &lt;/span&gt;e)
{
    &lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.Print(&lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Error: &amp;quot; &lt;/span&gt;+ e.Message);
}
&lt;/pre&gt;

&lt;p&gt;Details on on the math can be found in Mario article. This is a very precise math, the tolerance for the Lego protocol is about 30%. The official document gives the following range value:&lt;/p&gt;

&lt;p&gt;Low bit range 316 - 526 us 
  &lt;br /&gt;High bit range 526 – 947 us 

  &lt;br /&gt;Start/stop bit range 947 – 1579 us&lt;/p&gt;

&lt;p&gt;That said, it is better to be in the right domain, make it work better.&lt;/p&gt;

&lt;p&gt;So we’ve seen how to create the waveform, send it over the MOSI output. Now, let see how to use all this in a very simple way. &lt;/p&gt;

&lt;pre class="code"&gt;    &lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Program
    &lt;/span&gt;{
        &lt;span style="color: blue;"&gt;public static void &lt;/span&gt;Main()
        {
            &lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared &lt;/span&gt;myLego = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;();
            &lt;span style="color: blue;"&gt;for &lt;/span&gt;(&lt;span style="color: blue;"&gt;int &lt;/span&gt;i = 0; i &amp;lt; 10; i++)
            {
                myLego.ComboMode(&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;.BLUE_FWD, &lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoSpeed&lt;/span&gt;.RED_FWD, &lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;LegoChannel&lt;/span&gt;.CH1);
                System.Threading.&lt;span style="color: rgb(43, 145, 175);"&gt;Thread&lt;/span&gt;.Sleep(1000);
            }
        }

    }
    &lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;LegoInfrared
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;The LegoInfrared class does contains all the functions and enums I’ve explained. Here the usage is extremely simple. I create an object like this and call 10 times a forward command for both the Blue and Red output on channel 1. I wait 1 second and do it again. And the good news is that it is really working. I’m of course using the electronic schema that Mario proposed.&lt;/p&gt;

&lt;p&gt;If you are interested in the full source code of the full protocol, just let me a comment.&lt;/p&gt;

&lt;p&gt;More to come to show how to pilot it thru a web server and how to use it from another program. And again, depending of my inspiration, we will go a bit further and use sensors to raise events and be a bit smarter. Stay tune &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2605.wlEmoticon_2D00_smile_5F00_2.png" /&gt;. If you want to implement other protocols like RC5, you can directly go to Mario blog and use his code. If you have a more complex protocol like the Lego one, you’ll be able to reuse most of the implementation I’ve done. Let me know if you want the full code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10294573" width="1" height="1"&gt;</description></item><item><title>Using netduino and .NET Microframework to pilot any Lego Power Function thru Infrared (part 1)</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/04/07/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-1.aspx</link><pubDate>Sat, 07 Apr 2012 15:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10291664</guid><dc:creator>Laurelle</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10291664</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/04/07/using-netduino-and-net-microframework-to-pilot-any-lego-power-function-thru-infrared-part-1.aspx#comments</comments><description>&lt;p&gt;I&amp;rsquo;m part of &lt;a href="http://www.freelug.org/"&gt;FREELUG&lt;/a&gt;, the French Enthusiast Lego User Group. And in this group, there are lots of discussions on Lego of course. In one of the thread someone ask the question if it was possible to pilot an Lego train using the new Power Function with a PC. The need is during expo, it makes it easier to run trains, stop them in a programmatic way.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6404.image_5F00_2.png"&gt;&lt;img width="244" height="172" title="image" style="margin: 0px; display: inline; background-image: none;" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/8154.image_5F00_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I did a quick answer on the list saying that it can be quite easy if the protocol was not too complex and the IR technology used was close to &lt;a href="http://www.sbprojects.com/knowledge/ir/rc5.php"&gt;RC5 from Philips&lt;/a&gt;. A small oscillator behind a serial or parallel port would do the trick. &lt;a href="http://www.philohome.com"&gt;Philo&lt;/a&gt;, one of the FREELUG member answer me with a link to &lt;a href="http://www.philohome.com/pf/LEGO_Power_Functions_RC.pdf"&gt;the protocol&lt;/a&gt;. And also tell me it should not be as easy as I was thinking. And he was more than right! No real way to make this work with a simple serial or parallel port on a PC. The protocol is more complex and need quite a bit of work to implement. I&amp;rsquo;ll come later on the first explanation on how to do it.&lt;/p&gt;
&lt;p&gt;So I decided to see if it was possible to implement this on &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/09/netduino-board-geek-tool-for-net-microframework.aspx"&gt;netduino&lt;/a&gt; using .NET Microframework. this board has lots of IO, analogic and digital, do implement busses like I2C but also SPI. As any project, I started my project with my friend &lt;a href="http://www.bing.com/"&gt;Bing&lt;/a&gt;. And start searching for similar projects. And I found &lt;a href="http://highfieldtales.wordpress.com/"&gt;Mario Vernari&lt;/a&gt; who I&amp;rsquo;ve mentioned in my &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/03/31/using-2-identical-i2c-device-on-the-same-i2c-bus-solution-working-better.aspx"&gt;previous post&lt;/a&gt; who was doing something similar. And we&amp;rsquo;ve exchange couple of emails to find a good way to implement an Infrared emitter using .NET Microframework. We will create the wave form in a buffer and then send it thru the MOSI port of an SPI port linked to the infrared led. So I will use &lt;a href="http://highfieldtales.wordpress.com/2012/02/07/infrared-transmitter-driver-for-netduino/"&gt;the ideas and implementation Mario explain in his blog&lt;/a&gt; to pilot the Lego Power Function.&lt;/p&gt;
&lt;p&gt;I let go thru Mario article to get the basics of the IR protocol in general. And I will focus here on the specific Lego implementation and of course the specific code to make it work.&lt;/p&gt;
&lt;p&gt;Reading the 14 pages of the Lego protocol, we learn that the IR signals are using 38 kHz cycles. An IR Mark is 6 on and off signals as shown in the next picture&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/2262.image_5F00_4.png"&gt;&lt;img width="312" height="218" title="image" style="display: inline; background-image: none;" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0525.image_5F00_thumb_5F00_1.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Each message will start and stop with a Start/Stop bit. This bit is 6 IR Mark and 39 pauses. So if I represent it in a binary way it will be:&lt;/p&gt;
&lt;p&gt;101010101010000000000000000000000000000000000000000000000000000000000000000000000000000000&lt;/p&gt;
&lt;p&gt;As Mario described in his post, we will use ushort to create the wave length. So in this case it will looks like&lt;/p&gt;
&lt;p&gt;0xFF00 0xFF00 0xFF00 0XFF00 0xFF00 0xFF00 and 39 times 0x0000&lt;/p&gt;
&lt;p&gt;Reality is a bit different as when using MOSI on a SPI to output a signal it is always a 1 for couple of &amp;micro; seconds. So the right value to use is 0xFE00&lt;/p&gt;
&lt;p&gt;The low bit is working the same way, it is 6 IR Mark and 10 cycles of pause, the high one 6 IR Mark and 21 cycles of pause.&lt;/p&gt;
&lt;p&gt;So if I want to send the binary value 10011 I will send 6 IR Marks, 21 pauses, 6 IR Marks, 10 pauses, 6 IR Marks, 10 pauses, 6 IR Marks, 21 pauses, 6 IR Marks, 21 pauses. And I will create a ushort buffer which will contains 6 times 0xFE00, 21 times 0x0000, 6 times 0xFE00, 10 times 0x0000, 6 times 0xFE00, 10 times 0x0000, 6 times 0xFE00, 21 times 0x0000, 6 times 0xFE00, 21 times 0x0000&lt;/p&gt;
&lt;p&gt;All this make the Lego protocol complex compare to the RC5 and other similar protocols where the Low bit and high bits are usually the same size, the IR Mark is just inverted and the pause same size as the IR Mark.&lt;/p&gt;
&lt;p&gt;Now let have a look at the protocol itself.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3252.image_5F00_6.png"&gt;&lt;img width="618" height="55" title="image" style="display: inline; background-image: none;" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6567.image_5F00_thumb_5F00_2.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The protocol start and stop with our Start/Stop bit describe up in the article. And then have 4 nibble. One nibble is a 4 bit data. The last nibble is used to to a check sum and is called LRC LLLL = 0xF xor Nibble 1 xor Nibble 2 xor Nibble 3.&lt;/p&gt;
&lt;p&gt;There are 4 channels possible going from 1 to 4 represented as CC from 0 to 3.&lt;/p&gt;
&lt;p&gt;a is not used in this protocol for the moment and kept for a future implementation. So it has to be set to 0.&lt;/p&gt;
&lt;p&gt;E is 0 for most modes except one specific mode (PWM)&lt;/p&gt;
&lt;p&gt;Toggle is an interesting one. The value has to change each time a new command is sent. So if the first time you send a command on a specific Channel (let say 1), it is 0, the next command send on Channel 1 will have to set Toggle as 1.&lt;/p&gt;
&lt;p&gt;The Power Function have different modes available (MMM):&lt;/p&gt;
&lt;p&gt;000 Not used in PF RC Receiver &lt;br /&gt;001 Combo direct (timeout) &lt;br /&gt;010 Single pin continuous (no timeout) &lt;br /&gt;011 Single pin timeout &lt;br /&gt;1xx Single output&lt;/p&gt;
&lt;p&gt;To know which mode is doing what, just refer to the protocol. I will detail the Combo direct (timeout) mode as an example for the rest of the article. It is easy to understand how it is working. The others are not much more complex and the logic is the same.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4403.image_5F00_8.png"&gt;&lt;img width="621" height="61" title="image" style="display: inline; background-image: none;" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7043.image_5F00_thumb_5F00_3.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Mode (MMM) here is 001. Channel (CC) will vary form 0 to 3 depending which channel you want to pilot. So here, the Data nibble is split into 2 parts BB and AA. The documentation give this:&lt;/p&gt;
&lt;p&gt;B output BB,, called Red in all receivers&lt;/p&gt;
&lt;p&gt;00xx Float output B &lt;br /&gt;01xx Forward on output B &lt;br /&gt;10xx Backward on output B &lt;br /&gt;11xx Brake output B&lt;/p&gt;
&lt;p&gt;A output AA, called Blue in all receivers&lt;/p&gt;
&lt;p&gt;xx00 Float output A &lt;br /&gt;xx01 Forward on output A &lt;br /&gt;xx10 Backward on output A &lt;br /&gt;xx11 Brake output A&lt;/p&gt;
&lt;p&gt;And an interesting information is that Toggle bit is not verified on receiver. So if you don&amp;rsquo;t want to implement it, it&amp;rsquo;s possible.&lt;/p&gt;
&lt;p&gt;So it&amp;rsquo;s time to write some code &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6567.wlEmoticon_2D00_smile_5F00_2.png" /&gt; Let start with couple of enums to facilitate the usage:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: green;"&gt;//mode &lt;/span&gt;&lt;span style="color: blue;"&gt;public enum &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;LegoMode &lt;/span&gt;{
    COMBO_DIRECT_MODE = 0x1,
    SINGLE_PIN_CONTINUOUS = 0x2,
    SINGLE_PIN_TIMEOUT = 0x3,
    SINGLE_OUTPUT = 0x4
};
&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="color: green;"&gt;//speed &lt;/span&gt;&lt;span style="color: blue;"&gt;public enum &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;LegoSpeed &lt;/span&gt;{
    RED_FLT = 0x0,
    RED_FWD = 0x1,
    RED_REV = 0x2,
    RED_BRK = 0x3,
    BLUE_FLT = 0x0,
    BLUE_FWD = 0x4,
    BLUE_REV = 0x8,
    BLUE_BRK = 0xC
};

&lt;span style="color: green;"&gt;//channel &lt;/span&gt;&lt;span style="color: blue;"&gt;public enum &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;LegoChannel &lt;/span&gt;{
    CH1 = 0x0,
    CH2 = 0x1,
    CH3 = 0x2,
    CH4 = 0x3
};
&lt;/pre&gt;
&lt;p&gt;The LegoMode one will be used to setup the mode (MMM), the LegoSpeed for the AA and BB output and the LegoChannel to select the Channel.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private uint&lt;/span&gt;[] toggle = &lt;span style="color: blue;"&gt;new uint&lt;/span&gt;[] { 0, 0, 0, 0 };
&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public void &lt;/span&gt;ComboMode(&lt;span style="color: #2b91af;"&gt;LegoSpeed &lt;/span&gt;blue_speed, &lt;span style="color: #2b91af;"&gt;LegoSpeed &lt;/span&gt;red_speed, &lt;span style="color: #2b91af;"&gt;LegoChannel &lt;/span&gt;channel)
{
    &lt;span style="color: blue;"&gt;uint &lt;/span&gt;nib1, nib2, nib3, nib4;

    &lt;span style="color: green;"&gt;//set nibs &lt;/span&gt;nib1 = toggle[(&lt;span style="color: blue;"&gt;uint&lt;/span&gt;)channel] | (&lt;span style="color: blue;"&gt;uint&lt;/span&gt;)channel;
    &lt;span style="color: green;"&gt;//nib1 = (uint)channel; &lt;/span&gt;nib2 = (&lt;span style="color: blue;"&gt;uint&lt;/span&gt;)&lt;span style="color: #2b91af;"&gt;LegoMode&lt;/span&gt;.COMBO_DIRECT_MODE;
    nib3 = (&lt;span style="color: blue;"&gt;uint&lt;/span&gt;)blue_speed | (&lt;span style="color: blue;"&gt;uint&lt;/span&gt;)red_speed;
    nib4 = 0xf ^ nib1 ^ nib2 ^ nib3;

    sendMessage((&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;)nib1, (&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;)nib2, (&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;)nib3, (&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;)nib4, (&lt;span style="color: blue;"&gt;uint&lt;/span&gt;)channel);
}
&lt;/pre&gt;
&lt;p&gt;I have defined a toggle table which will contain the value of the toggling. The function ComboModo takes as argument, the channel and the AA and BB parameters.&lt;/p&gt;
&lt;p&gt;The code is quite straight forward, I build the 4 nibbles like in the description.&lt;/p&gt;
&lt;p&gt;nib1 contains the Toggle plus escape (0) plus the channel. Toggle is not mandatory in this one but I&amp;rsquo;ve implemented to show you how to do it. and the values the Toggle will take will be in binary 1000 or 0000 so 8 or 0 in decimal.&lt;/p&gt;
&lt;p&gt;nb2 is E (which is 0) and the Mode (MMM) which is 1 in our case.&lt;/p&gt;
&lt;p&gt;nib3 combine AA and BB to select the Blue and Red orders.&lt;/p&gt;
&lt;p&gt;nib4 is the check sum.&lt;/p&gt;
&lt;p&gt;And then I call a function called sendMessage. I&amp;rsquo;ve build all the modes the same way, implementing simply the protocol.&lt;/p&gt;
&lt;p&gt;Now, let have a look at the sendMessage function:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;sendMessage(&lt;span style="color: blue;"&gt;ushort &lt;/span&gt;nib1, &lt;span style="color: blue;"&gt;ushort &lt;/span&gt;nib2, &lt;span style="color: blue;"&gt;ushort &lt;/span&gt;nib3, &lt;span style="color: blue;"&gt;ushort &lt;/span&gt;nib4, &lt;span style="color: blue;"&gt;uint &lt;/span&gt;channel)
{
    &lt;span style="color: blue;"&gt;ushort &lt;/span&gt;code = (&lt;span style="color: blue;"&gt;ushort&lt;/span&gt;)((nib1 &amp;lt;&amp;lt; 12) | (nib2 &amp;lt;&amp;lt; 8) | (nib3 &amp;lt;&amp;lt; 4) | nib4);
    &lt;span style="color: blue;"&gt;for &lt;/span&gt;(&lt;span style="color: blue;"&gt;uint &lt;/span&gt;i = 0; i &amp;lt; 6; i++)
    {
        message_pause(channel, i);

        spi_send(code);
    }
    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(toggle[(&lt;span style="color: blue;"&gt;int&lt;/span&gt;)channel] == 0)
        toggle[(&lt;span style="color: blue;"&gt;int&lt;/span&gt;)channel] = 8;
    &lt;span style="color: blue;"&gt;else &lt;/span&gt;toggle[(&lt;span style="color: blue;"&gt;int&lt;/span&gt;)channel] = 0;

}
&lt;/pre&gt;
&lt;p&gt;4 nibbles of 4 bits is 16 bits so a ushort. And I&amp;rsquo;m building this ushort simply with all the nibbles. OK, the protocol is a bit more complex than only sending 1 time a command. Each command has to be sent 5 times. What make the protocol not easy is that you have to wait different amount of time depending on the channel and the number of time you&amp;rsquo;ve already send a command! That is the job of the message_pause function. The spi_send send the code &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6567.wlEmoticon_2D00_smile_5F00_2.png" /&gt;. The rest is about toggling the toggle bit of the channel.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s it for today. In the next blog post, I&amp;rsquo;ll continue to go more in the details, show the implementation of the missing functions. And when I&amp;rsquo;ll finish to explain all the protocol code, I&amp;rsquo;ll go a bit further with a way to remotely using a web page or equivalent send commands to the netduino board which will send the IR command. And if I have more time, I will also implement sensors to detect if a train or a vehicle is on a specific place. This will be extremely easy as I&amp;rsquo;ve already explain how to &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/02/17/using-basic-io-with-net-microframework.aspx"&gt;use sensors like this&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10291664" width="1" height="1"&gt;</description></item><item><title>Using 2 identical I2C device on the same I2C bus (solution working better)</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/03/31/using-2-identical-i2c-device-on-the-same-i2c-bus-solution-working-better.aspx</link><pubDate>Sat, 31 Mar 2012 07:15:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10289611</guid><dc:creator>Laurelle</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10289611</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/03/31/using-2-identical-i2c-device-on-the-same-i2c-bus-solution-working-better.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/laurelle/archive/2012/02/24/using-2-identical-i2c-device-on-the-same-i2c-bus.aspx"&gt;In one of my past posts&lt;/a&gt;, I’ve try to use 2 identical I2C devices on the same bus. &lt;a href="http://highfieldtales.wordpress.com/"&gt;Mario Vernari&lt;/a&gt; who help me for another problem on &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/10/12/lighting-my-lego-city-using-net-microframework.aspx"&gt;my Lego city&lt;/a&gt; and with whom I’ve exchange a bit to find other solutions help me there two. Mario is coming from the electronic side and I come from the software side.&amp;#160; So he can correct me when I’m wrong with my electronic &lt;img class="wlEmoticon wlEmoticon-smile" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3771.wlEmoticon_2D00_smile_5F00_2.png" /&gt;. And I was quite wrong with the previous solution trying to switch on and off the power of the sensors. Mario gave me couple of good reasons:&lt;/p&gt;  &lt;p&gt;“First off, any silicon embeds diodes, thus -even unpowering a device- there's a non-zero current flowing into. In this case, through the SCL/SDA lines, via pull-ups. &lt;/p&gt;  &lt;p&gt;Secondly, you're using sensors, and they typically need a certain time to settle their internal state, reach the steadiness, etc. There are also &amp;quot;smarter&amp;quot; sensors, which perform a kind of auto-calibration when they are powered up. If you switch off, you'll lose those benefits.”&lt;/p&gt;  &lt;p&gt;And he gave me a tip: “use a 74HC4052”. So lets go and see what it is. It’s a switch for analog signals. You have 4 inputs (named Ya, a = 0 to 3) and 1 output (named Z). But they are 2 ways. So when you have selected one line, you can send signals in both ways. And there are 2 of those in the chip (naming will be nY and nZ, n = 1 and 2). &lt;/p&gt;  &lt;p&gt;That allow to switch the overall SDA and SCL bus to the right sensor. And this will allow to pilot up to 4 identical sensors. The selection of the line is made by the S0 and S1 with the following rule:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="100"&gt;&lt;strong&gt;Input&lt;/strong&gt; &lt;/td&gt;        &lt;td valign="top" width="100"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="100"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="100"&gt;&lt;strong&gt;Channel on&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;&lt;strong&gt;E&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="100"&gt;&lt;strong&gt;S1&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="100"&gt;&lt;strong&gt;S0&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="100"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;L&lt;/td&gt;        &lt;td valign="top" width="100"&gt;L&lt;/td&gt;        &lt;td valign="top" width="100"&gt;L&lt;/td&gt;        &lt;td valign="top" width="100"&gt;nY0 and nZ&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;L&lt;/td&gt;        &lt;td valign="top" width="100"&gt;L&lt;/td&gt;        &lt;td valign="top" width="100"&gt;H&lt;/td&gt;        &lt;td valign="top" width="100"&gt;nY1 and nZ&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;L&lt;/td&gt;        &lt;td valign="top" width="100"&gt;H&lt;/td&gt;        &lt;td valign="top" width="100"&gt;L&lt;/td&gt;        &lt;td valign="top" width="100"&gt;nY2 and nZ&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;L&lt;/td&gt;        &lt;td valign="top" width="100"&gt;H&lt;/td&gt;        &lt;td valign="top" width="100"&gt;H&lt;/td&gt;        &lt;td valign="top" width="100"&gt;nY3 and nZ&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;H&lt;/td&gt;        &lt;td valign="top" width="100"&gt;X&lt;/td&gt;        &lt;td valign="top" width="100"&gt;X&lt;/td&gt;        &lt;td valign="top" width="100"&gt;none&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;      &lt;p&gt;So regarding the code I wrote for the previous post, it will remain the same! It will work exactly the same way. What is changing is the electronic part. And here is the new design:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4745.image_5F00_2.png"&gt;&lt;img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/1207.image_5F00_thumb.png" width="469" height="413" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Mario also give me the following advice: “Note that when you cut off a device, you should provide the pullups anyway”. So That’s what I did by putting the pullups for each component.&lt;/p&gt;  &lt;p&gt;Now it’s working and much better as the line switch is really fast and there is no need to wait for a long time to read the data. So thanks Mario for the tip!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10289611" width="1" height="1"&gt;</description></item><item><title>Create your own mobile video recorder or animation stand</title><link>http://blogs.msdn.com/b/laurelle/archive/2012/03/03/create-your-own-mobile-video-recorder-or-animation-stand.aspx</link><pubDate>Sat, 03 Mar 2012 15:47:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10277003</guid><dc:creator>Laurelle</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/laurelle/rsscomments.aspx?WeblogPostID=10277003</wfw:commentRss><comments>http://blogs.msdn.com/b/laurelle/archive/2012/03/03/create-your-own-mobile-video-recorder-or-animation-stand.aspx#comments</comments><description>&lt;p&gt;Long time ago, when I was doing lots of demos and used to have to display mobile phone like smartphone of Windows Embedded devices, I needed a mobile video recorder to be able to display them. Of course, I though using a webcam but the webcam alone does not allow you to demo the device. And I figure out that those kind of animation stand costs lots of money and were not easy to transport and very costly to rent. So I decided to build my own. And I recently use it again as I had to demo my Windows Phone 7 device and also .NET Microframework device like &lt;a href="http://blogs.msdn.com/b/laurelle/archive/2011/09/09/netduino-board-geek-tool-for-net-microframework.aspx" target="_blank"&gt;netduino&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The main features I needed were:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;easy to transport &lt;/li&gt;    &lt;li&gt;very cheap &lt;/li&gt;    &lt;li&gt;using my PC if needed like using a webcam &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So I came to the following solution:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3010.WP_5F00_000047_5F00_2.jpg"&gt;&lt;img title="WP_000047" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="WP_000047" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6237.WP_5F00_000047_5F00_thumb.jpg" width="411" height="547" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Everything can be unplugged and transported easily. It is using a webcam and simple plastic pipes. It costs only couple of euros ($ for our non European friends &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7217.wlEmoticon_2D00_smile_5F00_2.png" /&gt;) to build. On the software side, I used a DirectX sample which I customize to create my own application. &lt;/p&gt;  &lt;p&gt;And I sued this solution very recently during the French TechDays where I did a demo of .NET Microframework. The equipment in place was not working and I was glad to have my own mobile video recorder with me &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7217.wlEmoticon_2D00_smile_5F00_2.png" /&gt; So, I use it as you’ll be able to see when the video will be available.&lt;/p&gt;  &lt;p&gt;so let start with the hardware part. what you’ll need:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6675.image_5F00_4.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4604.image_5F00_thumb_5F00_1.png" width="510" height="297" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now to build it, you’ll need to cut the following parts:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Cut a length of 160 mm in the Ø 20 pipe &lt;/li&gt;    &lt;li&gt;Cut a length of 60 mm in the Ø 20 pipe &lt;/li&gt;    &lt;li&gt;Cut a length of 200 mm in the Ø 20 pipe &lt;/li&gt;    &lt;li&gt;Cut a length of 150 mm in the Ø 20 pipe &lt;/li&gt;    &lt;li&gt;Cut a length of 200 mm in the Ø 14 pipe &lt;/li&gt;    &lt;li&gt;Cut a length of 130 mm in the Ø 14 pipe &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;And here is the technical schema (forget about the webcam yet):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4705.image_5F00_6.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6443.image_5F00_thumb_5F00_2.png" width="518" height="306" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;With this you can basically adapt any camera. You may recognize on this picture an old Philips webcam and on the one I pick recently a nice Microsoft LifeCam Cinema. A perfect HD camera with some good feature to tune the brightness. Also, it is very easy to install the camera on the pipes.&lt;/p&gt;  &lt;p&gt;&lt;img src="http://www.microsoft.com/hardware/_base_v1//products/lifecam-cinema/ic_lcc_sm.png" /&gt;&lt;/p&gt;  &lt;p&gt;Step 1: glue assembly&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Glue the 160 mm Ø 20 pipe and glue the 60 mm Ø 20 pipe with the T &lt;/li&gt;    &lt;li&gt;Glue the bend Ø 20 pipe at the end of the 30 mm Ø 20 pipe &lt;/li&gt;    &lt;li&gt;Be sure the T top is vertical &lt;/li&gt;    &lt;li&gt;Be sure the bend is horizontal &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6076.image_5F00_8.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/0675.image_5F00_thumb_5F00_3.png" width="517" height="132" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Step 2: soft assemblies&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Place scotch in the length around the 200 mm Ø 14 pipe on 150 mm. Place scotch until the 200 mm Ø 14 pipe go well and block when placed in the 150 mm Ø 20 pipe. This will allow to move up and down the webcam. &lt;/li&gt;    &lt;li&gt;You can glue or use scotch to place the bend Ø 14 and the end of the 200 mm Ø 14 pipe. Glue or scotch it at the other end you place the scotch from the previous step &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/4035.image_5F00_10.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6175.image_5F00_thumb_5F00_4.png" width="525" height="212" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;To finalize this part, place the stop diameter Ø 14 pipe on the 200 mm Ø 14 pipe and place this pipe in the 150 mm Ø 20 pipe &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;On the software side, I’m using a simplified version of the DirectX SDK AMCAP example. You can easily select the webcam you want (if you have an integrated webcam and the external one, make it easy to choose) and setup the settings in the capture filter like the autofocus, the resolution, etc.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/6646.image_5F00_12.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/3010.image_5F00_thumb_5F00_5.png" width="413" height="154" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you want this software let me know and write me at &lt;a href="mailto:laurelle@microsoft.com"&gt;laurelle@microsoft.com&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;I hope you’ve enjoy this tutorial to create hardware which is not electronic this time &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Sourire" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-39-metablogapi/7217.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10277003" width="1" height="1"&gt;</description></item></channel></rss>