tag:blogger.com,1999:blog-20732706121332014072024-02-19T16:22:00.481+00:00Arduino, Electronics and ProgrammingLearn about Arduino and building Robot!!!Unknownnoreply@blogger.comBlogger34125tag:blogger.com,1999:blog-2073270612133201407.post-82191482804534316452013-12-04T16:58:00.005+00:002013-12-07T01:19:33.327+00:00Arduino ISP Code to flash the Turnigy 9X// this sketch turns the Arduino into a AVRISP<br />
// using the following pins:<br />
// 10: slave reset<br />
// 11: MOSI<br />
// 12: MISO<br />
// 13: SCK// Put an LED (with resistor) on the following pins:<br />
// 9: Heartbeat – shows the programmer is running<br />
// 8: Error – Lights up if something goes wrong (use red if that makes sense)<br />
// 7: Programming – In communication with the slave<br />
//<br />
// October 2010 by Randall Bohn<br />
// – Write to EEPROM > 256 bytes<br />
// – Better use of LEDs:<br />
// — Flash LED_PMODE on each flash commit<br />
// — Flash LED_PMODE while writing EEPROM (both give visual feedback of writing progress)<br />
// – Light LED_ERR whenever we hit a STK_NOSYNC. Turn it off when back in sync.<br />
//<br />
// October 2009 by David A. Mellis<br />
// – Added support for the read signature command<br />
//<br />
// February 2009 by Randall Bohn<br />
// – Added support for writing to EEPROM (what took so long?)<br />
// Windows users should consider WinAVR's avrdude instead of the<br />
// avrdude included with Arduino software.<br />
//<br />
// January 2008 by Randall Bohn<br />
// – Thanks to Amplificar for helping me with the STK500 protocol<br />
// – The AVRISP/STK500 (mk I) protocol is used in the arduino bootloader<br />
// – The SPI functions herein were developed for the AVR910_ARD programmer<br />
// – More information at http://code.google.com/p/mega-isp<br />
#include "pins_arduino.h" // defines SS,MOSI,MISO,SCK<br />
#define SCK 13<br />
#define MISO 12<br />
#define MOSI 11<br />
#define RESET 10<br />
#define LED_HB 9<br />
#define LED_ERR 8<br />
#define LED_PMODE 7<br />
#define PROG_FLICKER true<br />
#define HWVER 2<br />
#define SWMAJ 1<br />
#define SWMIN 18// STK Definitions<br />
#define STK_OK 0x10<br />
#define STK_FAILED 0x11<br />
#define STK_UNKNOWN 0x12<br />
#define STK_INSYNC 0x14<br />
#define STK_NOSYNC 0x15<br />
#define CRC_EOP 0x20 //ok it is a space…<br />
void pulse(int pin, int times);<br />
void setup() {<br />
<br />
Serial.begin(19200);<br />
pinMode(LED_PMODE, OUTPUT);<br />
pulse(LED_PMODE, 2);<br />
pinMode(LED_ERR, OUTPUT);<br />
pulse(LED_ERR, 2);<br />
pinMode(LED_HB, OUTPUT);<br />
pulse(LED_HB, 2);<br />
}<br />
int error=0;<br />
int pmode=0;<br />
// address for reading and writing, set by 'U' command<br />
int here;<br />
uint8_t buff[256]; // global block storage<br />
#define beget16(addr) (*addr * 256 + *(addr+1) )<br />
typedef struct param {<br />
uint8_t devicecode;<br />
uint8_t revision;<br />
uint8_t progtype;<br />
uint8_t parmode;<br />
uint8_t polling;<br />
uint8_t selftimed;<br />
uint8_t lockbytes;<br />
uint8_t fusebytes;<br />
int flashpoll;<br />
int eeprompoll;<br />
int pagesize;<br />
int eepromsize;<br />
int flashsize;<br />
}parameter;<br />
<br />
parameter param;// this provides a heartbeat on pin 9, so you can tell the software is running.<br />
uint8_t hbval=128;<br />
int8_t hbdelta=8;<br />
void heartbeat() {<br />
if (hbval > 192) hbdelta = -hbdelta;<br />
if (hbval < 32) hbdelta = -hbdelta;<br />
hbval += hbdelta;<br />
analogWrite(LED_HB, hbval);<br />
delay(40);<br />
}<br />
<br />
void loop(void) {<br />
// is pmode active?<br />
if (pmode) digitalWrite(LED_PMODE, HIGH);<br />
else digitalWrite(LED_PMODE, LOW);<br />
// is there an error?<br />
if (error) digitalWrite(LED_ERR, HIGH);<br />
else digitalWrite(LED_ERR, LOW);// light the heartbeat LED<br />
heartbeat();<br />
if (Serial.available()) {<br />
avrisp();<br />
}<br />
}<br />
<br />
uint8_t getch() {<br />
while(!Serial.available());<br />
return Serial.read();<br />
}<br />
void fill(int n) {<br />
for (int x = 0; x < n; x++) {<br />
buff[x] = getch();<br />
}<br />
}<br />
<br />
#define PTIME 30<br />
void pulse(int pin, int times) {<br />
do {<br />
digitalWrite(pin, HIGH);<br />
delay(PTIME);<br />
digitalWrite(pin, LOW);<br />
delay(PTIME);<br />
}while (times--);<br />
<br />
}<br />
<br />
void prog_lamp(int state) {<br />
if(PROG_FLICKER)<br />
digitalWrite(LED_PMODE, state);<br />
}<br />
<br />
void spi_init() {<br />
uint8_t x;<br />
SPCR = 0x53;<br />
x=SPSR;<br />
x=SPDR;<br />
}<br />
<br />
void spi_wait() {<br />
do {<br />
}<br />
while (!(SPSR & (1 << SPIF)));<br />
}uint8_t spi_send(uint8_t b) {<br />
uint8_t reply;<br />
SPDR=b;<br />
spi_wait();<br />
reply = SPDR;<br />
return reply;<br />
}<br />
<br />
uint8_t spi_transaction(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {<br />
uint8_t n;<br />
spi_send(a);<br />
n=spi_send(b);<br />
//if (n != a) error = -1;<br />
n=spi_send(c);<br />
return spi_send(d);<br />
}<br />
<br />
void empty_reply() {<br />
if (CRC_EOP == getch()) {<br />
Serial.print((char)STK_INSYNC);<br />
Serial.print((char)STK_OK);<br />
} else {<br />
error++;<br />
Serial.print((char)STK_NOSYNC);<br />
}<br />
}<br />
void breply(uint8_t b) {<br />
if (CRC_EOP == getch()) {<br />
Serial.print((char)STK_INSYNC);<br />
Serial.print((char)b);<br />
Serial.print((char)STK_OK);<br />
}<br />
else {<br />
error++;<br />
Serial.print((char)STK_NOSYNC);<br />
}<br />
}<br />
<br />
void get_version(uint8_t c) {<br />
switch(c) {<br />
case 0x80:<br />
breply(HWVER);<br />
break;<br />
case 0x81:<br />
breply(SWMAJ);<br />
break;<br />
case 0x82:<br />
breply(SWMIN);<br />
break;<br />
case 0x93:<br />
breply('S'); // serial programmer<br />
break;<br />
default:<br />
breply(0);<br />
}<br />
}<br />
<br />
void set_parameters() {<br />
// call this after reading paramter packet into buff[]<br />
param.devicecode = buff[0];<br />
param.revision = buff[1];<br />
param.progtype = buff[2];<br />
param.parmode = buff[3];<br />
param.polling = buff[4];<br />
param.selftimed = buff[5];<br />
param.lockbytes = buff[6];<br />
param.fusebytes = buff[7];<br />
param.flashpoll = buff[8];<br />
// ignore buff[9] (= buff[8])<br />
// following are 16 bits (big endian)<br />
param.eeprompoll = beget16(&buff[10]);<br />
param.pagesize = beget16(&buff[12]);<br />
param.eepromsize = beget16(&buff[14]);<br />
<br />
// 32 bits flashsize (big endian)<br />
param.flashsize = buff[16] * 0x01000000<br />
+ buff[17] * 0x00010000<br />
+ buff[18] * 0x00000100<br />
+ buff[19];<br />
<br />
}<br />
<br />
void start_pmode() {<br />
spi_init();<br />
// following delays may not work on all targets…<br />
pinMode(RESET, OUTPUT);<br />
digitalWrite(RESET, HIGH);<br />
pinMode(SCK, OUTPUT);<br />
digitalWrite(SCK, LOW);<br />
delay(50);<br />
digitalWrite(RESET, LOW);<br />
delay(50);<br />
pinMode(MISO, INPUT);<br />
pinMode(MOSI, OUTPUT);<br />
spi_transaction(0xAC, 0x53, 0x00, 0x00);<br />
pmode = 1;<br />
}<br />
<br />
void end_pmode() {<br />
pinMode(MISO, INPUT);<br />
pinMode(MOSI, INPUT);<br />
pinMode(SCK, INPUT);<br />
pinMode(RESET, INPUT);<br />
pmode = 0;<br />
}<br />
<br />
void universal() {<br />
int w;<br />
uint8_t ch;<br />
<br />
fill(4);<br />
ch = spi_transaction(buff[0], buff[1], buff[2], buff[3]);<br />
breply(ch);<br />
}<br />
<br />
void flash(uint8_t hilo, int addr, uint8_t data) {<br />
spi_transaction(0x40+8*hilo,<br />
addr>>8 & 0xFF,<br />
addr & 0xFF,<br />
data);<br />
}<br />
void commit(int addr) {<br />
if (PROG_FLICKER) prog_lamp(LOW);<br />
spi_transaction(0x4C, (addr >> 8) & 0xFF, addr & 0xFF, 0);<br />
if (PROG_FLICKER) {<br />
delay(PTIME);<br />
prog_lamp(HIGH);<br />
}<br />
}<br />
<br />
//#define _current_page(x) (here & 0xFFFFE0)<br />
int current_page(int addr) {<br />
if (param.pagesize == 32) return here & 0xFFFFFFF0;<br />
if (param.pagesize == 64) return here & 0xFFFFFFE0;<br />
if (param.pagesize == 128) return here & 0xFFFFFFC0;<br />
if (param.pagesize == 256) return here & 0xFFFFFF80;<br />
return here;<br />
}<br />
<br />
void write_flash(int length) {<br />
fill(length);<br />
if (CRC_EOP == getch()) {<br />
Serial.print((char) STK_INSYNC);<br />
Serial.print((char) write_flash_pages(length));<br />
} else {<br />
error++;<br />
Serial.print((char) STK_NOSYNC);<br />
}<br />
}<br />
<br />
uint8_t write_flash_pages(int length) {<br />
int x = 0;<br />
int page = current_page(here);<br />
while (x < length) {<br />
if (page != current_page(here)) {<br />
commit(page);<br />
page = current_page(here);<br />
}<br />
flash(LOW, here, buff[x++]);<br />
flash(HIGH, here, buff[x++]);<br />
here++;<br />
}<br />
<br />
commit(page);<br />
<br />
return STK_OK;<br />
}<br />
<br />
#define EECHUNK (32)<br />
uint8_t write_eeprom(int length) {<br />
// here is a word address, get the byte address<br />
int start = here * 2;<br />
int remaining = length;<br />
if (length > param.eepromsize) {<br />
error++;<br />
return STK_FAILED;<br />
}<br />
while (remaining > EECHUNK) {<br />
write_eeprom_chunk(start, EECHUNK);<br />
start += EECHUNK;<br />
remaining -= EECHUNK;<br />
}<br />
write_eeprom_chunk(start, remaining);<br />
return STK_OK;<br />
}<br />
// write (length) bytes, (start) is a byte address<br />
uint8_t write_eeprom_chunk(int start, int length) {<br />
// this writes byte-by-byte,<br />
// page writing may be faster (4 bytes at a time)<br />
fill(length);<br />
prog_lamp(LOW);<br />
for (int x = 0; x < length; x++) {<br />
int addr = start+x;<br />
spi_transaction(0xC0, (addr>>8) & 0xFF, addr & 0xFF, buff[x]);<br />
delay(45);<br />
}<br />
prog_lamp(HIGH);<br />
return STK_OK;<br />
}<br />
<br />
void program_page() {<br />
char result = (char) STK_FAILED;<br />
int length = 256 * getch() + getch();<br />
char memtype = getch();<br />
// flash memory @here, (length) bytes<br />
if (memtype == 'F') {<br />
write_flash(length);<br />
return;<br />
}<br />
if (memtype == 'E') {<br />
result = (char)write_eeprom(length);<br />
if (CRC_EOP == getch()) {<br />
Serial.print((char) STK_INSYNC);<br />
Serial.print(result);<br />
} else {<br />
error++;<br />
Serial.print((char) STK_NOSYNC);<br />
}<br />
return;<br />
}<br />
Serial.print((char)STK_FAILED);<br />
return;<br />
}<br />
<br />
uint8_t flash_read(uint8_t hilo, int addr) {<br />
return spi_transaction(0x20 + hilo * 8,<br />
(addr >> 8) & 0xFF,<br />
addr & 0xFF,<br />
0);<br />
}<br />
<br />
char flash_read_page(int length) {<br />
for (int x = 0; x < length; x+=2) {<br />
uint8_t low = flash_read(LOW, here);<br />
Serial.print((char) low);<br />
uint8_t high = flash_read(HIGH, here);<br />
Serial.print((char) high);<br />
here++;<br />
}<br />
return STK_OK;<br />
}<br />
<br />
char eeprom_read_page(int length) {<br />
// here again we have a word address<br />
int start = here * 2;<br />
for (int x = 0; x < length; x++) {<br />
int addr = start + x;<br />
uint8_t ee = spi_transaction(0xA0, (addr >> 8) & 0xFF, addr & 0xFF, 0xFF);<br />
Serial.print((char) ee);<br />
}<br />
return STK_OK;<br />
}<br />
<br />
void read_page() {<br />
char result = (char)STK_FAILED;<br />
int length = 256 * getch() + getch();<br />
char memtype = getch();<br />
if (CRC_EOP != getch()) {<br />
error++;<br />
Serial.print((char) STK_NOSYNC);<br />
return;<br />
}<br />
Serial.print((char) STK_INSYNC);<br />
if (memtype == 'F') result = flash_read_page(length);<br />
if (memtype == 'E') result = eeprom_read_page(length);<br />
Serial.print(result);<br />
return;<br />
}<br />
<br />
void read_signature() {<br />
if (CRC_EOP != getch()) {<br />
error++;<br />
Serial.print((char) STK_NOSYNC);<br />
return;<br />
}<br />
Serial.print((char) STK_INSYNC);<br />
uint8_t high = spi_transaction(0x30, 0x00, 0x00, 0x00);<br />
Serial.print((char) high);<br />
uint8_t middle = spi_transaction(0x30, 0x00, 0x01, 0x00);<br />
Serial.print((char) middle);<br />
uint8_t low = spi_transaction(0x30, 0x00, 0x02, 0x00);<br />
Serial.print((char) low);<br />
Serial.print((char) STK_OK);<br />
}<br />
<br />
////////////////////////////////////'<br />
////////////////////////////////////<br />
int avrisp() {<br />
uint8_t data, low, high;<br />
uint8_t ch = getch();<br />
switch (ch) {<br />
case '0': // signon<br />
error = 0;<br />
empty_reply();<br />
break;<br />
case '1':<br />
if (getch() == CRC_EOP) {<br />
Serial.print((char) STK_INSYNC);<br />
Serial.print("AVR ISP");<br />
Serial.print((char) STK_OK);<br />
}<br />
break;<br />
case 'A':<br />
get_version(getch());<br />
break;<br />
case 'B':<br />
fill(20);<br />
set_parameters();<br />
empty_reply();<br />
break;<br />
case 'E': // extended parameters – ignore for now<br />
fill(5);<br />
empty_reply();<br />
break;<br />
<br />
case 'P':<br />
start_pmode();<br />
empty_reply();<br />
break;<br />
case 'U': // set address (word)<br />
here = getch() + 256 * getch();<br />
empty_reply();<br />
break;<br />
<br />
case 0x60: //STK_PROG_FLASH<br />
low = getch();<br />
high = getch();<br />
empty_reply();<br />
break;<br />
case 0x61: //STK_PROG_DATA<br />
data = getch();<br />
empty_reply();<br />
break;<br />
<br />
case 0x64: //STK_PROG_PAGE<br />
program_page();<br />
break;<br />
<br />
case 0x74: //STK_READ_PAGE 't'<br />
read_page();<br />
break;<br />
<br />
case 'V': //0x56<br />
universal();<br />
break;<br />
case 'Q': //0x51<br />
error=0;<br />
end_pmode();<br />
empty_reply();<br />
break;<br />
<br />
case 0x75: //STK_READ_SIGN 'u'<br />
read_signature();<br />
break;<br />
<br />
// expecting a command, not CRC_EOP<br />
// this is how we can get back in sync<br />
case CRC_EOP:<br />
error++;<br />
Serial.print((char) STK_NOSYNC);<br />
break;<br />
<br />
// anything else we will return STK_UNKNOWN<br />
default:<br />
error++;<br />
if (CRC_EOP == getch())<br />
Serial.print((char)STK_UNKNOWN);<br />
else<br />
Serial.print((char)STK_NOSYNC);<br />
}<br />
}Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-30843084406037420132013-06-03T15:35:00.002+01:002013-06-04T19:23:57.872+01:00Siri-like Raspberry Pi Voice Regnition Control System For Home Automation<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
This is a project on <a href="http://en.wikipedia.org/wiki/Siri_(software)" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">Siri</a>-like voice recognition using <a href="http://en.wikipedia.org/wiki/Raspberry_pi" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">Raspberry Pi</a>, it's useful for home automation control system. I use three components for the project, code is mainly scrapped out from various Internet sources</div>
<ol style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.625em 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-family: inherit; font-style: inherit; line-height: 15px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">A speech-to-text component that will do the voice recognition</span></li>
<li style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Some “brains” to analyze the so captured text</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">A text to speech component that will speak out the result from component 2</li>
</ol>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
The hardware required is a Raspberry Pi with Internet connectivity and a USB microphone. Pi is running the 2012-12-16-wheezy-raspbian image; I don’t have a USB microphone, but I have a USB webcam (Logitech V-UAV35) with in-built microphone, so that worked out fine without any driver installation.<br />
<br />
This is a post explaining this project in detail: <a data-mce-href="http://blog.oscarliang.net/raspberry-pi-voice-recognition-works-like-siri/" href="http://blog.oscarliang.net/raspberry-pi-voice-recognition-works-like-siri/" style="color: #21759b; font-size: 16px; line-height: 27px;" target="_blank" title="Raspberry Pi Voice Recognition Works Like Siri">Raspberry Pi Voice Recognition Works Like Siri</a></div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
Speech recognition for Raspberry Pi can be done in number of ways, but I thought the most elegant would be to use Google’s voice recognition functions. I used this bash script to get that part done (<a href="http://www.raspberrypi.org/phpBB3/viewtopic.php?uid=19416&f=38&t=27290&start=0" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">source</a>):</div>
<pre style="background-color: #f4f4f4; border: 0px; color: #373737; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; line-height: 1.5; margin-bottom: 1.625em; outline: 0px; overflow: auto; padding: 0.75em 1.625em; vertical-align: baseline;">#!/bin/bash
arecord -D "plughw:1,0" -q -f cd -t wav | ffmpeg -loglevel panic -y -i - -ar 16000 -acodec flac file.flac > /dev/null 2>&1
wget -q -U "Mozilla/5.0" --post-file file.flac --header "Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium" | cut -d\" -f12 >stt.txt
cat stt.txt
rm file.flac > /dev/null 2>&1</pre>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
..and then set it to executable:</div>
<pre style="background-color: #f4f4f4; border: 0px; color: #373737; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; line-height: 1.5; margin-bottom: 1.625em; outline: 0px; overflow: auto; padding: 0.75em 1.625em; vertical-align: baseline;">chmod +x stt.sh</pre>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
You may need to install ffmpeg</div>
<pre style="background-color: #f4f4f4; border: 0px; color: #373737; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; line-height: 1.5; margin-bottom: 1.625em; outline: 0px; overflow: auto; padding: 0.75em 1.625em; vertical-align: baseline;">sudo apt-get install ffmpeg</pre>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
So what this does is to record to a <a href="http://en.wikipedia.org/wiki/FLAC" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">flac </a>file from the USB microphone until you press Ctrl+C and then passes that file to Google for analysis, which in turn returns the recognized text. Lets give it a try:</div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
<a href="http://harizanov.com/wp-content/uploads/2013/03/Untitled.png" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;"><img alt="Untitled" class="alignnone size-full wp-image-1846" height="344" src="http://harizanov.com/wp-content/uploads/2013/03/Untitled.png" style="border: 1px solid rgb(221, 221, 221); height: auto; margin-top: 0.4em; max-width: 97.5%; padding: 6px; width: auto;" width="635" /></a></div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
It work pretty good even with my bad accent. The output is saved to stt.txt file.</div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
Now onto the “brains” section, this is with no doubt a task for <a href="http://www.wolframalpha.com/" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">Wolfram Aplha</a>. I used Python to interface with it, there is already a <a href="https://pypi.python.org/pypi/wolframalpha" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">library</a> to use. It is pretty easy to install, just follow the instructions in the link. I had to get an API key, which is a 2 minute task and gives you 2000 queries a month.</div>
<pre style="background-color: #f4f4f4; border: 0px; color: #373737; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; line-height: 1.5; margin-bottom: 1.625em; outline: 0px; overflow: auto; padding: 0.75em 1.625em; vertical-align: baseline;">#!/usr/bin/python
import wolframalpha
import sys
#Get a free API key here http://products.wolframalpha.com/api/
#I may disable this key if I see lots of abuse
app_id='Q59EW4-7K8AHE858R'
client = wolframalpha.Client(app_id)
query = ' '.join(sys.argv[1:])
res = client.query(query)
if len(res.pods) > 0:
texts = ""
pod = res.pods[1]
if pod.text:
texts = pod.text
else:
texts = "I have no answer for that"
print texts
else:
print "I am not sure"</pre>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
.. and lets try it out with the questions that keep me up at night:</div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
<a href="http://harizanov.com/wp-content/uploads/2013/03/Untitled1.png" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;"><img alt="Untitled" class="alignnone size-full wp-image-1847" height="424" src="http://harizanov.com/wp-content/uploads/2013/03/Untitled1.png" style="border: 1px solid rgb(221, 221, 221); height: auto; margin-top: 0.4em; max-width: 97.5%; padding: 6px; width: auto;" width="835" /></a></div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
yep, brains are there. Now to the last part: speaking that answer out. Sure enough, we use Google’s speech services again (<a href="http://elinux.org/RPi_Text_to_Speech_(Speech_Synthesis)" style="border: 0px; color: #1982d1; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">source</a>)</div>
<pre style="background-color: #f4f4f4; border: 0px; color: #373737; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; line-height: 1.5; margin-bottom: 1.625em; outline: 0px; overflow: auto; padding: 0.75em 1.625em; vertical-align: baseline;">#!/bin/bash
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?tl=en&q=$*"; }
say $*</pre>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
..you may need to “sudo apt-get install mplayer” first..</div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
It sounds pretty cool indeed.</div>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
So finally a small script to put these to work together:</div>
<pre style="background-color: #f4f4f4; border: 0px; color: #373737; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; line-height: 1.5; margin-bottom: 1.625em; outline: 0px; overflow: auto; padding: 0.75em 1.625em; vertical-align: baseline;">#!/bin/bash
echo Please speak now and press Ctrl+C when done
./stt.sh
./tts.sh $(./wa.py $(cat stt.txt))</pre>
<div style="background-color: white; border: 0px; color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;">
So overall a fun project, maybe with some potential to use in home automation.. (4627)</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-78405942540923065462013-06-02T13:20:00.000+01:002013-06-02T13:20:29.427+01:00How to use Git and Gibhub on Raspberry Pi<br />
<div class="title" style="background-color: white; color: #292929; float: left; font-family: 'Helvetica Neue', helvetica, arial, sans-serif; font-size: 14px; line-height: 20px; width: 700.390625px;">
<h1 style="color: inherit; font-family: 'Droid Sans', Arial, 'sans serif'; font-size: 22px; font-weight: normal; line-height: 40px; margin: 0px 0px 7px; padding: 10px 0px 0px 15px; text-rendering: optimizelegibility;">
How to use Git and GitHub on Raspberry Pi</h1>
</div>
<div class="meta" style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; clear: both; color: #303030; font-family: 'Helvetica Neue', helvetica, arial, sans-serif; font-size: 13px; line-height: 20px; margin-top: 5px; padding: 5px 15px;">
<span style="color: inherit; font-family: 'Droid Sans', Arial, 'sans serif'; font-size: 20px; line-height: 40px; text-align: justify;">Git</span></div>
<div class="entry" style="background-color: white; color: #151515; font-family: 'Droid Sans', Arial, 'sans serif'; font-size: 14px; line-height: 24px; padding: 10px 15px 16px; text-align: justify;">
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
<a href="http://en.wikipedia.org/wiki/Git_(software)" style="-webkit-transition: all 0.2s ease-out; border: none; color: #364d96; margin: 0px; padding: 0px;" target="_blank">Git</a> is a <a href="http://git-scm.com/about/free-and-open-source" style="-webkit-transition: all 0.2s ease-out; border: none; color: #364d96; margin: 0px; padding: 0px;">free and open source</a> distributed version control system. Let’s take that apart bit by bit.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
Git is free and open source. You don’t need to pay to use it, and the source code is freely available. In practice that means that many pairs of eyes will be scanning the code and reading any bug reports, so defects in the code are likely to be found and fixed quickly.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
But what does git do?</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
The fact that it’s a version control system means that it can help you keep track of files that are frequently changed. Most version control systems maintain a history of changes and make it easy for users to compare versions, to load previous versions, and to add new versions as appropriate. Most software developers use a version control system of some sort, and many use git.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
Git has a range of features which make it attractive to developers, and one of those features is the fact that it supports <em>distributed</em> development. In other words, git is designed for use by teams in which the developers work in more than one location. </div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
You don’t need to know about we how we use git in our development process. The thing that matters is that you can use git, simply and easily, to get the latest version of our software on your Raspberry Pi.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
Git expects developers to keep all the files for a project or library together in something called a repository. That’s just a grand name for a collection of files that belong together. All of our libraries are stored in git repositories, and those repositories are stored on GitHub.</div>
<h2 style="border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; color: inherit; font-size: 20px; font-weight: normal; line-height: 40px; margin: 20px 0px 8px; padding: 5px 5px 2px 0px; text-rendering: optimizelegibility;">
GitHub</h2>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
Hopefully that’s given you a feel for git and why we use it, but what about GitHub?</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
<a href="https://github.com/" style="-webkit-transition: all 0.2s ease-out; border: none; color: #364d96; margin: 0px; padding: 0px;">GitHub</a> is a web-based service for people who want to use git. It’s widely used by teams who want to make some or all of their work publicly available under an open source license. Since that’s what we do, we feel that GitHub is a natural choice for us to store our code.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
If you want to keep up-to-date with the code we’ve published on GitHub, you will need to install and use git.</div>
<h2 style="border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; color: inherit; font-size: 20px; font-weight: normal; line-height: 40px; margin: 20px 0px 8px; padding: 5px 5px 2px 0px; text-rendering: optimizelegibility;">
Installing Git on your Pi</h2>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
To install git, just pen a terminal window by typing Ctrls-Alt-T and invoke</div>
<pre style="background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;">sudo apt-get install git-core</pre>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
You’ll be asked for your password and so long as your Pi has access to the internet and the debian RasPi repository is on-line you’ll see some activity which will show what’s going on as git is installed.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
Once that stops you’ll be ready to go.</div>
<h2 style="border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; color: inherit; font-size: 20px; font-weight: normal; line-height: 40px; margin: 20px 0px 8px; padding: 5px 5px 2px 0px; text-rendering: optimizelegibility;">
Using git to download our code</h2>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
When you first install a local copy of a repository using git, you do so by creating what’s called a <em>clone</em> of the repository.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
In order to install a local copy of the repository, click on the button marked ‘Git Read-Only’ and copy the text of the URI on its right. In our case, that’s <em>git://github.com/quick2wire/quick2wire-python-api.git</em></div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
It’s probably best to keep all your GitHub-based repositores in one place, so you may want to create a directory called git within your home directory. (In a command window, type <em>cd ~</em></div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
and then type <em>mkdir git</em>)</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
When you have done so, open a command window if necessary, change to your git directory by typing <em>cd ~/git </em>and create a copy of the GitHub content by typing</div>
<pre style="background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;">git clone git://github.com/quick2wire/quick2wire-python-api.git</pre>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
Git will tell you that it’s created an empty repository and will then pull down all the current files from the repository on GitHub.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
The README file on Git should tell you what do do to install the software in the repository. in our case the recommended approach is to add the location of your new cloned repository to your Python Path.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
Now you can use the software.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
But how do you keep it up to date?</div>
<h2 style="border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; color: inherit; font-size: 20px; font-weight: normal; line-height: 40px; margin: 20px 0px 8px; padding: 5px 5px 2px 0px; text-rendering: optimizelegibility;">
Keeping current</h2>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
If you take look at the GitHub page for a repository you can see when the files were last changed. If you open an account at GitHub (which has a free account option) you can chose to <em>watch</em> one or more repositories, in which case you will get notified whenever the repsoitory changes.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
If a repository you’ve cloned has changed since you last updated it, it’s really easy to get back up-to-date. In a command window, change to the directory in which you cloned the repository. In our case, you’d type<em>cd ~/git/quick2wire-python-api</em> in a command window. Now just type <em>git pull</em> and git will update your repository so that it’s an exact copy of the current version on GitHub.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
Depending on the way type of software in the repository, you may or may not need to repeat the installation procedure. If you’ve updated out gpio-admin repository, you’ll need to run through the installation process again, as described in the README for that repository in GitHub. In the case of the quick2wire-python-api package, you’ve already placed the code on your PythonPath so you should be ready to use the updated library without doing anything else.</div>
<h2 style="border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; color: inherit; font-size: 20px; font-weight: normal; line-height: 40px; margin: 20px 0px 8px; padding: 5px 5px 2px 0px; text-rendering: optimizelegibility;">
Summary</h2>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
You can use most code on GitHub by downloading, unpacking and installing an archive containing the code.</div>
<div style="-webkit-hyphens: auto; padding: 0px 0px 12px;">
If the code is changing fast, and you want to stay up-to-date you may prefer to install git, use the clone command to create a local copy of the repository, and use the git pull command to refresh your copy when the version on GitHub has changed.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-74142321388637592342013-04-27T11:31:00.002+01:002013-04-28T02:10:31.902+01:004-legged Robot using Arduino<br />
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
This is a 4-legged robot built by Oscar, original post can be found here:</div>
<div style="background-color: white;">
<span style="color: #3f3f3f; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 27px;"><a href="http://blog.oscarliang.net/arduino-quadruped-robot-stalker/">http://blog.oscarliang.net/arduino-quadruped-robot-stalker/</a></span></span></div>
<div style="background-color: white;">
<span style="color: #3f3f3f; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 27px;"><br /></span></span></div>
<div style="background-color: white;">
<span style="color: #3f3f3f; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 27px;">This is a screen shot of what he has done so far.</span></span></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<br /></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<img alt="Arduino Quadruped robot" class="aligncenter wp-post-image" height="350" itemprop="image" src="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0650.jpg" style="border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 4px; clear: both; display: block; height: auto; margin-bottom: 0.5em; margin-left: auto; margin-right: auto; max-width: 100%;" width="500" /></div>
<h1 style="background-color: white; color: #444444; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 200; line-height: 27px;">
Arduino 4-legged Robot - Stalker</h1>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
I am going to build an Arduino Quadruped Robot. As usual,<span style="font-size: 1em;"> I will share my source code and show as many pictures as possible, to help those of you who are also building Quadruped robots. The way I do things might not be the best ways, and I am sure you can come up with better solutions, please let me know if you do! <img alt=":-)" class="wp-smiley" src="http://blog.oscarliang.net/wp-includes/images/smilies/icon_smile.gif" style="border: 0px; height: auto; margin: 0px; max-width: 100%; vertical-align: middle;" /></span></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<span style="font-size: 1em;"></span></div>
<a name='more'></a><br />
<br />
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
This robot is actually the first robot I wanted to build, but I failed miserably. you can check <a href="http://www.youtube.com/playlist?list=PL8F5A6E47A086AA65" style="color: #21759b; text-decoration: none;" target="_blank" title="failed Arduino Quadruped robot">this out</a> and <a href="http://arduin0.blogspot.co.uk/2011/12/quadruped-robot-project-stalker.htm" style="color: #21759b; text-decoration: none;" target="_blank">this</a>. After building a working <a href="http://blog.oscarliang.net/arduino-hexapod-robot/" style="color: #21759b; text-decoration: none;" target="_blank" title="Arduino hexapod robot">Arduino Hexapod robot</a>, I feel confident that I can pull it off this time! I recycled the parts from the arduino hexapod robot, and build a body with styrene sheets, so there is no new parts.</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<span id="more-944"></span></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
For Inverse Kinematics, Check out my tutorial:</div>
<pre style="background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #3f3f3f; font-size: 12.025px; line-height: 18px; margin-bottom: 9px; padding: 8.5px; position: relative; white-space: pre-wrap; word-wrap: break-word;"><a href="http://blog.oscarliang.net/inverse-kinematics-and-trigonometry-basics/" style="color: #21759b; text-decoration: none;">http://blog.oscarliang.net/inverse-kinematics-and-trigonometry-basics/
</a></pre>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
I made an excel spreadsheet to<span style="font-size: 1em;"> simulate the movements of a quadruped robot. It shows detailed inverse kinematics calculations, and it might help those who are having problem understanding IK to visualize the complex computations, also it’s a great help to debug your code.</span></div>
<pre style="background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #3f3f3f; font-size: 12.025px; line-height: 18px; margin-bottom: 9px; padding: 8.5px; position: relative; white-space: pre-wrap; word-wrap: break-word;"><a href="https://dl.dropbox.com/u/457167/Blog_Download_Resources/Quadruped%20Robot_V1.zip" rel="nofollow" style="color: #21759b; text-decoration: none;">Download Quadruped Robot Simulation Spreadsheet V1.0</a></pre>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/5f5IrSlhHLg" width="420"></iframe></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
-</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
Okay, so, here are my progress so far</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
[31/01/2013]</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/7N_Y-RxWUOw" width="420"></iframe></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
I call this arduino quadruped robot ’Stalker’, because of the game unit in Star Craft of the same name. (although they look totally different :p)</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<img alt="" height="200" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBhMSERUUEhQWFBUWGRQXFxgYGBgYGBwYFRQWFxYXHBUXHCYgGBojGRcVHy8gIycpLCwsFR8xNTAqNSYrLCkBCQoKDgwOGA8PFykcHBwpKSkpKSwpKSksKSksKSkpKSwpKSkpKSksLCkpLCwpKSwpKSwsLCkpKSkpKS0pKSksLP/AABEIAMgA8AMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAACAwABBAUGB//EADwQAAEDAgQDBgMGBQQDAQAAAAEAAhEDIQQSMUFRYXEFEyKBkaEysdEjQlLB4fAGYnKC8RQVM7JDU6IH/8QAGQEBAQEBAQEAAAAAAAAAAAAAAAECAwQF/8QAIhEBAAICAwEAAgMBAAAAAAAAAAECESEDEjFBIlETYdEy/9oADAMBAAIRAxEAPwDw4paU3G5PhmxknhwvqpTLQC0D7RpiHfCOJ5osOGSYgO/G7NJPIaIaIcRFgB953xeq8bgvFuJN9WjWPk0WHUpWFDnMcSY639xdaW0Q27og6E2n1VYdkEy030sYHSLlTKqpYIhwykQLnn+iqmQc7ra63EdJ19E4Ych1iIGsnLProrxDmOcGwXEbi7R0O5TKZKbiC4CWieMaqm1GxEFuY6nxem4ULHZobAA3J/cKsme4IhuomST5oq21MrwZLxpy9CkjDkOcSBeTyRZQPFFz5x5LQ51xl2+7+qKzU6JcBy9Uus0A6yeX5rRVu46m14+oRVKVm2jn9B9VRmZRmSTYDSVdHLlJBgjh+qutS0+Zt6qqdKDpbUu+iqrY87NjiXX/AMIaoh3hud9wrokuLp0TsMQQR+evJQZSQHX8R2SnUbAzH74LaALzYjYb9SsobLrjoqgwTYC8bnRDReJ1kk+Xqrc4kxt+9ksO8MXtuLoNTmHR3h4EG5VGnOYuuOSW0S0Wmdzr+iKmYGWb7ndREDGFkgkZddzCTTquIcROWbDc+aIuDhAIgeU+asgEXEEbblUUxsSDFxtePPioxgcLH4dAja0DrwHzhHUoQDEl2xAnVTIUXguEDqf0QvzREjW5A/cJuHJaJBzRr9ISsvi0gHYmPRUE5oEGZnbfqgJFydud/RB3cHgBrxUyZZ0v6oNgcTd0AcBb/KrEmHAAZwb8ADzhSkyRYTfVFUIzd3J4kg/Piop+GoXl5MnzA6SqZjXXghrQep9UD6hABEA6E7xzVGM0tAHMfNRMOhTLIADJc77xvfmOKxPxBZVLGyTpIv1A4InVCNbDUZbT1P5JL8LAc4QJv+kqRBg/FXdlHiAHwjQOtcu33WV7yPzgWV3cBbKeGx8ldN8uMgS2w/ei0qgXWLRM7ynNMDgRuJkrM6oRuSOH6ptSpp+/Um6KbRuTpl46FKc4utrB6KzTBOkDW/zVuqm7gSNr/kiCaPxaeqB8/dtyH0VvIjjKtrdm3JsAJJJ4ADUpAW2kRMiB7qnUrADRdjE9iupw2q9rKhBIpCajxpBfl8LBEm7tuazPwzb5ZyCAajnsptF42bUzaiwK1FZdI47TXtjTJEARJO4QOEXiG+/otOJxlGCKVLWPG5z52MMZmsPiBLp5ALHUcQOPsk1w54LqVxmnXgk1Hw6bX6p4w8iR5pPc7D9f0TSra8Rqb6q3wI5+qSRFyEdIyZJ15JhBlvAT1Vhk3MEDYK28jbgbJbadzsgYK4zCBFoR0gWyB8RE3+qzudpsDvun1No1G6iAFR0ZRA4kfVW5oYZkydCdFYBdJB08lA4Re/PmgB7pN7xedEeY6m/CUMg39gFdzAv0QPpPc02v7e26NtPxFwbrvwQOMmTYfJXrAOmt91Gld1Lvi6kCytrByHD/AAizQNkIG6C6bi7w78vqreD8OvFyvMNfZF3wNhYeiC3u8I06pdYlsC3MJzIjd3pPkqqg7Gf+wUUiuwAhwmI05oc4DZyz0tHUJjri3iB33CWf2eKoj6kiHXnSEzCYZzyA3xG3QSbEnQD6J+CwhquAcfA2HPIgENzAQP5nEho5nkV26+JbSa2lQpB9SoclGlJIzEBpc92rjAuSf/kFWIy78XB3ibTqseseH7Bd9m0N72tWJ7qm0kBwBh1SRcUm6F5s4ghoMErsVaVHBhzQ+oazSKNSpQpMc4VCAXUqTqjmsaRplbmdrmhbO06jsPRMV6YfWBGKrucG13wMtPDUKNMZmU3AWygQI+G5XL7c7VZgXZaQnFtaILmNbSwbXjNkpUpI78ggkuJI3LiF6a0iq2tWY8xHyP8AZY+1TTwrA2rT+3dlcaNSoXlrSAc2IcwMGZ2oYBN7kACeHQNTE/aPnu25WttAJJDYawWAmLDgSUGA7FfiSalQubRzHNUMudUefia061KhMybxfmRux2PptYw0wWt7lstJ++3EVmkDYWa3T3VmHKbTb2WYUwWjxCXWbw8TfDc6EmNrLX2y6iX03UWhje5oy0EnxEFxzE6u8QaTxaud2jQz0aYF6lNg0+9lbBHXKPZI7PrZmX8UEEHeHAz7j3XKaxhmYw1OqTp4f37pJIA3J9loDJKp9G/T0C5MMjWSLgXTKWGPJvLVOFI628lGM6dd0yAe1sXJ89SlBsjTKmhgO39ybiDYBpsojIWFwsPFt/lNDREk3/D+qtt9DA3nRIdBJGg6aqg8ogT67I+7IEGPn7IsPfwgTwJskueLjQjhb3RDmgH4SPlHVKo0/uzdACR1On6o2sJN9Ag3AbCOqRQBm+28LW9hid+GlkkPgTMlZbZ3Mkkp72+EWhW02Oocf3oja7iJ+SuVK0t4o5jToibRIdYkjqB7K5vrf1COmwXmJ5bKBeXeJ9IQOedD8vomT4dz81Rl3AIBZpr9UTGgnhw4qVQBHFNw9Il4HHXkNz6KtVrNpiI+tWErClRLnTAzO11J8IPIwA0cJcd1v7Nw1dlF2KyuOIqtDaTWi9Kg8+Ko1hvmcBbfLB+8VzauSpWFN/8Aw0Qatf8AopgeHzJYwc6vJcTtPt2vWqGq97w8kloaSA2TLWtA2bIE8l2466zL28/J0xxV8r7/AHL1eHxFKjOIdSAFAgU2Pb462LLCWd5n8Rp02nObi55hcrsL+HKuMrDvM5YXEuMg1az58cFxga+Ko6zROui01HPxdTvMU9v2OHDixpOZzaYHeBoNg82JkwIGsQvRYt7206OGpu7utiQ7v6o8LaeHLmN7th1iXQXakl/FbicRpynPNfzc/HS7ToUKFFzaZD67QGugFtOlTIzd1RnyzOPiNpgQB8txFIikJtLcQNZENf3o6G7wvU1aFKniC2kGhmWsW6NB7twyOI0lzC4f3rz3aDQBUbr3VQn+xzixxjhDvZSL9l5eD+K01n30rGYstZmFyWtDSNs0knrHzSOy6ZaHDbLI/tIMek+iDFWpsBv44PCzLD5rQ2uQWBpA+JxndoAGX39gr8eec2loqTGsKxcAcdSVWaLbpoECXWO0LzucxgFScsNlWWEQfCreRpPqVHmdSJ5i3soiNe0mwv8AvZLrgyb6agWHpuiYCLExzEJgbE2zCPiQZKviaMu11T65LbAAaG1/RQUxkNxPDf1R0mnLFm8Z1WghoiIuOKdSfLyBYb6JbWAiNgZvonV3CAbQN0C208rvz1CoPkxcnVPZXEFukix9VnDQNTPT6qI6jbnaAlV3Q7Tojpi8EwfdHTAMnLMcx81lpna0xcxKptQzAuOn5p4q5mnQx7KnCQIAjjogjW7acUvNmJG3FSCb6bRKMNy229EC6bRJ5fvRWHeiFo4i3GVH0wNLBFXEbeX6rWysKTDUNy7wsB4jUzwFp5DmsthdxIHIyTyA4qqNMPb/AKiuMtBvhpU5P2hEkMFvgkS533oK3WnZ6OG0cf5/fjPi393h2sk58QRXqE/+oF3cNP8AUS6qRzaseALW/bVBI/8AGzTNecxOzeJ1Og3RVM2IqOqPgAmbaGAA1rRs1rQGgclfaWFaGB4BERI4jj5fmu1pjxzraO2Z26X8NV6lTEOqPkscx1OoScoDarSxjfMiQ0bMnZdV2KIFKqQ53gdQqECT3gfmZA18QB8wsGHYyjhg90ZnDONZJeAQAJvlZAmBvxu6p2uKNaqL3l7HBzmOHeNkkOYQRBc60xZTVtPXM34LV5J99XWxHdu72sIc4NDWH4m08zi/M3Vj35WtA1EkrisrZ6lStUGVrmPZG7y6NBwGs8Qhdiu9qFzjDQS43JJJ1MmSXHib3SMbizsPGeVmN2jg6NOGusKxGNQ48t7ctu0+yLEUYpPEzkyuvE2IkGN4MKqNcQwxoY9YI92qYOHCL5SC1w4TY/VKpMLHOpv2t1Gzh7FX1yrbraJ/T0XarR3jXtjxsBnaQS0+0LntxQkxJgSfksdeq8U3XsIaCD+KpBgR4bGUHZ1YAeKIlubUkNGYEjjBIJ5BcumHXlmvLe1odZ0EAG+9lTwbTpsFT2SXQYgkW0IGh6EQRyKKhUn4hPAzosePKqq0ZSTDj8kdCoIsS0bkXB8ktzrnX2go8MyAZtOgQKYxuYgCeB2KRiKBIzA5Y2O/RPp0Y8PsfqqbSyGSDGw190GYS43BjRU+mbCYHDT3Wis7n66QrDJbIaeu3uqBdRBAAmdpCW6gGnUHz0ROAmXOP9ISqYgzHl9URuzXJ8pOp/RNY8yQ0Ta5S6VTKDMTxNyrp0SAXceCwoQ8ZSAipuD2hp14bKhSnhKgaQdmoGZosYt93dSpDrmZ4bKs4Gtjsd1KkkTaDvqoBc4mB8rq6LQ5waS1twC57g0DiZcRoNlDUy2A8wgrUzObU+i1A04unhWuh1Y4m9qbAMsaSXMJkSbCVkqh+Kqgv8DIhlMfdaGHK0NGml9NEdKk5zg1gJc7RrRr6dBcr1nZ38LMpUcRUxLXitSbTcxsta2apy0Wi8y98iTs0wN12iZtqNOtJ/KJnx4+m45sjmZSBqJykS0CAdNfYrP2k0mmW8S1s9XL138Zfwz/AKZtF73DvSQyowbF1Gq74puGlpE/zLx2OxBERrLSBxLTmF+rQsxXe3TnrWvJ+Pj1dDDMLH16jc8v7qi02AhzWCernRwEE8Fxe2sNSc7xV4f8IIpfZmHOJAOYGwIvzC7Pa+EL8LSpUHDx12FhzFoir/qcQJcOHhvvASe26LGUu6Ja55DTBY5kD+XML+cE8F1iMMXvN5m0vLtwjmNyWmfiBsTo0QQC08JsSeiztaWnK74v2b89+a3UHlpLHT8JyztGwnbl0V9rsBGYGYsD/YXA+Th6OUlqlutmPCENqX+F/hPInQ+R/NbX0BVgOdke0ENdEjXQjhKx4dud7eDSHO6Agx1Jst5pAid99typnEbTmx20RV7OeKTw407ibGT4XA+UwVzqD4PW/mNfqt+OrN+AktBAvtqbHzCx0cDUc6ANBmB2PLz0VznbFLdZy6nZmJLXNGotANwWzD6d+AdI/lceAWpwB+EbusdhmMD0XGoYmHtm0ODh5AgjrB9l26hh7g0Q2TA3g3HsQsckayvJfOvhfdiIi5PUKiMpuQRyRYqtAAaLoaeGa7+XiuTiV/qiZmANiU9lYhvEeqF9ONPFGyX7A68ldCC86Hfml1tNT0VmnGh8wgaNp14qiGrAyxPIj81VWkJnNJVVyGwBM+qCoCLgGVTLoVTlP7KOoJGW7QbnefPZLfY3Mu4fUqe8+y5i6NbWRZugRvbPicNdAgo0yHfDZaKhtxRQ1zmygC+9tlbQ0CHG3LRKFR1osifSJuRPIIIRsDEGxP1CmKF/Dfjv7o6cZb2HP6JBqGTk0QdPChowxMnvq7jSZGgZDmuaYvd4aTtlb1C9JhcV32Iw5zuLa2LwxYCdaGApVTTcfCAA57mujbmuFTwLm0qTu7GHd3LQ6s593MqBz81OmCSHuY9rc1ly8b20W1g6nAyMcxszlYHNY1un3g0RH8116KxNXrm9JisRrHr1X/6Q5oNB4ia767ucsYyB0+2ePILwPaVMtE/hN/cFVU7Yr13M72qKjx4KQGWGB5BcQGi1xPULRUwtiNQPDfTKLCOogzzUvqezly37Xy3/AMPY+BSBGdza1F7WzEtbh8XB8pb6tTP4r/iEYmq5waGBpjUZBtAMX02uVl7F7pteiarSafeNFSDBDTLcwOxaSHf2QuRiHw98EmHVA2TNs7o9lYtmDjpN9x8W+u6oBTDjlm5MB0WDgBctETzM34LVWoCrDGg6zAjRogX2ABJJj0XMpOLZygFxEDc3Nz7L6ZguyKeG7HzuGbF13UwbDNme45KA4Na1pc6N54LUtcVItbfn14Su/u/s25QIBJtM2O+nzI3vCd3mZoy6zflyWyrSpj7MUjXecoqETDXPIAE7vJOm1lwnHUNcQLQd44EcQTB8lzmuWuSa31EYx4difFMmRoPInlxn12WrDYfugBE8eu65+BoO7xkw5sySDaACfI6ei6z3AW9gpecaeaf04/arIqTESWu9bH3B913MPXLqVM8jTPVhlv8A8ED+wrj9sAnKeTh5S36n1WnsquTSe2f/AF1OpE0z/wBmei17QnxqAGcjWVKr4sPqEljr8TurpVpkE66CFxZW6pJgEDmEIdOp80DKWUwCC7ghe7WbHhqqhjnyf3Cp58WsGEumwkShYSDLtEBU8zbAXO5vHmgLiXG5unCoD8JMFCWaB3xfkmUy293FgLnUqReG6cUw34j2T3sDbLLbKNwJPElH3hAgaKOBGoypb2nn1QBbQ+yaHeGBbiqNMDT1UZTB/VAxr4A0jio+iapDWGHPIY3hLrA+Uz5IMvH0XR7BpeNzz9xji2BINRwcGCdjlbWeOPdFWsZkN/iXtWCe6hozNpUgNGhrcrTB/CxojyXGpsyAACI048yTxJvKDGOz4ljNqbS4/wBThPyj1TJXXln4suT2hTLameLO9JAg9LQfVNpY3O4NMazJOg1c4nkJujxeEL2QCZzTxsGvm3mFzqRHwtk54BJIE/yxNptvstV3G19b8Rii0eECxF9TB0I849lgw9MvcBruempJO11uByROuU68TmA9DCZhWSDDbucQQJMkgbCZ1MBNVjTVbdYmF4U06TgczS4XytvfaT57ldsdveKm4HMKNN1Vlzao9ph1j8TALcC6dl5/E4UAFo8OVwbaNtfO6PDFrY/C7ON7w3xa62MTyKuPrdeSYrMR9eg7I7Pa6llzkBoY4gSCXwwkg23cIvbKVxe18LkqcSTlJ4nNln0LJ/pT8Fj3Uy0F4afCDmHgLLDNmm5FrW0WTtCu57pE3+G3iicxJA3JI8ljeZenkvxfwxEf9MdQFp4cwoMW/j7CUfc1HG/oTB9ED6cakdAbqZy+erFVXOAmPDOltY+gV9m18s9HNPR0H0BAS3XupRZAN9T0tC1E6wZ06gy66goWUSDLT+i5wJCczEiPFPkueGW4GDa7jqSgp03TISjjWxoRytfzRHtaBGUjzCziU2t9ct1Ek7JTqxm4vw4K/wDdm6d3puHX+SCr2iHRMtI0IA973ViJRspsOUiYJ3GqX4mwIPWJnzWVmJG5t0KqljmDZw4QfmExKYdqfFb9+qbUqWGYiRshawBW4cbzx/RZdVPcXCQJj1VCtH6pjiMoEQdwPqs7mkxFt7dEDXPk2E9FTzfTyCU58xx4BHVHQRvugtxkwux2bXDcM0mYdiC8g/gosiRF9qo8yuPRJ0EnmVuq1IpNH4aTnE7Zqhcwf93mODCunFG1hwez/wDmqkm5aJPM90StraBuRrxWPs6nYvOtQlwnZs+GfKPQLZUqRI3PHTyU5JzZJC1hubfvkqdSbFgBH4QPyTqhIZcCUt1hzPBZFYhjHNpgCJpjPzcKtVuccLBl+S14HD91TNZhbLC2m0yQ7vKgMvZG7WZjO0hcrPGUSfvD1hwHSzlrxFa2UGBTloE6uJmq/wA3Q3owLpt1zEzmWZtBopODgXeESALw28DfWb81zKuILnsLPE2RlG4J1YbbSRO4ErqUO0GDePcz12Wf/U0+8L8pJNjFpM6nnzStp+ucSdhKgghwDg24kTduhWKsSTN+M33108vRaKY/5OQKjce4NDLQBHP53vK3fwljLZvfqhc6Ec8Z/fJA4LCBDpVhQhCVQbnISCoXeQU10QWUPuq91TxfT8kRcwqPkra3zUNI8R6IisyryVilzRmNNUHpzUJtpzUAIGxCBvOw9UNatLYvA6D2XFtIG5t+90PeXMzyH+FHVSRYBNBnS56W9URVGnEkkD9VRFjsOPmlVQ0GJgBMLxuSeEwgmexLfPigxTS9jW7OgHkymCD6kvH9wR0j5coKJ9MC415LVbYUmtjWtPWLCJA0HlZI/wBzBtkkdb/JaquFa7UBL/26mToR0N1NBf8AujIu13shqdoM0gnpA9loHZtO58R6n6IaVGmLOaDzV0MlTEtIgNO5mb3BHyJWevVDvu9L/muq7AsH3dep9lHYBn4Qek/krlXEVgyRHEfNdCpgGC5B6AoKlKmILS6Z0PQk9bD3WonKHZvDUdcXNoBBE778R5LnPbc9T7ErVnik6d9esOJ9yVVTBHUkCZPNbssshChhan9n+HM05vZIdhXxJHpf5LETCBZQBEyB5oX0eDg7ofyUNJw1afRCQN0ANarPNXmT6dBn4mn2VGYGFQWtuEYeR62TGYdkXidocplGMO4aoJM7rY/Ct43OwKt2C5lMwjBP+VbXLp0+zxvrzsFQwjdfzv6J2gdRrzHHhKBhDtRdXUdPNE1sjjC5NJUZPTgqc5wGUG3C0prZi1kBOWfnugzPw4MXMn1TTlBAaD+/JMeBIvM6R+qRWYWEnWed1Q2nUsQbHlpdQ0j1HJY6FWRGnHotzBAkGeHBJTKGrawjqrYQ7y9EFOHnLIaTxPmpUGWQfUC3qoo3vEXS2awdOKpgJba6rLN4tuqHd8AbGwRVILZG+sIHPEWFlMPSJBJ0vCCF4y6GOKRiWhzXHgJtbS59pRzAuSeWqF9zxHorGhgpNJaLTEk9GnL81tJDrkjiUVKhknKD4jeeHC3r5peLw4IGWx3C1acySlLEsE3bedTAVUK1NtnOHKxPyWH/AELr6W6qNwhjUdOPmFMQjW5zCZzwOV1K1em4bE8IMpBwEAFzgPKfzTKOCDja46wOaaVjqNZtPnCSGyuuzB0pgHM7hNp6q6mCYDBBHQ2V7DkZBwVtozoCum/CNmMvnKJ2GEeGGj3KZHNGHLYMweU+624fEH4XR1AP1Up0gIvY7pzMNrB81JlCnh3H6KmtAdf98E6qHNNhmG8o2GmdBlPMqZQ1zyCrc8blDUqgmPdLqMi/0UbaKriRM24bq2NBudVnp1Dyv1lWKkdfdA0FJ7RrZojonNDrkEdSsdYTeLIDw9ACI15o21SQWkSdRwslFoySNeZv6KqT4bO+g1lGDnBsNkGbzAgdPJMouf8Adu0WjZIp0CSJMckfeuzQ2wUWIam1WuMRkPPdDVbBg2S+9aXeIXF5+vFVUrgnwxzvZVTCwBCK9iEdTClwkW6lZy0TFygsvgaeilJwAjcq6mgmyV38iGNkXuUGh1WBfXZZqTzBuD80mmMxlxv7ImwHSZVB4cm5Gm8rPVJB14prsx0sNgqOHB115IihiGubEXH580dMkeDQesoINgYA5BWzGOpulsdCJCDZTwzB8UAoX1SddNgs4xDHHNEHcbT1T6jiRp7/ACUFFpsdiqyja55pjHeEbKxWBtH5IMrabgTbT0VsdO1uScAWzEFWwzr+SBlNkXM5d5KF72jQC/mfVU8/iNhx091mqEkS0SOMBRD8gMkRzCgk62CtRVoRaNQgFAXN/wB8lFEVbSRqkh5Jytn8lFFYDjgXhslzf6d0Qw9pFioooBa0Dqq0MqKIGUiHa236oMVSynwiyiiBlR/2drn97JD8S4N8UHnAkKlEgGMPmaHTPADX0VVTGphRRPqM4bms31KeGNaLybH1UUQCCTd3hF0AJJJadPVWogOnWBEkeLms+Qkm0lRRXwQtOhEeSJrHDRRRQPZiJIaQ35JxoANNiOGhUUWZ0zJbTsLc0Fc5SBrKpRaUsNM+O4TaokATEaAKKIr/2Q==" style="height: auto; margin-bottom: 0.5em; max-width: 100%;" width="240" /></div>
<h2 style="background-color: white; color: #444444; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 200; line-height: 27px;">
Hardware that I use at the moment:</h2>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
1. Arduino Mega<br />
2. 12 Servos<br />
3. Wii Nunchuck controller<br />
5. a few thick styrene sheets (skeleton)<br />
6. 6V Ni-MH 4300mh Battery</div>
<h2 style="background-color: white; color: #444444; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 200; line-height: 27px;">
Plan:</h2>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<del>1. Build Body and Assemble Robot.</del></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<del>2. Test Wii Nunchuck on it.</del></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
3. Write good IK for body rotation, and translation.</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
4. Get it walking!</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<span style="font-size: 1em;">5. Write Android App to achieve more complicated task.</span></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<span style="font-size: 1em;">6. IR/ Ultra-Sonic Detection and simple AI.</span></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
7. Terrain Adaption.</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
============================================================</div>
<h2 style="background-color: white; color: #444444; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 200; line-height: 27px;">
Project Started – Update 31/03/2013</h2>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
Basically copied most of the codes from my last Hexapod robot. All I did was to remove the variables related to the middle legs, and modifed the preset variable values to work in the Quadruped Robot, and it actually worked! <img alt=":)" class="wp-smiley" src="http://blog.oscarliang.net/wp-includes/images/smilies/icon_smile.gif" style="border: 0px; height: auto; margin: 0px; max-width: 100%; vertical-align: middle;" /></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
But the movements are quite Awkward, a lot of work need to be done about Inverse Kinamatics.</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
Here is how I made the body:</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<a href="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0595-1.jpg" style="color: #21759b; text-decoration: none;"><img alt="IMAG0595-1" class="alignnone size-large wp-image-945" height="356" src="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0595-1-1024x608.jpg" style="border: 0px none; height: auto; margin-bottom: 0.5em; max-width: 100%;" width="600" /></a><a href="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0596-1.jpg" style="color: #21759b; text-decoration: none;"><img alt="IMAG0596-1" class="alignnone size-large wp-image-946" height="356" src="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0596-1-1024x608.jpg" style="border: 0px none; height: auto; margin-bottom: 0.5em; max-width: 100%;" width="600" /></a></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<a href="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0601.jpg" style="color: #21759b; text-decoration: none;"><img alt="Arduino Quadruped Robot 2" class="alignnone size-large wp-image-948" height="356" src="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0601-1024x608.jpg" style="border: 0px none; height: auto; margin-bottom: 0.5em; max-width: 100%;" width="600" /></a></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
========================================================================</div>
<h3 style="background-color: white; color: #444444; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 200; line-height: 27px;">
Quadruped Robot Leg Calibration (Servo Angle Offsets) – Update 03/04/2013</h3>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
I just didn’t like the body, i thought it was too big! So I spent an evening re-measured, and cut it down from 16cm to 12cm (leg to leg distance).</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<a href="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0604.jpg" style="color: #21759b; text-decoration: none;"><img alt="Quadruped Body" class="alignnone wp-image-985" height="230" src="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0604.jpg" style="border: 0px none; height: auto; margin-bottom: 0.5em; max-width: 100%;" width="585" /></a> <a href="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0606.jpg" style="color: #21759b; text-decoration: none;"><img alt="IMAG0606" class="alignnone size-large wp-image-986" height="356" src="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0606-1024x608.jpg" style="border: 0px none; height: auto; margin-bottom: 0.5em; max-width: 100%;" width="600" /></a></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
I have also created a very simple Servo Offset calibration program.</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
As you might know, due to the fact that no servo is perfect, they might tilt to the right a little more than the left, or the other way round. (It could be also caused by the servo brackets) You might want to give it an offset to correct this. It’s very handy when you have a lot of servos like Hexapod/Quadruped Robts have.</div>
<div class="syntaxhighlighter " id="highlighter_908584" style="background-color: rgb(255, 255, 255) !important; background-image: none !important; border: 1px solid rgb(224, 224, 224) !important; bottom: auto !important; color: #3f3f3f; direction: ltr !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 1em 0px !important; outline: 0px !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 594px;">
<div class="lines" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">1</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// ===========================================================</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">2</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// blog.OscarLiang.net</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">3</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// Created on 04/04/2013</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">4</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">5</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// ===========================================================</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">6</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">7</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// A very simple program to calibrate multiple servo offsets.</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">8</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// Especially useful if you have a lot of servos, for example</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">9</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// Hexapod Robots and Quadruped Robots.</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">10</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">11</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// ===========================================================</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">12</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">13</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// Instructions:</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">14</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">15</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// 1. change variable "ServoNum" - number of servos you have.</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">16</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// 2. change variable "servoPin" - the pins used by your servos.</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">17</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// 3. upload code to Arduino.</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">18</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// 4. open serial monitor, use baud rate 9600</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">19</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// 5. enter + or - in serial monitor to calibrate servo, there</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">20</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// is a reading printed on the monitor.</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">21</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// 6. enter n or l to move to next or last servo.</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">22</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">23</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// =============================================================</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">24</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">25</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="preprocessor" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: gray !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">#include <Servo.h></code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">26</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">27</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">const</code> <code class="color1 bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(128, 128, 128) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">int</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">ServoNum = 12;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">28</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">29</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Servo legServo[ServoNum];</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">30</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="color1 bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(128, 128, 128) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">int</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoPos[ServoNum];</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">31</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="color1 bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(128, 128, 128) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">int</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoIndex;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">32</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">33</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="color1 bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(128, 128, 128) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">int</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoPin[ServoNum] = {23, 24, 25,</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">34</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">26, 27, 28,</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">35</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">29, 30, 31,</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">36</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">32, 33, 34};</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">37</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">38</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">void</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">setup() {</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">39</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">40</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.begin(9600);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">41</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoIndex = 0;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">42</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">43</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// ================ Servos ==================</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">44</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">for</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(</code><code class="color1 bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(128, 128, 128) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">int</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">i=0; i<ServoNum; i++){</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">45</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">legServo[i].attach(servoPin[i]);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">46</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">delay(50);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">47</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">legServo[i].writeMicroseconds(1500);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">48</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoPos[i] = 1500;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">49</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">delay(100);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">50</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">51</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">delay(500);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">52</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">53</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"Ready"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">54</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"enter + to increment"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">55</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"enter - to decrement"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">56</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"enter n to proceed to next servo"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">57</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"enter l to go back to last servo"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">58</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">59</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">60</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">61</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">void</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">loop(){</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">62</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">63</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">( Serial.available()) {</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">64</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="color1 bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(128, 128, 128) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">char</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">ch = Serial.read();</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">65</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">66</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">switch</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(ch){</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">67</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">case</code> <code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">'+'</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">:</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">68</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoPos[servoIndex] += 3;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">69</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(servoPos[servoIndex] >= 2350){</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">70</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoIndex = 2350;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">71</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"You can't turn it up anymore (you might damage it!"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">72</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">73</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">else</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">{</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">74</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">legServo[servoIndex].write(servoPos[servoIndex]);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">75</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(servoPos[servoIndex]);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">76</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">delay(100);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">77</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">78</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">break</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">79</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">80</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">case</code> <code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">'-'</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">:</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">81</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoPos[servoIndex] -= 3;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">82</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(servoPos[servoIndex] <= 650){</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">83</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoIndex = 650;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">84</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"You can't turn it down anymore (you might damage it!"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">85</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">86</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">else</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">{</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">87</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">legServo[servoIndex].write(servoPos[servoIndex]);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">88</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(servoPos[servoIndex]);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">89</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">delay(100);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">90</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">91</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">break</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">92</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">93</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">case</code> <code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">'n'</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">:</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">94</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(++servoIndex >= 12){</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">95</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoIndex = 11;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">96</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"we have reached last servo"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">97</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">98</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">else</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">{</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">99</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.print(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"Switched to Pin "</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">100</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(servoPin[servoIndex]);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">101</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">102</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">break</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">103</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">104</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">case</code> <code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">'l'</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">:</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">105</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(--servoIndex < 0){</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">106</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">servoIndex = 0;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">107</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"we have reached first servo"</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">108</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">109</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">else</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">{</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">110</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.print(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"Switched to Pin "</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">111</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(servoPin[servoIndex]);</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">112</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">113</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">break</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">114</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">115</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">default</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">:</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">116</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">Serial.println(</code><code class="string" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">"Unknown Command... "</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">);</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">117</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">118</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">119</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">120</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
</div>
</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
.</div>
<h3 style="background-color: white; color: #444444; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 200; line-height: 27px;">
Creeping Gait – Update 15/04/2013</h3>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
Some Background Gait Knowledge you might want to know:</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<a href="http://blog.oscarliang.net/quadruped-robot-gait-study/" style="color: #21759b; text-decoration: none;">http://blog.oscarliang.net/quadruped-robot-gait-study/</a></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/ztNk8N2q0gM" width="420"></iframe></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
Tonight I came up with a 20-step Creeping Gait. This gait is how 4 legged animals, for example cats, walk.</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
This is the GaitStep Plan (leg 1 is the top right leg, leg 2 is the bottom right leg… etc…)</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
This follows the idea about creep gait described here: <a href="http://blog.oscarliang.net/quadruped-robot-gait-study/" style="color: #21759b; text-decoration: none;">http://blog.oscarliang.net/quadruped-robot-gait-study/</a></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
<a href="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0652.jpg" style="color: #21759b; text-decoration: none;"><img alt="Quadruped robot gait sequence" class="alignnone size-full wp-image-1020" height="174" src="http://blog.oscarliang.net/wp-content/uploads/2013/03/IMAG0652.jpg" style="border: 0px none; height: auto; margin-bottom: 0.5em; max-width: 100%;" width="500" /></a></div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
Circled steps are the leg-lifting steps, and the gait cycle starts at step one where leg starts to be lifted.</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
I copied most of the code on how to generate gait sequence from my previous <a href="http://blog.oscarliang.net/arduino-hexapod-robot/" style="color: #21759b; text-decoration: none;">hexapod robo</a>t, you can check out the source code. Here is the source code for the gait I have written:</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
Before we start, we call this function to initialize the variables for the Gait:</div>
<div class="syntaxhighlighter " id="highlighter_746168" style="background-color: rgb(255, 255, 255) !important; background-image: none !important; border: 1px solid rgb(224, 224, 224) !important; bottom: auto !important; color: #3f3f3f; direction: ltr !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 1em 0px !important; outline: 0px !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 594px;">
<div class="lines" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">1</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">void</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitSelect (){</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">2</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">3</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//begining of the step cycle for each leg (with reference to the first leg)</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">4</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitLegNr[LR] = 1;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">5</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitLegNr[LF] = 6;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">6</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitLegNr[RR] = 11;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">7</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitLegNr[RF] = 16;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">8</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">9</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">NrLiftedPos = 5; </code><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// number of steps that the leg is in the air</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">10</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">TLDivFactor = 15; </code><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// number of steps that the leg is on the ground</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">11</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">StepsInGait = 20; </code><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// total steps</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">12</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
</div>
</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
For a complete Gait cycle (e.g. from step 1 to step 20), we will go through loop() function 20 times, each time we call GaitCalculate(), and then increment ‘GaitStep’ variable.</div>
<div class="syntaxhighlighter " id="highlighter_100325" style="background-color: rgb(255, 255, 255) !important; background-image: none !important; border: 1px solid rgb(224, 224, 224) !important; bottom: auto !important; color: #3f3f3f; direction: ltr !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 1em 0px !important; outline: 0px !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 594px;">
<div class="lines" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">1</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">coor GaitCalculate (){</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">2</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//Calculate Gait positions</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">3</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">4</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">for</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(</code><code class="color1 bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(128, 128, 128) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">int</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">LegIndex = 0; LegIndex < 4; LegIndex++){</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">5</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">6</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(GaitStep == GaitLegNr[LegIndex]) {</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">7</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitPos[LegIndex].Y = -LegLiftHeight/2;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">8</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">9</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">else</code> <code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(GaitStep == GaitLegNr[LegIndex]+1) {</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">10</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitPos[LegIndex].Z = 0;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">11</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitPos[LegIndex].Y = -LegLiftHeight;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">12</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">13</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">else</code> <code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(GaitStep == GaitLegNr[LegIndex]+2) {</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">14</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitPos[LegIndex].Z = WalkLength/2;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">15</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitPos[LegIndex].Y = -LegLiftHeight/2;</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">16</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">17</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">else</code> <code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(GaitStep == GaitLegNr[LegIndex]+3) {</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">18</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitPos[LegIndex].Y = 0;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">19</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">20</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">else</code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">{</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">21</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">// move body forward</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">22</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitPos[LegIndex].Z -= WalkLength/TLDivFactor;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">23</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">24</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">25</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">26</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">27</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">28</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="comments" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">//Advance to the next step</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">29</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="keyword bold" style="background-image: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">if</code> <code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">(++GaitStep > StepsInGait)</code></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">30</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="spaces" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;"> </code><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">GaitStep = 1;</code></td></tr>
</tbody></table>
</div>
<div class="line alt1" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">31</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"></td></tr>
</tbody></table>
</div>
<div class="line alt2" style="background-color: rgb(248, 248, 248) !important; background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<table style="background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-collapse: collapse !important; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 13px !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; max-width: 100%; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><tbody style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="number" style="background-color: #f9f9f9; background-image: none !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 0px; border-bottom-width: 0px !important; border-left-width: 0px !important; border-right-width: 0px !important; border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-width: 0px; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;"><code style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important; word-wrap: break-word;">32</code></td><td class="content" style="background-color: #f9f9f9; background-image: none !important; border-bottom-right-radius: 4px; border-bottom-width: 0px !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-left-width: 3px !important; border-right-width: 0px !important; border-top-right-radius: 4px; border-top-width: 0px; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: auto !important;"><code class="plain" style="background-image: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; word-wrap: break-word;">}</code></td></tr>
</tbody></table>
</div>
</div>
</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
This is by no mean the best implementation, but it might give you an idea how to start doing gaits if you still have no clue.</div>
<div style="background-color: white; color: #3f3f3f; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px;">
I will keep working on Gait, make it more stable, faster, smoother and maybe come up with some more gait style as well, before I publish my full working code.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-56351086648696240872013-03-15T14:00:00.002+00:002013-03-16T11:20:46.746+00:00How to download Youtube Video 如何下载 Youtube 视频<div class="separator" style="clear: both; text-align: center;">
originally from:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://blog.oscarliang.net/how-to-download-youtube-videos-without-any-software-or-toolbar/">http://blog.oscarliang.net/how-to-download-youtube-videos-without-any-software-or-toolbar/</a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/g-Wbjmm980A?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
<br />
How to download YouTube videos without any software or toolbar- In this video you will learn the best trick ever to download YouTube videos.<br />
Download YouTube video by simply typing in "ss" in the url of the youtube video.<br />
<br />
Follow this method to download youtube videos. For you to download youtube videos free to computer from youtube you need to follow the below described procedure.<br />
<br />
1. The first step to download video from youtube is to play the video.<br />
2. After playing the youtube video, The second step to download video from youtube is to look for www. and after www. type in "ss" in the url of the youtube video you intended to download on your computer.<br />
3. The third step to download video from youtube is after typing in "ss" in the url now choose a format for your youtube video to download.<br />
4. And last step which comes in the process of "How to download youtube video" is to press enter and choose save as location of the video and you are done.<br />
<br />
5. The youtube video you intended to download on your pc for free without any software is downloaded to your computer and in this way you came to know the best way to download video from youtube .<br />
<br />
how to download youtube videos to your computer without any software, how to download youtube videos on windows 7, windows xp, windows 8.<br />
<br />
如何下载 youtube 视频呢?<br />
<br />
<br />
1. 在 youtube 上找到你想要下載的視頻。<br />
<br />
2. 在地址欄,'youtube.com'的前面加 'ss',按 enter 鍵。<br />
<br />
3. 你將會到一個下載網站,在這個網站的右邊,選擇你想要的格式就可以了~<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-74991755016530446652012-08-27T20:03:00.001+01:002013-02-23T13:56:26.960+00:00Wall-E Robot (object/face recognition, sound recognition, AI)<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.empireonline.com/images/features/100greatestcharacters/photos/63.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://www.empireonline.com/images/features/100greatestcharacters/photos/63.jpg" width="284" /></a></div>
<br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">[ 27/08/2012 ] Test 1 - Colour Tracking</span></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/RZplcw-F-bs?feature=player_embedded' frameborder='0'></iframe></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">[ 05/09/2012 ] Test 2 - Servos and motor driver</span></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/-hq11IuRQIw?feature=player_embedded' frameborder='0'></iframe></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">[ 08/09/2012 ] Test 3 - Controlling Wall-E from PC</span></span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/nbkxs4LIr5g?feature=player_embedded' frameborder='0'></iframe></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">[ 11/09/2012 ] Test 4 - Speech Recognition</span></span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/2FUMGUOvU-g?feature=player_embedded' frameborder='0'></iframe></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Arial; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br />
=============================================</span></span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">Flow chart</span></div>
</div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
commands</div>
<div>
PC -------->-------->--------> Robot (Arduino)</div>
<div>
PC < ------<--------<------- Camera (wireless)</div>
<div>
video</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
PC -----> Bluetooth ------> Air -----> Bluetooth -----> Arduino</div>
<div>
Serial</div>
<div>
communication</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<a name='more'></a><br /></div>
<div>
<br /></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=============================================</span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">update 05/08/2012</span></div>
</div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="font-family: Tahoma; text-align: -webkit-auto;">I will need a easy way to create user interface for the control program, there are a couple of options: SDL, Qt. </span><br />
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="font-family: Tahoma; text-align: -webkit-auto;">SDL the convenient library or tool that handle "Create a Window" , "Load a Image File" , "Play Sound and Music" , "Load Font in ttf Format" , "TCP/IP Protocol" , "Using a Gamepad , a Keyboard , and a Mouse" for you. So you can concentrate on creating your own world with these handy tools. It gives you the relative easy way to make a multi-media windows program.</span></div>
<div>
<a href="https://sites.google.com/site/sdlgamer/" shape="rect">https://sites.google.com/site/sdlgamer/</a></div>
<div>
<span style="font-size: xx-small;"><br /></span></div>
<div>
<br clear="none" />
Also need to learn how to user serial ports.</div>
<div>
The tutorial of Win32 Serial Port Programming</div>
<div>
<a href="https://sites.google.com/site/arduinorccar/communication" shape="rect">https://sites.google.com/site/arduinorccar/communication</a></div>
<div>
<br clear="none" /></div>
<div>
<br /></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=============================================</span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">update 08/08/2012</span></div>
</div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="font-family: Arial;">I think i have most of the project planned, and come up with quite a few functionalities.<br /><br />
For Object tracking and recognition, I will write the code myself with OpenCV in C++. And the program will run on a PC, images are transmitted from Wall-E using the wireless Wecam, and after processing the corresponding cammands will be sent back to Wall-E via bluetooth.<br /><br />
I have been looking very hard for programming solution for speech recognition, and hope someone has already wriiten a API or some sort. And Iaccidentally bumpped into a YouTube Video showing a much simpler way of doing this - EasyVR Arduino Shield! So I might use that instead of writing codes myself!</span></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="font-family: Arial;"><br /></span></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="font-family: Arial;"><br /></span></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="font-family: Arial;"><span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=============================================</span></span></span></span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">update 10/08/2012</span></div>
</div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">Wall-E arrived! :)</span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">I should have started this week, but just before I was going to take the video for my lastest version of the hexapod robot, one of the servos broke!! I guess i just had to wait...</span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi3dhXhMSX9O9lz3Oxsi75lglduQ-L3CBgvuLhASFksOwS_Xr2gXeyAHvGcEElQap8uL7jHMSHGrY5dqSQfazzfVu85UjQ6uMo9t2HmiNrfRyNIN6l3GgUkvHRJaQE7NjiHAcylLUBL88/s320/IMAG0170.jpg" width="190" /></div>
<br />
<br />
It's a great toy for 8's, it's only got one motor, which means it can only turn left, or go forward. Moves its hands as well, but that's pretty much it. Here is a video showing roughly the same one:<br />
<br />
<a href="http://www.youtube.com/watch?v=VEoh8Iws-kk">http://www.youtube.com/watch?v=VEoh8Iws-kk</a>
<br />
<br />
<br /></div>
<div>
<br />
<span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="font-family: Arial;"><span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=============================================</span></span></span></span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">update 12/08/2012</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">Still waiting for the servo gear to arrive, I am so bored, so I started working on the robot hardware. </span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">I took it apart and amazed by how well it works considering it's only got so few components.</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIK0EbWEtXrx9L-VYckT-7rpJD0AZCvPo8YBCoNviNMLrJJUvB8Ypjh1wzXMyCqWn6es_SEuA0us1UdhfX0SpV2KAjfD_OsffM_t5sfPGjP5r3I8wt4XJ17gF6QxeXR1ymIVZvrW40oKk/s1600/IMAG0172.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIK0EbWEtXrx9L-VYckT-7rpJD0AZCvPo8YBCoNviNMLrJJUvB8Ypjh1wzXMyCqWn6es_SEuA0us1UdhfX0SpV2KAjfD_OsffM_t5sfPGjP5r3I8wt4XJ17gF6QxeXR1ymIVZvrW40oKk/s320/IMAG0172.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidv-4z-uBBFPQiRtU250aRfx0ts7JgxM6JgdM-6waipUpDcfcnhattisH0XaZacS5ojBB5GMlFDd36HQwdmTuR8pIQUuc9sdJJ8zPynZW4XXuzyB_k1P6Mp-wBxFJsdAvUsIVgYr0_SC4/s1600/IMAG0173.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidv-4z-uBBFPQiRtU250aRfx0ts7JgxM6JgdM-6waipUpDcfcnhattisH0XaZacS5ojBB5GMlFDd36HQwdmTuR8pIQUuc9sdJJ8zPynZW4XXuzyB_k1P6Mp-wBxFJsdAvUsIVgYr0_SC4/s320/IMAG0173.jpg" width="190" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyO3011-OXXD7XghI1B9pJXQFp0zVsG2mruuVz_HUnDVburoqSCo5sPH_qmnxAmsutIYRu9ICjJMIzCmrwTRIZWZEgOTYRy5UZj783bZlWAKOtEYJXxKWR09tnOyrkH0b-NtU70R-MP_E/s1600/IMAG0176.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyO3011-OXXD7XghI1B9pJXQFp0zVsG2mruuVz_HUnDVburoqSCo5sPH_qmnxAmsutIYRu9ICjJMIzCmrwTRIZWZEgOTYRy5UZj783bZlWAKOtEYJXxKWR09tnOyrkH0b-NtU70R-MP_E/s320/IMAG0176.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Fl4LV-UGybeVx2PQUBNwC-3k5N9pT5ggWUSOoh4AR0eZLl6AUDsVIYfwJCXWKS4vcNndy4QqM5B5kBqXKYI1KFfLJMbutkpElo1t3g-YqSL3gvShGb4qyXDC4Wg2b98OMc-JlM8pUDs/s1600/IMAG0177.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Fl4LV-UGybeVx2PQUBNwC-3k5N9pT5ggWUSOoh4AR0eZLl6AUDsVIYfwJCXWKS4vcNndy4QqM5B5kBqXKYI1KFfLJMbutkpElo1t3g-YqSL3gvShGb4qyXDC4Wg2b98OMc-JlM8pUDs/s320/IMAG0177.jpg" width="320" /></a></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
</div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">It was quite dirty since it's second hand. I had to wash every piece of it with soup water! </span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">I will leave the assembling another day.</span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span><br />
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="font-family: Arial;"><span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=============================================</span></span></span></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">update 14/08/2012</span></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span><span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">Finally found the time to look at the robot pieces and could get started to assemble it.</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">I recycled the motors and motor driver from my previous robot (Wally Object tracking robot). </span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheOy02XFGG8w34dd9y4ctcS7VN2Nb_ofEWOGLgqD3S-Lh97DyJem5jmc-VKcrliQCeviYkY2n1beQthx1uQn5QE_eNgIh71D7od5YCxiG-rvrFDU_3oHId7mA4hBf-wIpeuTf4Zn_9QZg/s1600/IMAG0178.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheOy02XFGG8w34dd9y4ctcS7VN2Nb_ofEWOGLgqD3S-Lh97DyJem5jmc-VKcrliQCeviYkY2n1beQthx1uQn5QE_eNgIh71D7od5YCxiG-rvrFDU_3oHId7mA4hBf-wIpeuTf4Zn_9QZg/s400/IMAG0178.jpg" width="400" /></a></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPvOBZGUHsF6PXSAnqhrQFMRi_nccGRkbkFUUWGzBWz3kjLLhxDSgaoao-R6Hje_dzfeprhpv45DbZhCEtpGGWgVeFmLthLpxj5-6ls85I2I0BcdUdQXki8kwuY4VzrKbFIIJb7PUNXiQ/s1600/IMAG0186.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPvOBZGUHsF6PXSAnqhrQFMRi_nccGRkbkFUUWGzBWz3kjLLhxDSgaoao-R6Hje_dzfeprhpv45DbZhCEtpGGWgVeFmLthLpxj5-6ls85I2I0BcdUdQXki8kwuY4VzrKbFIIJb7PUNXiQ/s400/IMAG0186.jpg" width="237" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUHylGoiaGRpsmMrUYkZ3oPYQSKx3tAfCw32l-OkL8QQYHq6J6xjQKXPHaKNiErkzUfn5rcX6qXyfpZNgKjVUylYS0vX_o-CLd7MFThS9AGS5OLlBL-IB9_rbzV96TKO0xxPIYEEEPuO8/s1600/IMAG0194.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUHylGoiaGRpsmMrUYkZ3oPYQSKx3tAfCw32l-OkL8QQYHq6J6xjQKXPHaKNiErkzUfn5rcX6qXyfpZNgKjVUylYS0vX_o-CLd7MFThS9AGS5OLlBL-IB9_rbzV96TKO0xxPIYEEEPuO8/s400/IMAG0194.jpg" width="237" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsK9Hi5rOuyrLeMsTcI4y8AalsodeqcP2xKFlEpmPon3fyzhNGuW1SdX369hSVEID4jfdqTSJvUSVXDRn8QSAPt0-a10z_TLo1yoxNI95XUuCEVzx3yTZwAFqLVH7dtC4LTKX9cIj8hRo/s1600/IMAG0195.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsK9Hi5rOuyrLeMsTcI4y8AalsodeqcP2xKFlEpmPon3fyzhNGuW1SdX369hSVEID4jfdqTSJvUSVXDRn8QSAPt0-a10z_TLo1yoxNI95XUuCEVzx3yTZwAFqLVH7dtC4LTKX9cIj8hRo/s400/IMAG0195.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxHrzqidBbyAxdTgJzyh1BlZx0jBhciSoU6gd30UPK3jWDzxKQk9pq6KTI6waSM396DGTQfLmLfkeq53IfvDW0oSV96S3RKG2gikWwR9w4AJQxI7A4ZqRM0d5gn7MPsBRkZplRGq7GIfw/s1600/IMAG0187.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxHrzqidBbyAxdTgJzyh1BlZx0jBhciSoU6gd30UPK3jWDzxKQk9pq6KTI6waSM396DGTQfLmLfkeq53IfvDW0oSV96S3RKG2gikWwR9w4AJQxI7A4ZqRM0d5gn7MPsBRkZplRGq7GIfw/s400/IMAG0187.jpg" width="237" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-dMVJuvH7tQ7rjks5F8p7vIo7PEZwdHRPfdJj8wwsHYXE1ouIyHlDFfVi8gGUq3wki9y03jB9NeT-TtoooDn-iXJd5qxA_xJLrKg_8dE8qSqPq1ZIz6-rtCeLUUZMQhu-SNmgfw86Ekg/s1600/IMAG0196.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-dMVJuvH7tQ7rjks5F8p7vIo7PEZwdHRPfdJj8wwsHYXE1ouIyHlDFfVi8gGUq3wki9y03jB9NeT-TtoooDn-iXJd5qxA_xJLrKg_8dE8qSqPq1ZIz6-rtCeLUUZMQhu-SNmgfw86Ekg/s400/IMAG0196.jpg" width="237" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbek_Mzk8-WZWKC6hy3f92UMARzKfs_8JG76P1IhczlstIne_xsYLta9W-zeMNQCVkvSKTdu26P5YVLnvq5BEa7fERimRfRTGLnqr6dAAL8U4of98i19xD3TVFQQ7BWSokR9dGj7z2B6o/s1600/IMAG0197.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbek_Mzk8-WZWKC6hy3f92UMARzKfs_8JG76P1IhczlstIne_xsYLta9W-zeMNQCVkvSKTdu26P5YVLnvq5BEa7fERimRfRTGLnqr6dAAL8U4of98i19xD3TVFQQ7BWSokR9dGj7z2B6o/s400/IMAG0197.jpg" width="237" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1M8AiwL1jfVZgvWIgfhCW4hu4BjcAhKdzxoAnGoUMgxuRnUQ9I_i2z5OZWxGDttgQyF2cFAlM_veLh32oOstEyXUGy3X5hOTtwy0JQBVRTIKzwru3982OszXCWJ3Osr9OAlJe4DRPsGU/s1600/IMAG0199.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1M8AiwL1jfVZgvWIgfhCW4hu4BjcAhKdzxoAnGoUMgxuRnUQ9I_i2z5OZWxGDttgQyF2cFAlM_veLh32oOstEyXUGy3X5hOTtwy0JQBVRTIKzwru3982OszXCWJ3Osr9OAlJe4DRPsGU/s400/IMAG0199.jpg" width="237" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisZtWLy4nuJZC0ogOu8jmcdd5D-LG3yU_fhtjmd0GPYbn9YZ402d1O-g-XD-Sy8tqHYd5tOCX8bAC3Ahx4NfcLAAZplcnz-a9RISA0iryeAEtLvIeaAwStDHoQIjiuTTeUpGdeUurQ13I/s1600/IMAG0200.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisZtWLy4nuJZC0ogOu8jmcdd5D-LG3yU_fhtjmd0GPYbn9YZ402d1O-g-XD-Sy8tqHYd5tOCX8bAC3Ahx4NfcLAAZplcnz-a9RISA0iryeAEtLvIeaAwStDHoQIjiuTTeUpGdeUurQ13I/s400/IMAG0200.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirKJsV5wsKyMWDCdbPfaRh7dm1OndFFtAFHOylg61l81zZZc_GjXbn3fSx30K3hGadIVOmA3yYOJ_PaCWNRmiaZ7k0osiHUc1sjMonn6wE7S86DaOnpZu77UdussCp4ECbLbu0UT0DzOo/s1600/IMAG0201.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirKJsV5wsKyMWDCdbPfaRh7dm1OndFFtAFHOylg61l81zZZc_GjXbn3fSx30K3hGadIVOmA3yYOJ_PaCWNRmiaZ7k0osiHUc1sjMonn6wE7S86DaOnpZu77UdussCp4ECbLbu0UT0DzOo/s400/IMAG0201.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCNNIapFdDhUAeptxre0SpkJLRxA4ntQBD_mDu_GAfCopROwlDUoBSv7jSjE2fWE-TyiolL3PM-bXWBhwTD7T3i7sJ_hITYYDvy_F6XWzcL6TmqNtadejkhEjBZE-l7xoA-2F3Adlz9qk/s1600/IMAG0203.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCNNIapFdDhUAeptxre0SpkJLRxA4ntQBD_mDu_GAfCopROwlDUoBSv7jSjE2fWE-TyiolL3PM-bXWBhwTD7T3i7sJ_hITYYDvy_F6XWzcL6TmqNtadejkhEjBZE-l7xoA-2F3Adlz9qk/s400/IMAG0203.jpg" width="237" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY_wsjp4rYZG5nmkQ6DqroWDnz0VgmV9runZuAx2Pm9xgnuwoVxRT51KSHjN93hxqYe0Tc9JZfEI98KOJr3-8pCOUWThrYQr3a7RXZX9E7pbMAkjhnewFSXhXcgoD0LSB6hvUDhyS1NoE/s1600/IMAG0206.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY_wsjp4rYZG5nmkQ6DqroWDnz0VgmV9runZuAx2Pm9xgnuwoVxRT51KSHjN93hxqYe0Tc9JZfEI98KOJr3-8pCOUWThrYQr3a7RXZX9E7pbMAkjhnewFSXhXcgoD0LSB6hvUDhyS1NoE/s400/IMAG0206.jpg" width="237" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">It was quite challenging to modify the robot to fit the servos. but i did at the end ^.^.</span><br />
<span style="font-family: Tahoma;">I will start coding another day!</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=============================================</span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">update 17/08/2012</span></div>
</div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="font-family: Tahoma;"><b><u>colour tracking code! </u></b></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br />
capwebcam.read(matOriginal);<br /><br />
if(matOriginal.empty() == true) return;<br />
inRange(matOriginal, cv::Scalar(0,0,175), cv::Scalar(100,100,256), matProcessed);<br />
GaussianBlur(matProcessed, matProcessed, cv::Size(9,9), 1.5);<br />
cv::HoughCircles(matProcessed, vecCircles, CV_HOUGH_GRADIENT, 2, matProcessed.rows/4, 100, 50, 10, 400);<br /><br />
for(itrCircles = vecCircles.begin(); itrCircles != vecCircles.end(); itrCircles++){<br />
ui->txtXYRadius->appendPlainText(QString("ball position x =") +<br />
QString::number((*itrCircles)[0]).rightJustified(4, ' ') +<br />
QString(", y =") +<br />
QString::number((*itrCircles)[1]).rightJustified(4, ' ') +<br />
QString(", radius =") +<br />
QString::number((*itrCircles)[2], 'f', 3).rightJustified(7, ' '));<br /><br />
cv::circle(matOriginal, cv::Point((int)(*itrCircles)[0], (int)(*itrCircles)[1]), 3, cv::Scalar(0,255,0), CV_FILLED);<br />
cv::circle(matOriginal, cv::Point((int)(*itrCircles)[0], (int)(*itrCircles)[1]), (int)(*itrCircles)[2], cv::Scalar(0,0,255), 3);<br /><br />
}<br /><br />
// Convert OpenCV image to QImage<br /><br />
cv::cvtColor(matOriginal, matOriginal, CV_BGR2RGB);<br /><br />
QImage qimgOriginal((uchar*)matOriginal.data, matOriginal.cols, matOriginal.rows, matOriginal.step, QImage::Format_RGB888);<br />
QImage qimgProcessed((uchar*)matProcessed.data, matProcessed.cols, matProcessed.rows, matProcessed.step, QImage::Format_Indexed8);<br /><br />
// update label on form<br /><br />
ui->lblOriginal->setPixmap(QPixmap::fromImage(qimgOriginal));<br />
ui->lblProcessed->setPixmap(QPixmap::fromImage(qimgProcessed));</span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<div style="background-color: #fafafa; margin: 5px 20px 20px; padding: 0px;">
<div style="font-size: 13px;">
<span style="font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;"><span style="line-height: 14px;"><br /></span></span></div>
<div style="font-size: 13px;">
<div style="font-size: medium;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=============================================</span></div>
<div style="font-size: medium;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">update 24/08/2012</span></div>
</div>
<div style="font-size: 13px;">
<span style="font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;"><span style="line-height: 14px;"><br /></span></span></div>
<div style="font-size: 13px;">
<span style="font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;"><span style="line-height: 14px;"><br /></span></span></div>
<div class="separator" style="clear: both; font-size: 13px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7NipKsd02t3kCrjBiu2bl8Fz5kMZi5mhGsRab4UzgHxtkHyQXs4wgTUwm6asGYSjVzOXk761ZZyLv950vVEMgSERXc7KV8ESrGoIBCqJjZBkQuhXD16-4J-GiGC7PieWSLi9fmUQzijk/s1600/IMAG0190.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7NipKsd02t3kCrjBiu2bl8Fz5kMZi5mhGsRab4UzgHxtkHyQXs4wgTUwm6asGYSjVzOXk761ZZyLv950vVEMgSERXc7KV8ESrGoIBCqJjZBkQuhXD16-4J-GiGC7PieWSLi9fmUQzijk/s320/IMAG0190.jpg" width="190" /></a></div>
<div style="font-size: 13px;">
<span style="font-family: Tahoma; font-size: small;"><br /></span></div>
<div>
<span style="font-family: Tahoma;">The Servo Gear finally arrived! (actually the servo did, i guess they must have send me the wrong thing, ^.^ )</span></div>
<div>
<span style="font-family: Tahoma;"><br /></span></div>
<div>
<span style="font-family: Tahoma;">Anyway, i immediately fixed the hexapod robot, and started making the video, hope I can finally begin working on the coding for Wall-E.</span></div>
<div>
<span style="font-family: Tahoma;"><br /></span></div>
<div>
<span style="font-family: Tahoma;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=============================================</span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">update 27/08/2012</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">As a starting point, I wrote a Qt program to detect colour (red), and send out command via serial port to arduino, to turn Wall-E's head to follow the object. I will extend the object that can be tracked to faces, certain objects, light source etc..</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="font-family: Tahoma;">I struggled so much at the beginning, because everytime i connect to arduino via serial port, it freezes the video. I later realized it's the thread issue. when the program is waiting for data from serial port (or reading, or writing? i am not sure), it actually hangs the thread, so I decided to modify both serialport class, and video class to have their own thread when running.</span><br />
<span style="font-family: Tahoma;"><br /></span>
<span style="font-family: Tahoma;">Some people suggest it's not a very good idea to use thread if we don't have a formal education on this subject. And I did find it confusing how to start with thread, because some say we shouldn't make QThread subclass and we should instead move a object into a thread. But since it's in the official documentation that we should make it subclass, I followed the latter.</span><br />
<span style="font-family: Tahoma;"><br /></span>
<span style="font-family: Tahoma;">I am still very new to Qt and OpenCV, since I only started learning these a few days back, and I was already thinking about multithreading, and I now realized how crazy that was!</span><br />
<span style="font-family: Tahoma;"><br /></span>
<span style="font-family: Tahoma;">With frustrations, I spent the whole weekend and my bank holiday just debugging the code. I dropped my diet routine, my exercises, and my movies! But I won at the end. Altought it is still not as good as I would expect, tracking is quite slow and inaccurate, and the head shakes a lot, at least it works ^.^</span><br />
<span style="font-family: Tahoma;"><br /></span>
<span style="font-family: Tahoma;">I will look around for some better algorithm, at the meantime might add a few more functionality in the program like adjusting the video properties, and better threading coding...</span><br />
<span style="font-family: Tahoma;"><br /></span>
<span style="font-family: Tahoma;">see you now..</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">=============================================</span></span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">update 28/08/2012</span></span></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="font-family: Tahoma;"><br /></span></span></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="font-family: Tahoma;">The whole reason i spent so much time coding the colour tracking was because, i needed to write a program that does multithreading, and that's because i need to listen to the serial port for input from arduino while processing video.</span></span></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="font-family: Tahoma;"><br /></span></span></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="font-family: Tahoma;">I need to confirm arduino has completed the previous command before i send another one out. but still, it's not fast enough.</span></span></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="font-family: Tahoma;"><br /></span></span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">I saw someone has done a project similar to this, but he doesn't listen to signal from arduino, but send out commands from computer every frame he processes. and the result is actually better than mine!</span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">i am thinking, with enough delay between each frame, there might be a possibility that this could work. I can also say good bye to the confusing multi-threading programming too!</span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">I should also stop sending commands when there is nothing detected.</span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">should calculate the middle point of the detected image, so it will work regardless the size of the detected image.</span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">i might try it out tomorrow.</span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">=============================================</span></span><br />
<div style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">update 29/08/2012</span></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
</span>
<br />
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
</span>
<br />
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
</span>
<br />
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">So I tried sending commands without feedback signal from arduino, and it works great! I modified the code based on my initial Qt program, using single thread, it wasn't lagging at all! So now I know what was slowing the program down, must be the 'serial port data listener'. For whatever reason either I am using it wrong, or by nature it is blocking other processes, I should avoid using it. But in the future when I add the command recognition functionality, I will need to somehow send data back to computer, to run certain applications, for example, if I want Wall-E to track Faces, I would say 'Wall-E, follow faces', and arduino will send the computer the command, and open 'track faces application'.</span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
</span>
<br />
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
</span>
<div style="color: #333333; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">=============================================</span></span><br />
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">update 01/09/2012</span></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br />Assembling the </span><span style="font-family: Tahoma; text-align: -webkit-auto;">eye.</span><br />
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYYru9DmqsPOFXAquibO4GnUcbr3wO4y6HIhxhUh9UfQXAH0tLwdb4uxGexrBb0g68Lrvk-68kTmVmzLGpNFQTDSmZGRwrFYndTGPCrYIDhFxC3ExRJGUPQuIPIBlVdWnHepJ11c1nH90/s1600/IMAG0212.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYYru9DmqsPOFXAquibO4GnUcbr3wO4y6HIhxhUh9UfQXAH0tLwdb4uxGexrBb0g68Lrvk-68kTmVmzLGpNFQTDSmZGRwrFYndTGPCrYIDhFxC3ExRJGUPQuIPIBlVdWnHepJ11c1nH90/s320/IMAG0212.jpg" width="190" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3IUkh5yqPCCwc-wBFH5j0n9oOA7c2QyvoGaP_-bYe_-EwwOfXp3vKj3pwbtbRVrmQoGgb74wJVdG1OKdpFKGYs0iW5utjD5Ld7oTosrm0yc_haSPo4hLW2vCCNZtNORBnk8YM8xS4yUQ/s1600/IMAG0216.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3IUkh5yqPCCwc-wBFH5j0n9oOA7c2QyvoGaP_-bYe_-EwwOfXp3vKj3pwbtbRVrmQoGgb74wJVdG1OKdpFKGYs0iW5utjD5Ld7oTosrm0yc_haSPo4hLW2vCCNZtNORBnk8YM8xS4yUQ/s320/IMAG0216.jpg" width="190" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyt4VTwtdxj2j3cacFksMz7JLaqX2ypGkwJOGINnx9-qaqIPefXOdS4AftvqCK7LnKVeBjcahIXQG3580s387vxZILmV834JvDxKeuu03GC9jv1-g9mIss0yfT75DvXDygiD8Gj3jR4qw/s1600/IMAG0217.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyt4VTwtdxj2j3cacFksMz7JLaqX2ypGkwJOGINnx9-qaqIPefXOdS4AftvqCK7LnKVeBjcahIXQG3580s387vxZILmV834JvDxKeuu03GC9jv1-g9mIss0yfT75DvXDygiD8Gj3jR4qw/s320/IMAG0217.jpg" width="190" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlW13q7khxmEsvSZ7orJkqEc0Drp97velgGLzqgROtTeyv0h70qjVWyQ4fzgL4S2doq8OPQ5iRrEFrQThjEYDM_ZXECHpnUhNyoGWT9RKy1k2QTtyY5f1ZVpxorQYMxMGup83vEYYaNdE/s1600/IMAG0218.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlW13q7khxmEsvSZ7orJkqEc0Drp97velgGLzqgROtTeyv0h70qjVWyQ4fzgL4S2doq8OPQ5iRrEFrQThjEYDM_ZXECHpnUhNyoGWT9RKy1k2QTtyY5f1ZVpxorQYMxMGup83vEYYaNdE/s320/IMAG0218.jpg" width="190" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizOZ0hnYQUDSj9Lu9J-gVJ3GFGUdnLkQ5ovNn3jXSl17BwDmG5B4AMMXPiLhlcMqhnjTXOrBSib0RvQMrWCAn_66ieB73zx_bG6P5cpauo-HFq8H4V84NEzONsIX4P-s8sQOhAtDvRfcA/s1600/IMAG0220.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizOZ0hnYQUDSj9Lu9J-gVJ3GFGUdnLkQ5ovNn3jXSl17BwDmG5B4AMMXPiLhlcMqhnjTXOrBSib0RvQMrWCAn_66ieB73zx_bG6P5cpauo-HFq8H4V84NEzONsIX4P-s8sQOhAtDvRfcA/s320/IMAG0220.jpg" width="190" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKShcnopXl8JMKtUNGF4KQdyzanvo8GrliUR5H2fvXHkdsKrEsKTOI2g29M4YC7R-LJq1LyCYKT1NO74-RG3_qlhtoZq6Rcx85_fq7FlTSXcqFq36YYv88MUT0sBfWN8Lorvkoi9WCR04/s1600/IMAG0221.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKShcnopXl8JMKtUNGF4KQdyzanvo8GrliUR5H2fvXHkdsKrEsKTOI2g29M4YC7R-LJq1LyCYKT1NO74-RG3_qlhtoZq6Rcx85_fq7FlTSXcqFq36YYv88MUT0sBfWN8Lorvkoi9WCR04/s320/IMAG0221.jpg" width="190" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9IdItepfCJ2ImrkY2IzlBmNIJtV0JeJYDcC0_vwnLYDn4UETav_xmdKlDHEYjMapwkT4n33WggB9_pesjDrixCGUiE0BRosF8skZmuw5-Fnk0pxFVcF2bKj33hbF89C6_6g-GKd6C56c/s1600/IMAG0222.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9IdItepfCJ2ImrkY2IzlBmNIJtV0JeJYDcC0_vwnLYDn4UETav_xmdKlDHEYjMapwkT4n33WggB9_pesjDrixCGUiE0BRosF8skZmuw5-Fnk0pxFVcF2bKj33hbF89C6_6g-GKd6C56c/s320/IMAG0222.jpg" width="190" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNEfhbFjahr5GeImt8vpjnawBiftSnR7Wke-df0-2VbyGPBzNBbdfs3lRx61xGxsph8tDtMkR1vlshoza95yKDjabulqrxBYyXkW4c8EnfSJNwmiZDCVL2hW5H9J7pW1TR95RJFlW9r4A/s1600/IMAG0223.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNEfhbFjahr5GeImt8vpjnawBiftSnR7Wke-df0-2VbyGPBzNBbdfs3lRx61xGxsph8tDtMkR1vlshoza95yKDjabulqrxBYyXkW4c8EnfSJNwmiZDCVL2hW5H9J7pW1TR95RJFlW9r4A/s320/IMAG0223.jpg" width="190" /></a></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">=============================================</span></span><br />
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">update 02/09/2012</span></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><b>Improving the Tracking computer programs:</b></span></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
<br />1. options to the device.2. options to each object tracking.<br />this is very useful when it comes to camera devices: <a href="http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=cv_cap_prop_contrast">http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=cv_cap_prop_contrast</a></span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><b>re-writing the colour tracking algorithm, here is how it works in the new version:</b></span></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
<br />1. Preprocess the image using cv::inRange(), with necessary colour bounds to isolate a desired colour. It might be a good idea to transform to a <span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;">color-space like HSV or YCbCr for more stable color bounds because chrominance and luminance are better separated. You can use </span><a href="http://opencv.itseez.com/modules/imgproc/doc/miscellaneous_transformations.html?highlight=cvtcolor#void%20cvtColor%28InputArray%20src,%20OutputArray%20dst,%20int%20code,%20int%20dstCn%29" rel="nofollow" style="background-color: white; border-width: 0px; color: #4a6b82; cursor: pointer; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">cvtColor()</a><span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"> for this. </span> I imagine we will only need to worry about the Hue and Saturation channels as the Value channel doesn't contain any color info (i.e., the Value range would be left untouched [0, 255]).</span><br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
</span>
<br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">link to <span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"><span style="font-size: 14px; line-height: 18px;">cv::</span></span>cvtColor()</span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
</span>
<br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><a href="http://opencv.willowgarage.com/documentation/cpp/miscellaneous_image_transformations.html">http://opencv.willowgarage.com/documentation/cpp/miscellaneous_image_transformations.html</a></span></div>
<span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;">
</span>
<div style="font-family: Tahoma;">
<span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;"><span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"><br /></span></span></div>
<span style="border-collapse: separate; border-spacing: 0px; text-align: -webkit-auto;">
<div style="font-family: Tahoma;">
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;">but how to determine the min/max colour boundries?</span></div>
<div style="font-family: Tahoma;">
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"><br /></span></div>
<div style="font-family: Tahoma;">
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;">2. </span><span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;">smooth the image (pre-process) with </span><a href="http://opencv.itseez.com/modules/imgproc/doc/filtering.html?highlight=gaussianblur#void%20GaussianBlur%28InputArray%20src,%20OutputArray%20dst,%20Size%20ksize,%20double%20sigmaX,%20double%20sigmaY,%20int%20borderType%29" style="background-color: white; border-width: 0px; color: #4a6b82; cursor: pointer; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">GuassianBlur</a><span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"> to get rid of some of the jagginess. I used a bigger dilation kernel than erosion kernel (5x5 vs. 3x3) to get rid of some noisy pixels. The smoothing might help this also tweaking the thresholds could make the erosion unnecessary.</span></div>
<div style="font-family: Tahoma;">
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"><br /></span></div>
<div style="font-family: Tahoma;">
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;">3. compare sizes if multiple objects detected, choose the biggest one.</span></div>
<div>
<div style="font-family: Tahoma;">
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"><br /></span>
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"><br /></span>
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"><br /></span>
</div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">=============================================</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">update 05/09/2012
</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">Finally I have some time to sit down and continue my project! I finished the inside layout and tidied up all the cablings tonight. I Also tested the servos and motor driver, all seem working fine!</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">But i just have to say how much i hate soldering right now!! I literally spent 2 hours trying to solder a switch to some long cables. The first try, i found the cables was a bit out of contacts, so I put hot glue to stick them together, didn't help. So I tried very hard, to take the glue off, and replace all the cables with new ones, and soldered again.</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">This time was better. I then installed it on the robot, and hot-glued it on. Only found that the switch itself isn't working properly, I have to occasionally push the plastic bit. I guess i might have damaged the switch when I was taking the hot glue off... </span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">There is a reason I love programming so much! When I was at Uni doing projects, I always left all the soldering and cabling works to my lab partner, and I would take care of all the coding and maths. I just don't have the hands to do these things i guess... :(</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span></span></div>
<div>
<div class="separator" style="clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_COzx75mbrmq29mKiOCq9VzEAQRGU5izPmFf64-OTqx4PA2GRrN3OcOSK2IYUBQlzzRLEpPrLiHRuiHsdVvSW4vRn7Ey-N835KioQeCUNNpLlJqplrfrgTfuXaB09JK5pNu0GyPMNeuQ/s1600/IMAG0224.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_COzx75mbrmq29mKiOCq9VzEAQRGU5izPmFf64-OTqx4PA2GRrN3OcOSK2IYUBQlzzRLEpPrLiHRuiHsdVvSW4vRn7Ey-N835KioQeCUNNpLlJqplrfrgTfuXaB09JK5pNu0GyPMNeuQ/s320/IMAG0224.jpg" width="190" /></a></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<br /></div>
<div class="separator" style="clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtzz8YQ30dN7J-lEMb9HXyBOA23oDnbGunFE9xfbpbR0LEkaSAlF6YtNl9kJG-KLl6miGVKivXDaoyXZf6Dw-034aUBO29pb9rC7RQYu7fkCf1KVyv-rwBtcxqPqlVvJswmYK1KMXCAT8/s1600/IMAG0225.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtzz8YQ30dN7J-lEMb9HXyBOA23oDnbGunFE9xfbpbR0LEkaSAlF6YtNl9kJG-KLl6miGVKivXDaoyXZf6Dw-034aUBO29pb9rC7RQYu7fkCf1KVyv-rwBtcxqPqlVvJswmYK1KMXCAT8/s320/IMAG0225.jpg" width="190" /></a></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<br /></div>
<div class="separator" style="clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh45uDvJn0sn6JWlmeSEDss1USyOewSjU5n8lNPlPirhQbZ6tBwCzrD4k2TWE_YK_5vhyXP8VbsBLBADnQjAZl4N-LcRwhpY0S4Ou-REx0Bxa0LfwRgNAaLV2KEX4aY4bGEOTSBoJEgBzs/s1600/IMAG0229.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh45uDvJn0sn6JWlmeSEDss1USyOewSjU5n8lNPlPirhQbZ6tBwCzrD4k2TWE_YK_5vhyXP8VbsBLBADnQjAZl4N-LcRwhpY0S4Ou-REx0Bxa0LfwRgNAaLV2KEX4aY4bGEOTSBoJEgBzs/s320/IMAG0229.jpg" width="190" /></a></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<br /></div>
<div class="separator" style="clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRFGi6yVkSuK-l6AQecfe1M9WBwH90FDARrEjYBVHA3n3EWAsAyzQ_TT-3ueIFw-DXqTiukIuuX3Go7FAQpqGLKZUFTX8v-c1m3qU7DmdrpS0iR6nv95wFy4WTH_xMhUiYndcXAiWap-M/s1600/IMAG0235.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRFGi6yVkSuK-l6AQecfe1M9WBwH90FDARrEjYBVHA3n3EWAsAyzQ_TT-3ueIFw-DXqTiukIuuX3Go7FAQpqGLKZUFTX8v-c1m3qU7DmdrpS0iR6nv95wFy4WTH_xMhUiYndcXAiWap-M/s320/IMAG0235.jpg" width="320" /></a></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<br /></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<br /></div>
<div style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<br /></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal; margin: 0px; padding: 0px;">
<div style="padding: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px;">=============================================</span></span></div>
</div>
<div style="margin: 0px; padding: 0px;">
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal; padding: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px;">update 08/09/2012</span></span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal; padding: 0px;">
<br /></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal; padding: 0px;">
We can now control Wall-E from PC.</div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal; padding: 0px;">
<br /></div>
<div style="padding: 0px;">
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
We can also use it as a spy robot :)</div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<br /></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<br /></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<br /></div>
<br />
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal; margin: 0px; padding: 0px;">
<div style="padding: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px;">=============================================</span></span></div>
</div>
<div style="margin: 0px; padding: 0px;">
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal; padding: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma;"><span style="border-collapse: separate; border-spacing: 0px; color: #333333; font-size: 13px; line-height: 18px;">update 11/09/2012</span></span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal; padding: 0px;">
<br /></div>
<div style="padding: 0px;">
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
Added Speech recognition, so i can now control wall-e with my voice.</div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<br /></div>
<br />
I am using EasyVR arudino Shield. The shield is great, easy to use, and work quite well actually. But it's intolerate to background noise, even it's just a little.<br />
<br />
At first, I trained the robot with commands, and it's all working fine. But when I switched on the robot, it starts ignoring my commands, being unresponsive. I later realize it's the noise from the servo and motor that interferes the input from the Mic.<br />
<br />
So I re-trained the robot with the motor and servos on, to simulate the noisy environment. And really, it works much better, although still not ideal.<br />
<br />
To conclude, I don't recommend using EasyVR on a robot that is sitting next to servos and motors, or operate in a noisy environment.<br />
<br />
For future work, i will migrate the speech recognition to the computer site, and send commands via bluetooth. (actually that's even better because now I don't need to send signal back from Wall-E to computer anymore, so communication will be strickly one way, see last few updates about the bluetooth listener issue)<br />
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<br /></div>
</div>
</div>
</div>
</div>
</div>
</div>
</span></div>
</div>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-42656396901986497312012-08-07T23:43:00.003+01:002012-08-07T23:47:00.968+01:00First Android App controls android via bluetooth LEDsA fairly simple one. I will only describe how the seek bar works, and part of how commands are recognized by arduino (arduino code). I will do another one about bluetooth another day.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/FiCaGiOSWGw?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
<br />
<a name='more'></a><br /><br />
Full Arduino Code:<br />
<br />
<div>
<table border="1" cellpadding="2" cellspacing="0" style="width: 100%px;"><tbody>
<tr><td valign="top"><br />
byte packet<span style="color: green;">[</span><span style="color: #0000dd;">2</span><span style="color: green;">]</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> pIndex<span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">int</span> rPin <span style="color: navy;">=</span> <span style="color: #0000dd;">9</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> yPin <span style="color: navy;">=</span> <span style="color: #0000dd;">10</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> gPin <span style="color: navy;">=</span> <span style="color: #0000dd;">11</span><span style="color: teal;">;</span><br />
<br />
byte rValue <span style="color: navy;">=</span> <span style="color: #0000dd;">0</span><span style="color: teal;">;</span><br />
byte yValue <span style="color: navy;">=</span> <span style="color: #0000dd;">0</span><span style="color: teal;">;</span><br />
byte gValue <span style="color: navy;">=</span> <span style="color: #0000dd;">0</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">void</span> setup<span style="color: green;">(</span><span style="color: green;">)</span> <span style="color: green;">{</span><br />
Serial.<span style="color: #007788;">begin</span><span style="color: green;">(</span><span style="color: #0000dd;">9600</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> loop<span style="color: green;">(</span><span style="color: green;">)</span> <span style="color: green;">{</span><br />
<br />
<br />
<br />
<span style="color: #666666; font-style: normal;">// see if there's incoming serial data:</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>Serial.<span style="color: #007788;">available</span><span style="color: green;">(</span><span style="color: green;">)</span> <span style="color: navy;">></span> <span style="color: #0000dd;">0</span><span style="color: green;">)</span> <span style="color: green;">{</span><br />
packet<span style="color: green;">[</span>pIndex<span style="color: #000040;">++</span><span style="color: green;">]</span> <span style="color: navy;">=</span> Serial.<span style="color: #007788;">read</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">if</span><span style="color: green;">(</span>pIndex <span style="color: navy;">>=</span> <span style="color: #0000dd;">2</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
<span style="color: blue;">switch</span><span style="color: green;">(</span>packet<span style="color: green;">[</span><span style="color: #0000dd;">0</span><span style="color: green;">]</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
<span style="color: blue;">case</span> <span style="color: red;">'r'</span><span style="color: teal;">:</span><br />
rValue <span style="color: navy;">=</span> packet<span style="color: green;">[</span><span style="color: #0000dd;">1</span><span style="color: green;">]</span><span style="color: teal;">;</span><br />
<span style="color: blue;">break</span><span style="color: teal;">;</span><br />
<span style="color: blue;">case</span> <span style="color: red;">'y'</span><span style="color: teal;">:</span><br />
yValue <span style="color: navy;">=</span> packet<span style="color: green;">[</span><span style="color: #0000dd;">1</span><span style="color: green;">]</span><span style="color: teal;">;</span><br />
<span style="color: blue;">break</span><span style="color: teal;">;</span><br />
<span style="color: blue;">case</span> <span style="color: red;">'g'</span><span style="color: teal;">:</span><br />
gValue <span style="color: navy;">=</span> packet<span style="color: green;">[</span><span style="color: #0000dd;">1</span><span style="color: green;">]</span><span style="color: teal;">;</span><br />
<span style="color: blue;">break</span><span style="color: teal;">;</span><br />
<span style="color: blue;">default</span><span style="color: teal;">:</span><br />
<span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
analogWrite<span style="color: green;">(</span>rPin, rValue<span style="color: green;">)</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// 0 - 255</span><br />
analogWrite<span style="color: green;">(</span>yPin, yValue<span style="color: green;">)</span><span style="color: teal;">;</span> <br />
analogWrite<span style="color: green;">(</span>gPin, gValue<span style="color: green;">)</span><span style="color: teal;">;</span> <br />
<br />
Serial.<span style="color: #007788;">print</span><span style="color: green;">(</span>packet<span style="color: green;">[</span><span style="color: #0000dd;">0</span><span style="color: green;">]</span>,<span style="color: green;">)</span><span style="color: teal;">;</span><br />
Serial.<span style="color: #007788;">print</span><span style="color: green;">(</span><span style="color: red;">" "</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
Serial.<span style="color: #007788;">println</span><span style="color: green;">(</span>packet<span style="color: green;">[</span><span style="color: #0000dd;">1</span><span style="color: green;">]</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
pIndex <span style="color: navy;">=</span> <span style="color: #0000dd;">0</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">100</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span></td></tr>
</tbody></table>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Android Code (java):</div>
<div>
<br /></div>
<div>
I am not going to post all the source code because i have a lot of unneeded controls in the code, and I have no time to tidy it up, so I will only post the relevant snippets.</div>
<div>
if you have any error, it's probably want you to import the library :)</div>
<div>
<br /></div>
<div>
<b>Create SeekBars, and it's value (using byte because of the bluetooth nature)</b></div>
<div>
<br /></div>
<div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>SeekBar sr;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>SeekBar sy;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>SeekBar sg;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>byte srValue;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>byte syValue;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>byte sgValue;</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Set seekbar maximum value to 255, as the max of a byte is 255.</b></div>
<div>
<br /></div>
<div>
<div>
sr.setMax(255);</div>
<div>
sy.setMax(255);</div>
<div>
sg.setMax(255);</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>And lastly, setup the event listener for the seekbar, we put the progress value in memory, and only send it to target device when we finish dragging it to reduce data traffic, i will only show one of the seekbar listener.</b></div>
<div>
<br /></div>
<div>
<div>
sr.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onProgressChanged(SeekBar seekBar, int progress,</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>boolean fromUser) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>tv1.setText("Red " + progress);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>srValue = (byte) progress;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onStopTrackingTouch(SeekBar seekBar) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>String temp = "r";</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>byte bytes[] = temp.getBytes();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>try {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>outputStream.write(bytes);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>} catch (IOException e) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>e.printStackTrace();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>try {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>outputStream.write(srValue);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>} catch (IOException e) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>e.printStackTrace();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
});</div>
</div>
<div>
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-86613384289820704072012-05-31T12:05:00.002+01:002012-06-04T23:52:47.403+01:00Weibo Security System (IR sensor, arduino, php, VB)<span class="co2"></span><br />
<div style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;">23/05/2012</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;">I am renting at the moment but doors have no locks, so i am planning to build a system that sends me a warning whenever the doors is cracked open. I am think to use Weibo (twitter in China), and email. it will also activate the CCTV system and start recording.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;">The following is the diagram that roughly explains how it works.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><em style="background-color: #f3f3f3; color: #777777; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: 20px;">现在租房,但门没有锁所以打算做个微博警报器,门要是一打开,电脑就会发微博并 <a href="http://www.weibo.com/n/%E6%A2%81%E5%B0%8F%E8%88%AAOSCAR" style="color: #2848ff; text-decoration: none; word-wrap: break-word;" usercard="name=梁小航OSCAR">@梁小航OSCAR</a> (我)。原理大概像这图吧,画得不好。最难的部份:用第三方软件发微博的代码已经拼出来了,下一步就是写 PHP 跟 VB 的 interface,最后就写 Arduino跟sensor的代码。。</em>
</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><em style="background-color: #f3f3f3; color: #777777; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: 20px;"><br /></em></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgulaeOqRFtnpekD40EloK6-rE0P4LZfyPdE6i8Wic48lH9E0zVrwLjEJUDjIxsgj5TIYBA1D-TJtQM5qlnzX1_ThQjMJiw1nyBuwFX648LsPrfw6aqL8u5n7pR6sGC02LTgab8QIR0Se8/s1600/7d905846gw1dta1cmrr5gj.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgulaeOqRFtnpekD40EloK6-rE0P4LZfyPdE6i8Wic48lH9E0zVrwLjEJUDjIxsgj5TIYBA1D-TJtQM5qlnzX1_ThQjMJiw1nyBuwFX648LsPrfw6aqL8u5n7pR6sGC02LTgab8QIR0Se8/s320/7d905846gw1dta1cmrr5gj.jpg" width="320" /></a></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><em style="background-color: #f3f3f3; color: #777777; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: 20px;"><br /></em></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><em style="background-color: #f3f3f3; color: #777777; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: 20px;"><br /></em></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><em style="background-color: #f3f3f3; color: #777777; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: 20px;"></em></span><br />
<a name='more'></a><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><em style="background-color: #f3f3f3; color: #777777; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: 20px;"><br /></em></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;">============================================</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;">24/05/2012</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small; line-height: normal; white-space: normal;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Arial;">After setting up the demo code on the XAMPP server, i go to </span></span><br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><a href="http://81.108.179.49/sina/">http://81.108.179.49/sina/</a>index.php</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">I then clicked on the button where it said 'login to weibo'</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">it's not going to ask you for the username and password, it will just log you in with the account you are currently using.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">so if you don't want to use your main account for testing, then login with your testing account before carrying out this step.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">i then ran into this error:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">Fatal error: Call to undefined function: curl_init() </span></div>
<div>
<br /></div>
<div>
After googling it, i realized i haven't enable some function in the PHP server.</div>
<div>
<br /></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top">If this is with a hosting <a href="http://www.hotscripts.com/forums/#" style="background-image: none !important; border: 0px none transparent !important; bottom: 0px; color: blue !important; cursor: pointer; display: inline !important; font-family: inherit !important; font-size: inherit !important; left: 0px; margin: 0px; outline: none; padding: 0px !important; position: static; right: 0px; top: 0px;"><span style="color: blue; font-family: inherit; font-size: inherit !important; position: static;"><span style="background-image: none; border-bottom-width: 1px; border-left-width: 0px !important; border-right-width: 0px !important; border-top-width: 0px !important; font-size: inherit !important; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static; vertical-align: baseline; width: auto !important;">company</span></span></a>, you will need to have them install/enable it.<br />
<br />
If this is a Windows based system, CURL can be enabled by uncommenting the curl extension line in the php.ini file - extension=php_curl.dll and restarting the web server.<br />
<br />
If this is Unix/Linux, PHP must be compiled with CURL support and the libcurl library must be installed.</td></tr>
</tbody></table>
<div>
<br /></div>
</div>
<div>
After the first problem was solved, i had another problem:</div>
<div>
<br /></div>
<div>
发送失败,错误:21321:applications over the unaudited use restrictions!</div>
<div>
<br /></div>
<div>
Solution: Because my app on Weibo isn't authorized yet, so I need to add the test accounts manually on the setting page (open.weibo.com), with the account UID, which is <a href="http://www.weibo.com/2106611782">http://www.weibo.com/2106611782</a>, the number bits.</div>
<div>
<br /></div>
<div>
And finally, it works!</div>
</div>
<div>
<br /></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">==============================================</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">27/05/2012</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">Okay, I am so happy my idea of doing this project on Weibo I posted few days ago got reposted by some Arduino guys, and quite a few people noticed and commented! hoo hoo! I guess that's quite a motivation for myself.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">On friday, i did some research and (finally?) got the VB email program working, although it requires a library called EASendmail to do so. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">Today, I also got the PHP code for sending Weibo twitt using address bar down. Now it's working in the VB program... </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">Next step would be to use arduino to send command to trigger this via USB...</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">now the problem comes to the CCTV... how am i going to turn on the CCTV and start recording... where to store the data to... one option would be to take videos every 10 seconds and to store the 10-second video files onto the dropbox folder, and these files will be uploaded immediately. recording period might be a reasonable time like 5 minutes? or 10...</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">==============================================</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">30/05/2012</span></div>
</div>
<div style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div>
<span style="font-family: Arial;">Diagram for a friend in the internet who is also doing similar project</span></div>
<div>
<span style="font-family: Arial;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitXMI-yqMCVV3gz7R1YybZH8ys95hTcLjQ9KaL4JHaG-b9OdJceFwX3ZK2uh95ky5j9gpZ-h5dXGBH5RcrWCTJVfgfFE0zmiAySvmTwsTSlB-0tz6iEhh4OC_a-ouWRFrhGVe6e3CJhEU/s1600/p1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitXMI-yqMCVV3gz7R1YybZH8ys95hTcLjQ9KaL4JHaG-b9OdJceFwX3ZK2uh95ky5j9gpZ-h5dXGBH5RcrWCTJVfgfFE0zmiAySvmTwsTSlB-0tz6iEhh4OC_a-ouWRFrhGVe6e3CJhEU/s320/p1.gif" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh31jW51TBBq7RrdAnoKnlIKxGc57lCqdTM8TOKHPZ70mVEDE1zkWoZQrZPNRD3rhYRzwzOCjyhp3k-rCfcRmfJegwOvspydxpzntbiB3PXk2prqJD3WjsyAvD2IQp2KoE5tJ6YTgUty80/s1600/p2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh31jW51TBBq7RrdAnoKnlIKxGc57lCqdTM8TOKHPZ70mVEDE1zkWoZQrZPNRD3rhYRzwzOCjyhp3k-rCfcRmfJegwOvspydxpzntbiB3PXk2prqJD3WjsyAvD2IQp2KoE5tJ6YTgUty80/s320/p2.gif" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjRcZps0MhYB_UhyW71qQEi18j87hqZEnZgvqzQ-IBAZ5jILD7uTyFS5pTNtfIYyT4qBSkYE0LlswA5HGetPNMZt4KwK7rTGCTFnD4mCPSPPfjAit4t1YZUgEdoWukqnGJKdI0t9SohVk/s1600/p3.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjRcZps0MhYB_UhyW71qQEi18j87hqZEnZgvqzQ-IBAZ5jILD7uTyFS5pTNtfIYyT4qBSkYE0LlswA5HGetPNMZt4KwK7rTGCTFnD4mCPSPPfjAit4t1YZUgEdoWukqnGJKdI0t9SohVk/s320/p3.gif" width="192" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="background-color: red;"><span class="Apple-style-span" style="color: white;">PS: for the photo-transistor Resistor, I had to use something around 100k to achieve good result at the end!</span></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaYwvfWwQCVz6d6ROyayUeJ4L463rMFivC9B2g6jqzH2n228Nt7ToI8aLt2OdPNJ4euIaqcwNxHgxuvGal2cw167QCpBmXk2CI7GDR5qfizm2juDbai98YBNHUwbeuqANP4KzDMMFfyAo/s1600/p4.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaYwvfWwQCVz6d6ROyayUeJ4L463rMFivC9B2g6jqzH2n228Nt7ToI8aLt2OdPNJ4euIaqcwNxHgxuvGal2cw167QCpBmXk2CI7GDR5qfizm2juDbai98YBNHUwbeuqANP4KzDMMFfyAo/s320/p4.gif" width="192" /></a></div>
<div style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">==============================================
</span></div>
<div style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;"><br /></span></div>
<div style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; line-height: normal; white-space: normal;">31/05/2012</span></div>
<br />
<span class="co2" style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"><br /></span><br />
<span class="co2" style="font-family: 'Courier New', Courier, monospace; line-height: 14px; white-space: nowrap;"><b style="color: red;">IR sensor and Arduino Source Code</b><b style="color: red; font-size: x-large;"> (</b>draft v1, haven't tested yet on arduino :P<b style="color: red; font-size: x-large;">)</b></span><br />
<span style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: x-small;"><span style="line-height: 14px; white-space: nowrap;"><br /></span></span><br />
<br />
<div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma;"><br /></span></div>
</div>
<div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">#if defined(ARDUINO) && ARDUINO > 18 // Arduino 0019 or later</span><br />
<span style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">#include <SPI.h></span><br />
<span style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">#endif</span><br />
<span style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">#include <Ethernet.h></span><br />
<span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">//#include <EthernetDNS.h> Only needed in Arduino 0022 or earlier</span><br />
<span style="color: #339900; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">#include <Arduino2Weibo.h></span><br />
<br />
<span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// Ethernet Shield Settings</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">byte mac</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">[</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">]</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #208080; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0xDE</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">, </span><span style="color: #208080; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0xAD</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">, </span><span style="color: #208080; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0xBE</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">, </span><span style="color: #208080; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0xEF</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">, </span><span style="color: #208080; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0xFE</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">, </span><span style="color: #208080; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0xED</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<br />
<span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// substitute an address on your own network here</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">byte ip</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">[</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">]</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">192</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">, </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">168</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">, </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">2</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">, </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">250</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<br />
<span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// Your Keys to Weibo (get it from http://arduino2weibo.sinaapp.com/</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">Weibo weibo</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"YOUR-TOKEN-HERE"</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">,</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"YOUR-TOKEN-SECRET-HERE"</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<br />
<span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// ======== Pin ==========</span><br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> emitPin </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">13</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// Infrared LED pin</span><br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> analogPin </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">3</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// IR sensor connected to analog pin</span><br />
<br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> ambientVal </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// variable to store the </span><br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> thresVal </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// variable to store the LED on value</span><br />
<br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">void</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> setup</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><br />
<span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> pinMode</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">emitPin, OUTPUT</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Ethernet.</span><span style="color: #007788; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">begin</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">mac, ip</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Serial.</span><span style="color: #007788; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">begin</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">9600</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Serial.</span><span style="color: #007788; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">println</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"sending system status ..."</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> wStatus </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> SendWeibo</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"System is Okay, Calibrating IR system..."</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// give you time to close door!</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> delay</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">10000</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// calibrate IR system</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Calibrate</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// finished calibrating!</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> wStatus </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> SendWeibo</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"IR system calibrated, System is now in operation!"</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">void</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> loop</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><br />
<span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">if</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">CheckIR</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">==</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">1</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> wStatus </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> SendWeibo</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"#Warning# Door is open!!!"</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// stop for 10 minutes</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> delay</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">600000</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Calibrate</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> delay</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">500</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<br />
<span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<br />
<span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">//=======================================================================</span><br />
<span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">//============================ Functions ================================</span><br />
<span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">//=======================================================================</span><br />
<br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> SendWeibo</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">char</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> msg</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">[</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">]</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">if</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">weibo.</span><span style="color: #007788; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">post</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">msg</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> status </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> weibo.</span><span style="color: #007788; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">wait</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">if</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">status </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">==</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">200</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Serial.</span><span style="color: #007788; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">println</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"Weibo sent Successfully"</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">return</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">1</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">else</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Serial.</span><span style="color: #007788; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">println</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"Weibo sent failed(#1)"</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">return</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">else</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Serial.</span><span style="color: #007788; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">println</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">"Weibo sent failed(#2)"</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">return</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> Calibrate</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// Emitter Off, taking ambient value</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> digitalWrite</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">emitter,LOW</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> delay</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">500</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> ambientVal </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> analogRead</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">analogPin</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// read the input pin</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// Emitter On, taking LED ON value</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> digitalWrite</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">emitter,LOW</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> delay</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">500</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> thresVal </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> analogRead</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">analogPin</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// read the input pin</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// taking thresVal as the mid value of off and on IR measurement</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> thresVal </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">thresVal </span><span style="color: #000040; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">+</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> ambientVal</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: #000040; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">/</span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">2</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">return</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">1</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> CheckIR</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">int</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> curVal </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">=</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> analogRead</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">analogPin</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// read the input pin </span><br />
<br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #666666; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">// if curVal is below threshold, means door is open</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">if</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">(</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">curVal </span><span style="color: navy; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"><</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> thresVal</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">)</span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">return</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">1</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">else</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">{</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">return</span><span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: #0000dd; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">0</span><span style="color: teal; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">;</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span><br />
<span style="background-color: #f0f0f0; color: #0000bb; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;"> </span><br />
<span style="color: green; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 14px; white-space: nowrap;">}</span></div>
</td></tr>
</tbody></table>
<div>
<br /></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================================</div>
<div>
04/06/2012</div>
<div>
<br /></div>
<div>
The IR sensor code I wrote last time isn't working very well, so I re-wrote it with fewer lines and better performance as well :)</div>
<div>
<br /></div>
<div>
I dumped the calibration function, and take the on and off IR value each time and compare them, which gives a more accurate and responsive result.<br />
<br />
result:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/H5dRL6Di614?feature=player_embedded' frameborder='0'></iframe></div>
<br /></div>
<div>
<br /></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
<span style="color: #666666; font-style: normal;">// ======== Pin ==========</span><br />
<span style="color: blue;">int</span> emitPin <span style="color: navy;">=</span> <span style="color: #0000dd;">3</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// Infrared LED pin</span><br />
<span style="color: blue;">int</span> analogPin <span style="color: navy;">=</span> A5<span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// IR sensor connected to analog pin</span><br />
<br />
<span style="color: blue;">int</span> ambientVal <span style="color: navy;">=</span> <span style="color: #0000dd;">0</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// variable to store the </span><br />
<span style="color: blue;">int</span> thresVal <span style="color: navy;">=</span> <span style="color: #0000dd;">0</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// variable to store the LED on value</span><br />
<br />
<span style="color: blue;">void</span> setup<span style="color: green;">(</span><span style="color: green;">)</span><br />
<span style="color: green;">{</span><br />
pinMode<span style="color: green;">(</span>emitPin, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>analogPin, INPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
Serial.<span style="color: #007788;">begin</span><span style="color: green;">(</span><span style="color: #0000dd;">9600</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
Serial.<span style="color: #007788;">println</span><span style="color: green;">(</span><span style="color: red;">"Arduino Starting ... Close door now..."</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// give you time to close door!</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">5000</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// finished calibrating!</span><br />
Serial.<span style="color: #007788;">println</span><span style="color: green;">(</span><span style="color: red;">"Sensor operation started!"</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> loop<span style="color: green;">(</span><span style="color: green;">)</span><br />
<span style="color: green;">{</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>CheckIR<span style="color: green;">(</span><span style="color: green;">)</span> <span style="color: navy;">==</span> <span style="color: #0000dd;">1</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
Serial.<span style="color: #007788;">println</span><span style="color: green;">(</span><span style="color: red;">"Door is closed!"</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">else</span><span style="color: green;">{</span><br />
Serial.<span style="color: #007788;">println</span><span style="color: green;">(</span><span style="color: red;">"door is open!"</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">10000</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">500</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: #666666; font-style: normal;">//=======================================================================</span><br />
<span style="color: #666666; font-style: normal;">//============================ Functions ================================</span><br />
<span style="color: #666666; font-style: normal;">//=======================================================================</span><br />
<br />
<br />
<br />
<span style="color: blue;">int</span> CheckIR<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span> emitPin ,LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">200</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> offVal <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>analogPin<span style="color: green;">)</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// read the input pin </span><br />
digitalWrite<span style="color: green;">(</span> emitPin ,HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">200</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> onVal <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>analogPin<span style="color: green;">)</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// read the input pin </span><br />
digitalWrite<span style="color: green;">(</span> emitPin ,LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// if curVal is below threshold, means door is open</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>onVal <span style="color: navy;">></span> <span style="color: green;">(</span>offVal<span style="color: #000040;">+</span>onVal<span style="color: green;">)</span><span style="color: #000040;">/</span><span style="color: #0000dd;">2</span><span style="color: #000040;">*</span><span style="color: purple;">1.2</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
<span style="color: blue;">return</span> <span style="color: #0000dd;">1</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">else</span> <span style="color: green;">{</span><br />
<span style="color: blue;">return</span> <span style="color: #0000dd;">0</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: green;">}</span></td></tr>
</tbody></table>
<div>
<br /></div>
</div>
<div>
<br /></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-58466512750975635532012-02-18T14:46:00.001+00:002012-07-08T00:00:55.607+01:00[C++] Fast Trigonometric FunctionsWhy?<br />
<br />
To improve algorithm performance, one direct way is to shorten calculation time. The part that consumes the most computation power would be the trig functions.<br />
<br />
The built-in trig functions are generally very good in terms of accuracy. But we don't need that level of precision, so we can sacrifice accuracy to achieve faster speed.<br />
<br />
We only use SIN, COS, ACOS and ATAN in our algorithm, so this post will describe only these functions.<br />
<br />
<br />
<a name='more'></a><br />
<b><u>SIN and COS</u></b><br />
<br />
One popular, easy and really fast way is to use look-up table.<br />
Firstly I generated a list of 256 input from 0 to 360, with equal intervals, and get a list of results for each input.<br />
<br />
and then use the list of results as our table, and input (in degree) as our index. so let's say we need to get SIN(30), we just need to look up the 30th value in the table.<br />
<br />
The reason that I use 1 degree instead of smaller interval, is that not only it saves spaces, but also I won't need that kind of precision. we can obviously do smaller interval like 0.5, or 0.2. just do some index conversion before looking up.<br />
<br />
Actually, we don't need the full cycle of SIN, we just need the first quarter cycle, because the whole cycle can be replicated by the first quarter, so we save a lot of memory! All we have to do is to add some if/else statements, and do some tricks on the index system.<br />
<br />
Since SIN and COS are very close brothers (or sisters), that COS is just a shifted version of SIN, and we can lookup its value from the same table. The difference is just on the indexing.<br />
<br />
Because we are only using integer degree input, and the result for it was computed from the built-in SIN function, so it's guaranteed to be correct!<br />
<br />
[Upload Source Code]<br />
<br />
<br />
<b><u>ACOS</u></b><br />
<br />
ACOS is different, because input will be between -1 and 1, if we are going to use look-up table, we will need to do index conversion that involves multiplication and division which will kill the performance. Also the table need to be huge because we can't reduce table size like what we did in the SIN function. So might be better to use infinite series <a href="http://en.wikipedia.org/wiki/Inverse_trigonometric_function">stated here</a>.<br />
<br />
It should be noted that the more accurate, the higher power term needs to be computed. Power is a terrible performance killer, so I will only keep the first 4 terms.<br />
<br />
To verify the accuracy, we can compare the built-in method with the 'polynomial' method in Excel.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNDr4V9DG5wIaUp3_EDCKoxjpwIc5p64yiwcet2mul_8yv6thUa3yXlvgIJ8yHH9iPNvuf4K_7uHp4vMbkHOvBQervKznuo-PTiHGX3blbElHK804Y1LZZojDwlDXeOQejeRZCWLq2wvM/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNDr4V9DG5wIaUp3_EDCKoxjpwIc5p64yiwcet2mul_8yv6thUa3yXlvgIJ8yHH9iPNvuf4K_7uHp4vMbkHOvBQervKznuo-PTiHGX3blbElHK804Y1LZZojDwlDXeOQejeRZCWLq2wvM/s640/1.jpg" width="640" /></a></div>
<br />
As we can see, the error rises exponentially after about 0.3. It is obvious what we have a larger error as we go near 1. Because we are only keeping the first few polynomial terms, as we go nearer to 1, the neglected terms will become significant, thus making the difference obvious.<br />
<br />
what we can do here, is to replace the polynomial method with look-up table, let say when input is larger than 0.8, when the error could have reached about 1%.<br />
<br />
New method is about 15 times faster! (measured in VC++)<br />
<br />
[Upload Source Code]
<br />
<br />
<br />
<b><u>ATAN</u></b><br />
<br />
I have been search for a way to do it. But none seems to be faster than C++ ATAN. So I will stick with it for now.<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-31339130375171941192012-01-21T23:04:00.000+00:002012-08-23T11:39:48.038+01:00Hexapod Robot with 3 DOF legs (degree of freedom)<div class="separator" style="clear: both; text-align: left;">
This is an upgrade of the Hexapod Robot with 2DOF leg here:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://arduin0.blogspot.com/2012/01/hexapod-robot-with-2-dof-legs-degree-of.html">http://arduin0.blogspot.com/2012/01/hexapod-robot-with-2-dof-legs-degree-of.html</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So far we have:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
[31/Jan/2012]</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/ibsfN525eiE?feature=player_embedded' frameborder='0'></iframe></div>
<br />
[13/Feb/2012]<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/m2V1K0d_Eoc/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/m2V1K0d_Eoc?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" />
<param name="bgcolor" value="#FFFFFF" />
<embed width="320" height="266" src="http://www.youtube.com/v/m2V1K0d_Eoc?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash"></embed></object></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
[03/Apr/2012]</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/Z12yQmpwDd4?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
[22/Aug/2012]</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/gWJdloqWNrM?feature=player_embedded' frameborder='0'></iframe></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a><br />
I have ordered parts from Lynxmotion, but they don't have them in stock, so I will have to wait for another 1 or 2 months. Before that, I will build a smaller version hexapod robot to implement the algorithms.<br />
<br />
Most of the parts in this project would be inherited from the 2DOF version robot, except the base.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVS-Ybfcqw50_C8fj2YJop-3x9qotVpvY2Pg0YJZnMrlFWjzP0bmipa6dkY_EiO5e2T-RDsgOC5h-Ijlnxirzz44haOwoelDTFhQNSnM5Q4FSpiuERgcI2vgqo_zJ5P5ET4MYjpU77M40/s1600/170120121368.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVS-Ybfcqw50_C8fj2YJop-3x9qotVpvY2Pg0YJZnMrlFWjzP0bmipa6dkY_EiO5e2T-RDsgOC5h-Ijlnxirzz44haOwoelDTFhQNSnM5Q4FSpiuERgcI2vgqo_zJ5P5ET4MYjpU77M40/s400/170120121368.jpg" width="300" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggPyxGC97izaIrDJh5M6xKNwwUnIR_OU8wwnC-fZ95qGEYS8i5Qh6-RiAyPtMLjmW8WLTnNrqyvNyCpYedKoHSeZ1DLd5uZtaEqwQd71F8UZwdqVon7b8tlfStnWX45RFmn5YHls3D6nE/s1600/180120121370.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggPyxGC97izaIrDJh5M6xKNwwUnIR_OU8wwnC-fZ95qGEYS8i5Qh6-RiAyPtMLjmW8WLTnNrqyvNyCpYedKoHSeZ1DLd5uZtaEqwQd71F8UZwdqVon7b8tlfStnWX45RFmn5YHls3D6nE/s320/180120121370.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhosHz3XIY5vBC5LCagQp_Gk6yok8lf3J5bdktVJihMG3DXQiMxjA9Y5uVNNvZoMTBoASkelwEGeoNQvhhDnb9wwqoRcsXzw0kUwSmB80TYzW-hVqTnZD2mJvI_ufPk3fEm642VgBA7dH4/s1600/180120121369.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhosHz3XIY5vBC5LCagQp_Gk6yok8lf3J5bdktVJihMG3DXQiMxjA9Y5uVNNvZoMTBoASkelwEGeoNQvhhDnb9wwqoRcsXzw0kUwSmB80TYzW-hVqTnZD2mJvI_ufPk3fEm642VgBA7dH4/s320/180120121369.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKZtkpCS7bEmpmes4x6Fn7t1fgCTLycijVxP7tLmzs5nWlj6KVDHMCEE3gJLhzTj0VvLyEdke04Vu8uOcP17ZW0VqqP3Hel8NWdJ4praLLfvuJul7HLR_M99QiVzUZ6nwMupoQUawy6Io/s1600/210120121373.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKZtkpCS7bEmpmes4x6Fn7t1fgCTLycijVxP7tLmzs5nWlj6KVDHMCEE3gJLhzTj0VvLyEdke04Vu8uOcP17ZW0VqqP3Hel8NWdJ4praLLfvuJul7HLR_M99QiVzUZ6nwMupoQUawy6Io/s320/210120121373.jpg" width="320" /></a></div>
<br />
I wanted to make a servo interface with the shield I bought off ebay, which would making it so easy to install the servos without making a mess. In theory i could use 48 servos on a Mega board, but I only soldered 20 servo ports, just to keep wires tidy and compact. I need only 18 servos for the legs and possibly 2 for the sensors anyway.<br />
<br />
I am leaving some space on the right hand side of the board to put a adjustable voltage regulator in, as I am planning to use 8xAA batteries, or 3 lipo 11V batteries in the future.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib6m3SWKOh62Cm1HbdxAXDpdf_rYkzQQG6Go48Ke_KmCembdmSnd7wSVvOM2BT8FxjRL-V7myNIP2WQzZVmbkxqef2CqaiOPsqodLiXGzNz24wqPhgbuyQoZVbP4KslQCfZM-OfNReUGs/s1600/220120121374.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib6m3SWKOh62Cm1HbdxAXDpdf_rYkzQQG6Go48Ke_KmCembdmSnd7wSVvOM2BT8FxjRL-V7myNIP2WQzZVmbkxqef2CqaiOPsqodLiXGzNz24wqPhgbuyQoZVbP4KslQCfZM-OfNReUGs/s320/220120121374.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzHzqe8-dWxbT6cvt2s_DGVuWBecNxoqJC4IvEWK7P6zsT8t3QiGO7dEuSUzCkajBj_bx3kC5qTbhaSAtVJfXBT-Uc5S6j219Uf8vctWcECwOx_xsBUWuaZoe6UQaWsn47cqeYpdAUuDM/s1600/220120121377.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzHzqe8-dWxbT6cvt2s_DGVuWBecNxoqJC4IvEWK7P6zsT8t3QiGO7dEuSUzCkajBj_bx3kC5qTbhaSAtVJfXBT-Uc5S6j219Uf8vctWcECwOx_xsBUWuaZoe6UQaWsn47cqeYpdAUuDM/s320/220120121377.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH4x9tO6Tr5ieBnzDXv2HmA_dNk6Dew03n1UW5sV0EkiWYl8MQWk2hrj2tKks5egvlY63St8NuxQ-CCt9Q6xhfK9_TGienLVdyifJG1Aw9mMDnbXHlGiEWbCls9LQBlMm981yG8H390PI/s1600/220120121378.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH4x9tO6Tr5ieBnzDXv2HmA_dNk6Dew03n1UW5sV0EkiWYl8MQWk2hrj2tKks5egvlY63St8NuxQ-CCt9Q6xhfK9_TGienLVdyifJG1Aw9mMDnbXHlGiEWbCls9LQBlMm981yG8H390PI/s320/220120121378.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgwAaw40v8lJIZrYM_9lDg6SFHWzgYNT1bpeVaO6EGFR7-rkSAHJFCKvm37PECdHFQie9TzIKy40joTaegJNUqYr0naXbLn_2enFYZKF6WQAJJsyI4ORBiAabdyt8Jsk64kMiGs6rMaY/s1600/220120121379.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgwAaw40v8lJIZrYM_9lDg6SFHWzgYNT1bpeVaO6EGFR7-rkSAHJFCKvm37PECdHFQie9TzIKy40joTaegJNUqYr0naXbLn_2enFYZKF6WQAJJsyI4ORBiAabdyt8Jsk64kMiGs6rMaY/s320/220120121379.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
===========================================<br />
Update<br />
============================================<br />
28/01/2012<br />
<br />
Redesigned and made another base, with smaller diameter and larger thickness. the Previous one was too thin that it actually bends a little when it's standing.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUh8h86eovHqDYDRnEkch0sS78F-5raXE89n3mRcEl6NxAoKDju69UCO6A4UbqalCGOo-9ThekJUJMRyDVZ3YiAD01MEmXkbf7C3AtAtC_Zyp5dcXh7iD4m_heSMKrashycqi4Xiq6WQo/s1600/280120121386.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUh8h86eovHqDYDRnEkch0sS78F-5raXE89n3mRcEl6NxAoKDju69UCO6A4UbqalCGOo-9ThekJUJMRyDVZ3YiAD01MEmXkbf7C3AtAtC_Zyp5dcXh7iD4m_heSMKrashycqi4Xiq6WQo/s320/280120121386.jpg" width="320" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDAgI5fgp91wgdEq9IUfN6a-gLA5q-C1gpThpQmzY8G6zAn6uu_Moz_NlojzxEEsWUnGyjWZeJVNrhg-dHUDUlA47TeKMqS7iHmq55lqhxLcPPRswX3tl3m7RxoNe7JwCFZDy50EBMycw/s1600/280120121387.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDAgI5fgp91wgdEq9IUfN6a-gLA5q-C1gpThpQmzY8G6zAn6uu_Moz_NlojzxEEsWUnGyjWZeJVNrhg-dHUDUlA47TeKMqS7iHmq55lqhxLcPPRswX3tl3m7RxoNe7JwCFZDy50EBMycw/s320/280120121387.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpykA331ZsOElWYv3mDgTHvM1iOHsDH_gm_UyYu-YK_gHlHXBwiH0Nqv7dEBhdo2PWqYDKOn7GxfYsZQ0iCM1PJ0c1Gv1jv3j2yh7I_eT3CoaINuw5Nm8DJYpXQVDJWLqGTXpTZGFwAy0/s1600/280120121388.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpykA331ZsOElWYv3mDgTHvM1iOHsDH_gm_UyYu-YK_gHlHXBwiH0Nqv7dEBhdo2PWqYDKOn7GxfYsZQ0iCM1PJ0c1Gv1jv3j2yh7I_eT3CoaINuw5Nm8DJYpXQVDJWLqGTXpTZGFwAy0/s320/280120121388.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigN7TTO6URBDzatezwyZeNZBp9KYWnIfaSMUwfqd2-hMZn06JbHXAo9ve49z_1jp4pTVLCAdD5TwNZXtlCp5vLP4JYqhaB33ZpEhRyyBv8aP2I_i9rGGRYNokjg1d6xnwyP6Wcs67yFuY/s1600/280120121391.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigN7TTO6URBDzatezwyZeNZBp9KYWnIfaSMUwfqd2-hMZn06JbHXAo9ve49z_1jp4pTVLCAdD5TwNZXtlCp5vLP4JYqhaB33ZpEhRyyBv8aP2I_i9rGGRYNokjg1d6xnwyP6Wcs67yFuY/s320/280120121391.jpg" width="320" /></a></div>
<br />
found that when casting float to int, numbers are floor rounded e.g 4.4 = 4, 4.8 also = 4. which would introduce round-off error. need to implement number casting function to resolve this.<br />
<br />
<br />
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><div align="left">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> FloatToInt(</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">float</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> input){</span></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// this is an alternative to cast number directly, to avoid floor rounding</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> temp = (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">)input; </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// floor-rounded input</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">float</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> dif = input - (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">float</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">)temp; </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">//</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (dif < 0.5) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> temp;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">else</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> temp+1;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
</td></tr>
</tbody></table>
<br />
<br />
Also there is another problem with responding speed. I check the resulted in the C++ code against the simulation excel spreadsheet, found the error margin is quite big, because I was using int for all the calculations. I then change all of them into float. Although it works on the robot, but the responding time increased quite obviously, also the robot movement become unstable. I think it's because of the computational power of the Arduino just isn't good enough to do pure floating point IK cacluation. I will need to think of a way to balance between accuracy and computational load.<br />
<br />
I have also place 2 4xAA battery holders in parallel to supply more current, because i found it could draw up to 1.5A when the servos are loaded which causes voltage to drop and fail to supply enough current and lead to legs paralysis.<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
29/01/2012<br />
<br />
Found a coupld of bugs in the algorithm, thanks to my Excel spread sheet simulation! Now the pitch and roll movements finally work properly, although the legs are still quite unstable. I still don't know why that is, maybe the dimension is still not correct, or maybe there are still bugs in the algorithms. <br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
09/02/2012<br />
<br />
I have now adapted rotation matrix in Body IK algorithm, instead of estimating coordinate changes, i will be using formula derive from rotation matrix to calculate these changes (detail could be found in my last post, IK implementation).<br />
<br />
I have also started to use micro seconds instead of degrees to write servos.<br />
<br />
I have also had a major modification on the legs. It's now doubled the length of the original.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7zLi7XG9hbiax6taqycssUaUwKEivVQGjF2AruabNa2a2iqbv0M6j__gtldWRlesCP4PivY1XCdCToZUj1GFoe3gJN58KMie2RC9stxiutztND1jnjkR3bYx-ufI2EU786DdEPuO_yV8/s1600/120220121402.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7zLi7XG9hbiax6taqycssUaUwKEivVQGjF2AruabNa2a2iqbv0M6j__gtldWRlesCP4PivY1XCdCToZUj1GFoe3gJN58KMie2RC9stxiutztND1jnjkR3bYx-ufI2EU786DdEPuO_yV8/s400/120220121402.jpg" width="400" /></a></div>
<br />
<br />
Found a problem with pin22 and pin32 when using them as servo pins. These two pins interference with each other, ie, control one of them would control the other one too. Luckily I made 20 pins, so I can just easily move up all the pins by 1, ie, now using 23 - 41.<br />
<br />
We had a water tank overflow on the roof tonight, was a bit scary and we spent hours looking at the problem, so didn't do much testing on the new setup. will try tomorrow.<br />
<br />
The main problem with it at the moment remains to be leg-end position accuracy. I don't know whether it's the hardware or the software. But since I have move all the calculation into floating point, it should give relatively good numerical results.<br />
<br />
I have started looking at Gait, might implement 6 step ripple gait first.<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
12/02/2012<br />
<br />
<br />
Last night, I implemented a simple 6 step ripple gait, which I will explain in a minute. Let me explain what's the problem I discovered first with the IK algorithm.<br />
<br />
When the legs are meant to move along Z axis, the front and rear legs are actually moving toward Z-X direction, which is not right. So I wrote a<a href="http://arduin0.blogspot.com/p/test.html"> test program</a> to test the leg IK algorithm by checking the actually physical change of the leg position, versus the coordinate I entered manually. Again the legs won't move solely along one particular axis (X or Z), but tend to go somewhere in between.<br />
<br />
Spent an evening thinking about it, realize the original idea of calculation IK isn't perfect for my type of hexapod robot, which each leg are in a different frame (frame - Axis system), but I have always been assuming they are in the same frame as the center of body. for example, the frame of the front right leg is rotated -30 degree from the frame of the center of body (see below picture), so before we calculate the change of angles from leg IK algorithm, we need to do coordinate transformation first, to convert it from body frame to the coxa frame.<br />
<br />
A common way would be using rotation matrix. detail please go to my<a href="http://arduin0.blogspot.com/2012/01/inverse-kinematics-ik-implementation.html"> IK implementation post</a>.<br />
<br />
after the modification, the robot can finally walk like one. ; )<br />
<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
19/02/2012<br />
<br />
Good news from Robotshop! My parts have finally arrived their warehouse and has been already shipped to me. So I got to hurry up finishing body balance algorithm this week (probably my last implementation on IK)<br />
<br />
This weekend I:<br />
1. tidied up the code a lot!<br />
2. implemented fast <a href="http://arduin0.blogspot.com/2012/02/c-fast-trigonometric-functions.html">SIN, COS, ACOS functions</a> (about 10 times faster than standard C trig functions! body rotation is so much smoother now)<br />
<span class="Apple-style-span">3. implemented 7 more gaits (thanks to </span><span class="Apple-style-span" style="background-color: white; font-family: Verdana; font-size: x-small;">Jeroen Janssen</span><span class="Apple-style-span">'s source code, I copied most of the stuff over)</span><br />
(1) Ripple 12 steps<br />
(2) Quadripple 9 steps<br />
(3) Tripod 4 steps<br />
<br />
(4) Tripod 6 steps<br />
(5) Tripod 8 steps<br />
(6) Wave 12 steps<br />
(7) Wave 18 steps<br />
<br />
4. modified code to avoid using 'delay()', but to get the time using 'millis()', so processor can do other stuff while waiting rather than just freezes there. Also brings a bit more smooth movement there.<br />
<br />
<br />
All looking great! however because I am getting so many functions and gaits now, I am having trouble with controls... nun-chuck is simple and handy, but it's very limited in terms of control options. I might need to come up with a menu system that I can switch between modes (body rotation, walking mode), and under walking mode i can also switch between gait types... I just love the nunchuck and don't want to replace it!<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
03/04/2012<br />
<br />
<br />
Took me 2 weeks to assemble the new body from Lynxmotion... (13 days of watching TV and 1 day of actually working :p ). The new body is great, although a bit too heavy than i thought it would be. The servos and the battery works very well together, max current supply is now up to 30A !!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfMaRr6jQ5CBQm3nNiIfmQEfeu5K4kOP4FxoC6mJkL1s2JPqR-HiC1dGR6Bd6E02Rwe-r_jxvaNYq57Xhedo8GcwdASxtYa0CQHoCJr8Pw5SXCO-Ziv2vNsLMGcVmlKW4paT1bF8cw84/s1600/IMAG0002.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfMaRr6jQ5CBQm3nNiIfmQEfeu5K4kOP4FxoC6mJkL1s2JPqR-HiC1dGR6Bd6E02Rwe-r_jxvaNYq57Xhedo8GcwdASxtYa0CQHoCJr8Pw5SXCO-Ziv2vNsLMGcVmlKW4paT1bF8cw84/s320/IMAG0002.jpg" width="191" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnp-xECkjM6f5cX5Ldwwl0N8hotTi0-rOCUqvocDjRDR46RSiXBEDUvlOaTTFa1-03xrPL5kgBxexznIOMd4N5NEoC8J7fCeGBI8pAx1SIh_BkDgiBVTwadoLUt5ktPw5IZQcYMqKFX5I/s1600/IMAG0003.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnp-xECkjM6f5cX5Ldwwl0N8hotTi0-rOCUqvocDjRDR46RSiXBEDUvlOaTTFa1-03xrPL5kgBxexznIOMd4N5NEoC8J7fCeGBI8pAx1SIh_BkDgiBVTwadoLUt5ktPw5IZQcYMqKFX5I/s320/IMAG0003.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhZf-lep-8fjO99mIdHp9RXr6QBzDG4FU3ti9E8NrxNP6j1jaQw16hfwDOlgwb61mpskRfIZXmlF9w5mXbzTAV4tjnHN0g1d7SRzCozAuyRs7rcmt_4WzV7KuuTgmLga48bkS6mNht2e4/s1600/IMAG0004.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhZf-lep-8fjO99mIdHp9RXr6QBzDG4FU3ti9E8NrxNP6j1jaQw16hfwDOlgwb61mpskRfIZXmlF9w5mXbzTAV4tjnHN0g1d7SRzCozAuyRs7rcmt_4WzV7KuuTgmLga48bkS6mNht2e4/s320/IMAG0004.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj__2RLdDvihgPBAHfTS3OFcpLgX1z5FiEcdospA3_bdszKl_OP6PpNrNvzZlnWE7Wd7fXtoL9XXCK7f0znQRU7qL9SnCeTBFF0F8M1w0uQijW2XLXUrAt4Z5q5mO2PsKr9M7sC4ArcD6o/s1600/IMAG0006.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj__2RLdDvihgPBAHfTS3OFcpLgX1z5FiEcdospA3_bdszKl_OP6PpNrNvzZlnWE7Wd7fXtoL9XXCK7f0znQRU7qL9SnCeTBFF0F8M1w0uQijW2XLXUrAt4Z5q5mO2PsKr9M7sC4ArcD6o/s320/IMAG0006.jpg" width="320" /></a></div>
<br />
<br />
Haven't been doing too much, so couldn't update. Just posted another video showing all the gaits, with or without Balance mode. also wrote a menu system for the Wii remote, so it's easier to switch between body rotation and walking modes, also different gaits... Here it is:<br />
<br />
Each box represents a state, and I have 3 LEDs to indicate the different states I am in...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNM3o6B82chf-kSaH2HvZnba_oVUZKJB3et2yYHHTAy80RAZ1gPQt8DnPvRODvc0nnZ7S5c6AY7ddyS3ITUSDP3d9btaP90EsICNyxWC_m4atR4lL5ad63zW9d0q_bUCmprpmbC7Ax_s0/s1600/030420121430.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNM3o6B82chf-kSaH2HvZnba_oVUZKJB3et2yYHHTAy80RAZ1gPQt8DnPvRODvc0nnZ7S5c6AY7ddyS3ITUSDP3d9btaP90EsICNyxWC_m4atR4lL5ad63zW9d0q_bUCmprpmbC7Ax_s0/s400/030420121430.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlBWR6zrucTXu6lv7fDsJEv0vxRdfyFj2erLMz2TNwcmXV_VLFUl87ScyGGyqXT_tLoYNZZe3PlP17nDvM3i8nQ66-_1QcXktmsMECMT8BeQ4Dq8xTUj1Ie_5H0DJJDZvtMpIZ7xSCac/s1600/030420121431.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlBWR6zrucTXu6lv7fDsJEv0vxRdfyFj2erLMz2TNwcmXV_VLFUl87ScyGGyqXT_tLoYNZZe3PlP17nDvM3i8nQ66-_1QcXktmsMECMT8BeQ4Dq8xTUj1Ie_5H0DJJDZvtMpIZ7xSCac/s400/030420121431.jpg" width="400" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqcRY3G7ux1pN6k1sPWDAsWG1il1jC9lDPZEla0klJZEE_XnPJCMLaS4Oz-H3mWpepxfmNR6_MdWshg9NWiGI7e3njFHT2umg1uhlIqYQQDwSOSfYcsz4LbqQhi8RStUbOhnoqEJotSi4/s1600/030420121432.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqcRY3G7ux1pN6k1sPWDAsWG1il1jC9lDPZEla0klJZEE_XnPJCMLaS4Oz-H3mWpepxfmNR6_MdWshg9NWiGI7e3njFHT2umg1uhlIqYQQDwSOSfYcsz4LbqQhi8RStUbOhnoqEJotSi4/s400/030420121432.jpg" width="400" /></a></div>
<br />
<br />
<br />
I have also tidied up the code a lot!!! reduced about 50% of the lines... although there are more functions.<br />
<br />
I am still thinking should I use an extra Arduino to load the sensors for my next goal... maybe i should try it without first...<br />
<br />
that's it....<br />
<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
10/08/2012<br />
<br />
I started learning writing Android Apps in Java recently, and I always wanted to go 'cordless', so I decided to write one for controlling the robot via bluetooth.<br />
<br />
It was quite tough at the first few days, had no clue what to do since I had no at all experience on android app development, especially the bluetooth part, I can get it to be switched, that's about it!<br />
<br />
Luckily I bumped into a couple great source code showing how to use bluetooth and simple graphics design (I used surface layout):<br />
http://android-meda.blogspot.co.uk/2012/01/writing-your-first-android-app-body.html<br />
http://www.elecfreaks.com/677.html<br />
<br />
I wrote my first android app that controls LEDs on the arduino.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/FiCaGiOSWGw?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
12/08/2012<br />
<br />
<br />
<br />
The Hexapod Robot Controller App is finally looking promising.<br />
<br />
Here is the communication design:<br />
<br />
<u><b>Command format:</b></u><br />
4 bytes<br />
[type] [x] [y] [extra]<br />
<br />
type - is the type of action, or type of command<br />
x - first input, could be the input of X axis<br />
y - second input, could be the input of Y axis<br />
extra - third input, e.g. speed of the movement, or just 0 if not needed<br />
<br />
<br />
<u><b>Communication:</b></u><br />
1. arduino will wait for a start-up command from the phone<br />
2. arduino sends a signal back to the phone when it's available to process another command<br />
3. the phone sends command whenever the 'acknowledge signal' is received from arduino, even input is 0.<br />
<br />
<br />
<br />
<div>
=======================================================<br />
Update<br />
=======================================================<br />
13/08/2012</div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">need to do:</span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">1. to adjust speed, add extra packet<br />
when adjusting speed, delay of driving each servo would also change<br />
cap min and max speed, probably 1 to 30<br />
delay = (int)20/resol;<br /><br /><br />
2. i can't adjust speed while controlling the robot walking, so i need to add a toggle switch, to lock down the movement input, so i can adjust speed.<br />
add code and radio button for translating around Y axis<br />
add code, so when using Acce for Z, X rotation, the joystick can do Y rotation</span></div>
<br />
<br />
<br />
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span>
<div style="font-family: 'Times New Roman';">
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">=======================================================</span></div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">
<div style="font-family: 'Times New Roman';">
Update</div>
<div style="font-family: 'Times New Roman';">
=======================================================</div>
<div style="font-family: 'Times New Roman';">
14/08/2012</div>
</span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">Because I didn't setup the servo constrain properly, tragedy happened! The teeth of the gear (the top copper one) are broken... probably happened because it was forcing it while the servo can't move anymore... i could see how this happened! Luckily ( should i say that?) they have gear on ebay, although it's not cheap but still better than buying a new one which is nearly 30!</span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;">Now I just have to wait!!! Hate!!!</span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimkPEifTA5OG7NE2bUbp8PSAJGjiDppcyemcKywZ8EwJDFY_lkJsPTjNkt3mLcXu_eLZ9yY3bqH66gzg6zpxROThHn5Uge5Y8dhXfXyVVKz_csuo94lgyDbALXKygNAY7MEKzRqqUORMU/s1600/IMAG0169.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimkPEifTA5OG7NE2bUbp8PSAJGjiDppcyemcKywZ8EwJDFY_lkJsPTjNkt3mLcXu_eLZ9yY3bqH66gzg6zpxROThHn5Uge5Y8dhXfXyVVKz_csuo94lgyDbALXKygNAY7MEKzRqqUORMU/s320/IMAG0169.jpg" width="320" /></a></div>
<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
22/08/2012<br />
<br />
<br />
Fantastic! The part finally arrived! What's even better is, the ebayer sent me the whole servo instead of the gear... haha, one's mistake is the other's gain! sometimes.. :-)<br />
<br />
so let's fix it and make a video about my new android control app!<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiay8wr4wISAOXcyWVMGJSH0HfzfE4z6cLihzW0OLodQ1dmLEctaUkXjASlDjtDTzhFRdcOQ_7yfxEjCUAMj7-FwwASf01ns4Yjks2S6Ew7BHKAULR81f0E6YsR8bNUXhmcf_5BSeVi60s/s1600/72016ccajw1dw5yzv21rxj.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiay8wr4wISAOXcyWVMGJSH0HfzfE4z6cLihzW0OLodQ1dmLEctaUkXjASlDjtDTzhFRdcOQ_7yfxEjCUAMj7-FwwASf01ns4Yjks2S6Ew7BHKAULR81f0E6YsR8bNUXhmcf_5BSeVi60s/s320/72016ccajw1dw5yzv21rxj.jpg" width="295" /></a></div>
<br />
<br />
<br />
<br />
<br />
================================================================<br />
<br />
<span style="color: #f3f3f3;">To Do:</span><br />
<strike><span style="color: #f3f3f3;">1. Implement Fast trig functions</span></strike><br />
<span style="color: #f3f3f3;"><br /></span>
<strike><span style="color: #f3f3f3;">2. Convert Angles in degree/radian to MicroSeconds and use micro seconds to drive servos.</span></strike><br />
<span style="color: #f3f3f3;"><br /></span>
<strike><span style="color: #f3f3f3;">3. implement first Gait Sequence Generator</span></strike><br />
<span style="color: #f3f3f3;"><br /></span>
<strike><span style="color: #f3f3f3;">4. implement different Gaits</span></strike><br />
<span style="color: #f3f3f3;"><br /></span>
<strike><span style="color: #f3f3f3;">5. Body balancing algorithm</span></strike><br />
<span style="color: #f3f3f3;"><br /></span>
<span style="color: #f3f3f3;">6. Automation, Sensor (IR or ultra sonic), basic AI (object following, avoiding)</span><br />
<span style="color: #f3f3f3;"><br /></span>
<span style="color: #f3f3f3;"><strike>7. control remotely (maybe bluetooth, or XBee)</strike></span><br />
<span style="color: #f3f3f3;"><br /></span>
<span style="color: #f3f3f3;">8. Intermediate AI - Responses to outside world environment, possibly movement, or human gesture</span><br />
<span style="color: #f3f3f3;"><br /></span>
<span style="color: #f3f3f3;">9. <span class="Apple-style-span" style="background-color: white; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;"><em style="font-style: normal;">Terrain Adaption - more sensors on the legs - highly linked with <b>5</b>, and <b>8</b>.</em></span></span><br />
<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-46082112112925299682012-01-21T19:33:00.001+00:002012-08-23T11:51:34.762+01:00Inverse Kinematics IK Implementation for 3DOF Hexapod RobotNunchuck controlling single leg test:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/G6Rad7cVJSo?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Excel Spreadsheet simulator</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/sYLGvuJOCW0?feature=player_embedded' frameborder='0'></iframe></div>
<div>
<br /></div>
<div>
<a name='more'></a></div>
<div>
Discussion of IK algorithm can be found in my previous post:</div>
<div>
<a href="http://arduin0.blogspot.com/2012/01/hexapod-robot-gaits-calculation-inverse.html">http://arduin0.blogspot.com/2012/01/hexapod-robot-gaits-calculation-inverse.html</a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Derivation of the equations:</div>
<div>
<br /></div>
<div>
This is quite a simple trigonometry problem.<br />
<br />
Notice I have made a mistake on the first drawing about "leg length". We need to solve it on two different planes, the first plane is looking down in the same direction as Y axis, but the second might not aligned to any particluar axis, but could be some where between x and z axis. So the leg length is what we get from the equation.<br />
<br />
<br />
<br />
[Implement body roll (Z axis), pitch (X axis) and rotate (Y axis)]<br />
<br />
The principle behind a robot that moves using Inverse kinematics algorithm, is that if we move the centre of the body, it would change the coordinates of the feet end, therefore it will change the servo angles.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr6epLKvLmr58P80jxjWs72b0DmqzQTWc-8-eCJh4o2mShHTqWSOwkiBaTTkllrUY9vdV8c9Uzk_v0i4U0W-zW1urLdOy7U38lqVZza_TqmACKANkjqdwZHKpmwRxtvpWIyE8JEO9Ghp0/s1600/Image+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr6epLKvLmr58P80jxjWs72b0DmqzQTWc-8-eCJh4o2mShHTqWSOwkiBaTTkllrUY9vdV8c9Uzk_v0i4U0W-zW1urLdOy7U38lqVZza_TqmACKANkjqdwZHKpmwRxtvpWIyE8JEO9Ghp0/s640/Image+1.jpg" width="640" /></a></div>
<br />
for example, if we are moving the robot to the right (centre of robot moving from red to the blue point), the end of feet coordinates would shift to the right of the same distance as the centre of the body. The feet are stationary, so moving the body won't change the absolute positions of the feet, but their relative positions to the centre of body are changed. Therefore we need to take these changes into account, and compute the latest relative coordinates, then using LegIK procedure described above, to calculate new servo angles.<br />
<br />
To sum up, according to the change of coordinates of the body, or rotation, we can calculate the change of coordinates of the legs in Body IK algorithm, and pass that result to the Leg IK algorithm to calculate the change of the servo positions. However, I will implement these two in the reverse order.<br />
<div>
<br /></div>
</div>
<div>
Here we go.<br />
<br />
[Leg IK]</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5XVM8_E27BCPJBHljf-E2U6XqLwsasRjejlX1QtfQB9NDLmTwU8K2Kk1dGwo3PsNsGRhnpwBtfJhyphenhyphenRd79CaViKzUy7IWThNMlJ7DEhAruAI_y1uZ3CNAWAiO1-jYLliHCrtHtMmES0vY/s1600/210120121371.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5XVM8_E27BCPJBHljf-E2U6XqLwsasRjejlX1QtfQB9NDLmTwU8K2Kk1dGwo3PsNsGRhnpwBtfJhyphenhyphenRd79CaViKzUy7IWThNMlJ7DEhAruAI_y1uZ3CNAWAiO1-jYLliHCrtHtMmES0vY/s400/210120121371.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgqLoGs2xUEhn5sCEjOeC9NoSRQ2xavPz4CvMN83P9FTPwaKuFFgn1oqVZJuvAN5Y0xu2N_xVMIPGcHEBL1pNuFDlxQZHT2TXjI_aAOQDJFyC-Etn6D0qqHDG-979Ml9pZocohRZlLmcY/s1600/210120121372.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgqLoGs2xUEhn5sCEjOeC9NoSRQ2xavPz4CvMN83P9FTPwaKuFFgn1oqVZJuvAN5Y0xu2N_xVMIPGcHEBL1pNuFDlxQZHT2TXjI_aAOQDJFyC-Etn6D0qqHDG-979Ml9pZocohRZlLmcY/s400/210120121372.jpg" width="400" /></a></div>
<div>
<br /></div>
<div>
<br />
[Body IK]<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieUrFwQXV5dvSLSygZMw7RRiv4EC_PUmk5A5jYpQ1fdwhmQBwnAUc5vgyaqDlfKr9chuTLinx0-bCyqGOO59JMm18qxGEXx5agXcb6j2Rq5i-TqdrI84aRv4Lywq83oMmmi5rLP-f2a58/s1600/290120121394.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieUrFwQXV5dvSLSygZMw7RRiv4EC_PUmk5A5jYpQ1fdwhmQBwnAUc5vgyaqDlfKr9chuTLinx0-bCyqGOO59JMm18qxGEXx5agXcb6j2Rq5i-TqdrI84aRv4Lywq83oMmmi5rLP-f2a58/s400/290120121394.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9K04V84FIwMfBCXoKhy3Ow_tfRbdiKkufz3gP_l2aA7xmDwjTK4UES8VjvuVi1nkznC8hyzxGfhfvmcC7nKpM7Pt0lGS51YRPOiasbOYsGEsTXbIRTswWlmd5t5QnrABPKDvWVrQd95E/s1600/290120121395.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9K04V84FIwMfBCXoKhy3Ow_tfRbdiKkufz3gP_l2aA7xmDwjTK4UES8VjvuVi1nkznC8hyzxGfhfvmcC7nKpM7Pt0lGS51YRPOiasbOYsGEsTXbIRTswWlmd5t5QnrABPKDvWVrQd95E/s400/290120121395.jpg" width="400" /></a></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTKFz_B3o7LAe-XDoHQiq_4-AgQa37SMA_H0GPwHOtn_auShkWktJGYLxJwgRLBkc570h3CBMCZ1CrOReqe4lCBgSuFx2laAsCeR2-bR2wj40cfHBipf2r77ycK0XKg9RYcsaNpBrXMlI/s1600/290120121393.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTKFz_B3o7LAe-XDoHQiq_4-AgQa37SMA_H0GPwHOtn_auShkWktJGYLxJwgRLBkc570h3CBMCZ1CrOReqe4lCBgSuFx2laAsCeR2-bR2wj40cfHBipf2r77ycK0XKg9RYcsaNpBrXMlI/s640/290120121393.jpg" width="480" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNoLP6EoNRD_c-_ZUTPWRiBJDQ_QONebuPplDEEBG-b9EWUC0vvQ8onumaLNsW_T_9MCa_PmwhtuxX1DIonaBoyPnfXBsuncLZYIOAuTYIin5SJDo2THTG8NQbOK8kqoCYQ00NW0rrreQ/s1600/290120121396.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNoLP6EoNRD_c-_ZUTPWRiBJDQ_QONebuPplDEEBG-b9EWUC0vvQ8onumaLNsW_T_9MCa_PmwhtuxX1DIonaBoyPnfXBsuncLZYIOAuTYIin5SJDo2THTG8NQbOK8kqoCYQ00NW0rrreQ/s400/290120121396.jpg" width="400" /></a></div>
<br />
<br />
<br /></div>
<div>
So we have solved the problem. To convert the angle into usable value, simple add 90 to them before writing to servos.<br />
<br />
To make this more efficient we can write our own trigonometric functions using look up table. I have done sine and cosine functions, will do atan and tan function when I have the time.<br />
<br />
If you want the source code please contact me.<br />
<br />
[To Do]<br />
1. notice when calculating body rotation (roll and pitch), we should not just do 'tan' to estimate change in y axis, but x and/or z will change as well (although it's small, that's why I ignore it there). If we want a more natural rotation, it's best to include that, and I will probably do so in the next update.<br />
<br />
<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================
<br />
03/Feb/2012<br />
<br />
We have been working with 3D coordinates (x,z,y) in our IK algorithm, find the change in each dimension, and calculate the change of angles. Notice that each dimension is calculated using very basic trigonometric functions and ideas, which isn't very close to reality, and as you can probably see from the video demonstration the movement isn't very smooth nor natural.<br />
<br />
A more advance and complex way to calculate change of coordinates from rotations is to use Rotation Matrix. Please see <a href="http://en.wikipedia.org/wiki/Rotation_matrix">here </a>for detail. It might seem complicated and make no sense at all at first, check out youtube for some 2D rotation examples, and move on to 3D, it will become more clear.<br />
<br />
Anyway, to implement it in programming doesn't require you to understand it. If you are feeling really impatient, just copy and paste my code into yours and you won't need to worry about it ever again. So feel free to explore the field, and I will describe it briefly here as well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghOIrLJJAZsKecEBnupcOlWs3jQqszmcwytDtJ7fvPHBjz8TNwjTlowizKrrt7nZqMPEeV9vIgcNt3hDF-Zj2HAWKVaVwYfEDfcCBsqg6hBw_3gVsv4trD3SzNlpYmWGrbI6NtQ0oeLw8/s1600/040220121398.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghOIrLJJAZsKecEBnupcOlWs3jQqszmcwytDtJ7fvPHBjz8TNwjTlowizKrrt7nZqMPEeV9vIgcNt3hDF-Zj2HAWKVaVwYfEDfcCBsqg6hBw_3gVsv4trD3SzNlpYmWGrbI6NtQ0oeLw8/s400/040220121398.jpg" width="300" /></a></div>
<br />
<br />
<br />
<br />
=======================================================<br />
Update<br />
=======================================================<br />
12/Feb/2012<br />
<br />
<br />
<br />
Spent an evening thinking about it, realize the original idea of calculation IK isn't perfect for my type of hexapod robot, which each leg are in a different frame (frame - Axis system), but I have always been assuming they are in the same frame as the center of body. for example, the frame of the front right leg is rotated -30 degree from the frame of the center of body (see below picture), so before we calculate the change of angles from leg IK algorithm, we need to do coordinate transformation first, to convert it from body frame to the coxa frame.<br />
<br />
A common way would be using rotation matrix.<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqDfAiLpyO9Ly8YnPneeGNP9KQyonyXkIGMNUOyG2rQexr1T4BV6vOtWbflGWNNvh6vC2aZqOd8iTI0fA73_LSuYOsBEV4_zKrqxxO7WoSGAgkQWjlRXxxxZZMYWQi6PRUN6FrV_6vt64/s1600/120220121403.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqDfAiLpyO9Ly8YnPneeGNP9KQyonyXkIGMNUOyG2rQexr1T4BV6vOtWbflGWNNvh6vC2aZqOd8iTI0fA73_LSuYOsBEV4_zKrqxxO7WoSGAgkQWjlRXxxxZZMYWQi6PRUN6FrV_6vt64/s400/120220121403.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdJSCV0fjv91bMzxNWW18jezBIEfXhJQS8p3DcCZMYdzr-ppfMMSqfkZSPSH7mZMgofyrTjYKYaTnrElWeWFBga-pL1YpzBBNwbouigG5bZFyhepGKClai1oavGAWhw3MiTo7V-00rQ_s/s1600/120220121404.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="157" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdJSCV0fjv91bMzxNWW18jezBIEfXhJQS8p3DcCZMYdzr-ppfMMSqfkZSPSH7mZMgofyrTjYKYaTnrElWeWFBga-pL1YpzBBNwbouigG5bZFyhepGKClai1oavGAWhw3MiTo7V-00rQ_s/s400/120220121404.jpg" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
====================================================================<br />
Excel Spread sheets Downloads<br />
====================================================================<br />
<a href="https://dl.dropbox.com/u/457167/Blog_Download_Resources/Hexpod_spreadsheet_V1.xlsx">Hexapod Robot Spreadsheet V1</a> (no gaits)<br />
<a href="https://dl.dropbox.com/u/457167/Blog_Download_Resources/Hexpod_spreadsheet_V1.1.xlsx">Hexapod Robot Spreadsheet V1.1 </a>(new algorithm (modified roation), no giat)<br />
Hexapod Robot Spreadsheet V1.2 (with gait)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-2473726892483687622012-01-12T13:14:00.001+00:002013-04-27T11:47:04.710+01:00The Matrix and Quaternions FAQ<br />
<pre class="evernotePreviewArticleContainer">The Matrix and Quaternions FAQ
==============================
<a name='more'></a>
Introduction
------------
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#I1">I1. Important note relating to OpenGL and this document</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#I2">I2. Important note with respect to normalized inputs</a>
Questions
---------
BASICS
======
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q1"> Q1. What is a matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q2"> Q2. What is the order of a matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q3"> Q3. How do I represent a matrix using the C/C++ programming languages?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q4"> Q4. What are the advantages of using matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q5"> Q5. How do matrices relate to coordinate systems?</a>
ARITHMETIC
==========
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q6"> Q6. What is the identity matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q7"> Q7. What is the major diagonal matrix of a matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q8"> Q8. What is the transpose of a matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q9"> Q9. How do I add two matrices together?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q10">Q10. How do I subtract two matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q11">Q11. How do I multiply two matrices together?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q12">Q12. How do I square or raise a matrix to a power?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q13">Q13. How do I multiply one or more vectors by a matrix?</a>
DETERMINANTS AND INVERSES
=========================
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q14">Q14. What is the determinant of a matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q15">Q15. How do I calculate the determinant of a matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q16">Q16. What are Isotropic and Anisotropic matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q17">Q17. What is the inverse of a matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q18">Q18. How do I calculate the inverse of an arbitary matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q19">Q19. How do I calculate the inverse of an identity matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q20">Q20. How do I calculate the inverse of a rotation matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q21">Q21. How do I calculate the inverse of a matrix using Kramer's rule?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q22">Q22. How do I calculate the inverse of a 2x2 matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q23">Q23. How do I calculate the inverse of a 3x3 matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q24">Q24. How do I calculate the inverse of a 4x4 matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q25">Q25. How do I calculate the inverse of a matrix using linear equations?</a>
TRANSFORMS
==========
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q26">Q26. What is a rotation matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q27">Q27. How do rotation matrices relate to coordinate systems?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q28">Q28. How do I generate a rotation matrix in the X-axis?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q29">Q29. How do I generate a rotation matrix in the Y-axis?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q30">Q30. How do I generate a rotation matrix in the Z-axis?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q31">Q31. What are Euler angles?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q32">Q32. What are yaw, roll and pitch?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q33">Q33. How do I combine rotation matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q34">Q34. What is Gimbal Lock?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q35">Q35. What is the correct way to combine rotation matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q36">Q36. How do I generate a rotation matrix from Euler angles?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q37">Q37. How do I generate Euler angles from a rotation matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q38">Q38. How do I generate a rotation matrix for a selected axis and angle?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q39">Q39. How do I generate a rotation matrix to map one vector onto another?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q40">Q40. How do I use matrices to convert between two coordinate systems?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q41">Q41. What is a translation matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q42">Q42. What is a scaling matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q43">Q43. What is a shearing matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q44">Q44. How do I perform linear interpolation between two matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q45">Q45. How do I perform cubic interpolation between four matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q46">Q46. How can I render a matrix?</a>
QUATERNIONS
===========
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q47">Q47. What are quaternions?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q48">Q48. How do quaternions relate to 3D animation?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q49">Q49. How do I calculate the conjugate of a quaternion?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q50">Q50. How do I calculate the inverse of a quaternion?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q51">Q51. How do I calculate the magnitude of a quaternion?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q52">Q52. How do I normalise a quaternion?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q53">Q53. How do I multiply two quaternions together?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q54">Q54. How do I convert a quaternion to a rotation matrix?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q55">Q55. How do I convert a rotation matrix to a quaternion?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q56">Q56. How do I convert a rotation axis and angle to a quaternion?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q57">Q57. How do I convert a quaternion to a rotation axis and angle?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q58">Q58. How do I convert spherical rotation angles to a quaternion?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q59">Q59. How do I convert a quaternion to spherical rotation angles?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q60">Q60. How do I convert Euler rotation angles to a quaternion?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q61">Q61. How do I use quaternions to perform linear interpolation between matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q62">Q62. How do I use quaternions to perform cubic interpolation between matrices?</a>
<a href="http://arduin0.blogspot.com/2012/01/testintroduction-i1.html#Q63">Q63. How do I use quaternions to rotate a vector?</a>
Introduction
------------
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="I1">I1</a>. Important note relating to OpenGl and this document
-------------------------------------------------------
In this document (as in most math textbooks), all matrices are drawn
in the standard mathematical manner. Unfortunately graphics libraries
like IrisGL, OpenGL and SGI's Performer all represent them with the
rows and columns swapped.
Hence, in this document you will see (for example) a 4x4 Translation
matrix represented as follows:
| 1 0 0 X |
| |
| 0 1 0 Y |
M = | |
| 0 0 1 Z |
| |
| 0 0 0 1 |
In Performer (for example) this would be populated as follows:
M[0][1] = M[0][2] = M[0][3] =
M[1][0] = M[1][2] = M[1][3] =
M[2][0] = M[2][1] = M[2][3] = 0 ;
M[0][0] = M[1][1] = M[2][2] = m[3][3] = 1 ;
M[3][0] = X ;
M[3][1] = Y ;
M[3][2] = Z ;
ie, the matrix is stored like this:
| M[0][0] M[1][0] M[2][0] M[3][0] |
| |
| M[0][1] M[1][1] M[2][1] M[3][1] |
M = | |
| M[0][2] M[1][2] M[2][2] M[3][2] |
| |
| M[0][3] M[1][3] M[2][3] M[3][3] |
OpenGL uses a one-dimensional array to store matrices - but fortunately,
the packing order results in the same layout of bytes in memory - so
taking the address of a pfMatrix and casting it to a float* will allow
you to pass it directly into routines like glLoadMatrixf.
In the code snippets scattered throughout this document, a one-dimensional
array is used to store a matrix. The ordering of the array elements is
transposed with respect to OpenGL.
This Document OpenGL
| 0 1 2 3 | | 0 4 8 12 |
| | | |
| 4 5 6 7 | | 1 5 9 13 |
M = | | M = | |
| 8 9 10 11 | | 2 6 10 14 |
| | | |
| 12 13 14 15 | | 3 7 11 15 |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="I2">I2</a>. Important note with respect to normalized inputs
----------------------------------------------------
Note that most algorithms assume normalized inputs, such as vectors of
union length, or matrices with normalized main diagonal etc. It is possible,
and often enough the case, that algorithms (and the code snippets provided here)
work correctly with arbitrary inputs, but it is usually considered bad practise
(and you will pay in debugging time if you fail to observe this suggestion) to
rely on this property.
Answers
-------
BASICS
======
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q1">Q1</a>. What is a matrix?
----------------------
A matrix is a two dimensional array of numeric data, where each
row or column consists of one or more numeric values.
Arithmetic operations which can be performed with matrices include
addition, subtraction, multiplication and division.
The size of a matrix is defined in terms of the number of rows
and columns.
A matrix with M rows and N columns is defined as a MxN matrix.
Individual elements of the matrix are referenced using two index
values. Using mathematical notation these are usually assigned the
variables 'i' and 'j'. The order is row first, column second
For example, if a matrix M with order 4x4 exists, then the elements
of the matrix are indexed by the following row:column pairs:
| 00 01 02 03 |
M = | 10 11 12 13 |
| 20 21 22 23 |
| 30 31 32 33 |
The element at the top right of the matrix has i=0 and j=3
This is referenced as follows:
M = M
i,j 0,3
In computer animation, the most commonly used matrices have either
2, 3 or 4 rows and columns. These are referred to as 2x2, 3x3 and 4x4
matrices respectively.
2x2 matrices are used to perform rotations, shears and other types
of image processing. General purpose NxN matrices can be used to
perform image processing functions such as convolution.
3x3 matrices are used to perform low-budget 3D animation. Operations
such as rotation and multiplication can be performed using matrix
operations, but perspective depth projection is performed using
standard optimised into pure divide operations.
4x4 matrices are used to perform high-end 3D animation. Operations
such as multiplication and perspective depth projection can be
performed using matrix mathematics.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q2">Q2</a>. What is the "order" of a matrix?
-------------------------------------
The "order" of a matrix is another name for the size of the matrix.
A matrix with M rows and N columns is said to have order MxN.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q3">Q3</a>. How do I represent a matrix using the C/C++ programming languages?
-----------------------------------------------------------------------
The simplest way of defining a matrix using the C/C++ programming
languages is to make use of the "typedef" keyword. Both 3x3 and 4x4
matrices may be defined in this way ie:
typedef float MATRIX3[9];
typedef float MATRIX4[16];
Since each type of matrix has dimensions 3x3 and 4x4, this requires
9 and 16 data elements respectively.
At first glance, the use of a single linear array of data values may
seem counter-intuitive. The use of two dimensional arrays may seem
more convenient ie.
typedef float MATRIX3[3][3];
typedef float MATRIX4[4][4];
However, the use of two reference systems for each matrix element
very often leads to confusion. With mathemetics, the order is row
first (i), column second (j) ie.
Mij
Using C/C++, this becomes
matrix[j][i]
Using two dimensional arrays also incurs a CPU performance penalty in
that C compilers will often make use of multiplication operations to
resolve array index operations.
So, it is more efficient to stick with linear arrays. However, one issue
still remains to be resolved. How is an two dimensional matrix mapped
onto a linear array? Since there are only two methods (row first/column
second or column first/row column).
The performance differences between the two are subtle. If all for-next
loops are unravelled, then there is very little difference in the
performance for operations such as matrix-matrix multiplication.
Using the C/C++ programming languages the linear ordering of each
matrix is as follows:
mat[0] = M mat[3] = M
00 03
mat[12] = M mat[15] = M
30 33
| 0 1 2 3 |
| | | 0 1 2 |
| 4 5 6 7 | | |
M = | | M = | 3 4 5 |
| 8 9 10 11 | | |
| | | 6 7 8 |
| 12 13 14 15 |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q4">Q4</a>. What are the advantages of using matrices?
-----------------------------------------------
One of the first questions asked about the use of matrices in computer
animation is why they should be used at all in the first place.
Intuitively, it would appear that the overhead of for-next loops and
matrix multiplication would slow down an application.
Arguments that resolve these objections can be pointed out. These include
the use of CPU registers to handle loop counters on-board data caches
to optimise memory accesses.
Advantages can also be pointed out. By following a mathematical approach
to defining 3D algorithms, it is possible to predict and plan the
design of a 3D animation system. Such mathematical approaches allow
for the implementation of character animation, spline curves and inverse
kinematics.
However, one objection that frequently comes up is that it would be
quicker to just multiply each pair of coordinates by the rotation
coefficients for that axis, rather than perform a full vector-matrix
multiplication.
ie. Rotation in X transforms Y and Z
Rotation in Y transforms X and Z
Rotation in Z transforms X and Y
The argument to this goes as follows:
Given a vertex V = (x,y,z), rotation angles (A,B and C) and translation
(D,E,F). A the algorithm
is defined as follows:
---------------------------
sx = sin(A) // Setup - only done once
cx = cos(A)
sy = sin(B)
cy = cos(B)
sz = sin(C)
cz = cos(C)
x1 = x * cz + y * sz // Rotation of each vertex
y1 = y * cz - x * sz
z1 = z
x2 = x1 * cy + z1 * sy
y2 = z1
z2 = z1 * cy - x1 * sy
x3 = x2
y3 = y2 * cx + z1 * sx
z3 = z2 * cx - x1 * sx
xr = x3 + D // Translation of each vertex
yr = y3 + E
zr = z3 + F
---------------------------
Altogether, this algorithm will use the following amounts of processing
time:
Set-up Per-vertex
------------------------- ------------------------
6 trigonometric functions
6 assignment operations. 12 assignment
12 multiplication
9 addition
------------------------- ------------------------
Assume that the same operations is being performed using matrix
multiplication.
With a 4x4 matrix, the procesing time is used as follows:
Set-up Change Per-vertex Change
-------------------------- ------ ------------------------ ------
6 trigonometric functions 0 0
18 assignment operation -12 3 assignment -9
12 multiplication +12 9 multiplication -3
6 subtraction +6 6 addition -3
-------------------------- ------ ------------------------ ------
Comparing the two tables, it can be seen that setting up a rotation
matrix costs at least 12 multiplication calculations and an extra
18 assignment calls.
However, while this may seem extravagant, the savings come from
processing each vertex. Using matrix multiplication, the savings made
from processing just 4 vertices, will outweigh the additional set-up
cost.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q5">Q5</a>. How do matrices relate to coordinate systems?
--------------------------------------------------
With either 3x3 or 4x4 rotation, translation or shearing matrices, there
is a simple relationship between each matrix and the resulting coordinate
system.
The first three columns of the matrix define the direction vector of the
X, Y and Z axii respectively.
If a 4x4 matrix is defined as:
| A B C D |
M = | E F G H |
| I J K L |
| M N O P |
Then the direction vector for each axis is as follows:
X-axis = [ A E I ]
Y-axis = [ B F J ]
Z-axis = [ C G K ]
ARITHMETIC
==========
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q6">Q6</a>. What is the identity matrix?
---------------------------------
The identity matrix is matrix in which has an identical number of rows
and columns. Also, all the elements in which i=j are set one. All others
are set to zero. For example a 4x4 identity matrix is as follows:
| 1 0 0 0 |
M = | 0 1 0 0 |
| 0 0 1 0 |
| 0 0 0 1 |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q7">Q7</a>. What is the major diagonal of a matrix?
--------------------------------------------
The major diagonal of a matrix is the set of elements where the
row number is equal to the column number ie.
M where i=j
ij
In the case of the identity matrix, only the elements on the major
diagonal are set to 1, while all others are set to 0.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q8">Q8</a>. What is the transpose of a matrix?
---------------------------------------
The transpose of matrix is the matrix generated when every element in
the matrix is swapped with the opposite relative to the major diagonal
This can be expressed as the mathematical operation:
M' = M
ij ji
However, this can only be performed if a matrix has an equal number
of rows and columns.
If the matrix M is defined as:
| 0.707 -0.866 |
M = | |
| 0.866 0.707 |
Then the transpose is equal to:
| 0.707 0.866 |
T = | |
| -0.866 0.707 |
If the matrix is a rotation matrix, then the transpose is guaranteed
to be the inverse of the matrix.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q9">Q9</a>. How do I add two matrices together?
----------------------------------------
The rule of thumb with adding two matrices together is:
"add row and column to row and column"
This can be expressed mathematically as:
R = M + L
ij ij ij
However, both matrices must be identical in size.
For example, if the 2x2 matrix M is added with the 2x2 matrix L then
the result is as follow:
R = M + L
| A B C | | J K L |
| | | |
= | D E F | + | M N O |
| | | |
| G H I | | P Q R |
| A+J B+K C+L |
| |
= | D+M E+N F+O |
| |
| G+P H+Q I+R |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q10">Q10</a>. How do I subtract two matrices?
-------------------------------------
The rule of thumb with subtracting two matrices is:
"subtract row and column from row and column"
This can be expressed mathematically as:
R = M - L
ij ij ij
However, both matrices must be identical in size.
For example, if the 2x2 matrix L is subtracted from the 2x2 matrix M then
the result is as follows:
R = M - L
| A B C | | J K L |
| | | |
= | D E F | - | M N O |
| | | |
| G H I | | P Q R |
| A-J B-K C-L |
| |
= | D-M E-N F-O |
| |
| G-P H-Q I-R |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q11">Q11</a>. How do I multiply two matrices together?
---------------------------------------------
The rule of thumb with multiplying two matrices together is:
"multiply row into column and sum the result".
This can be expressed mathematically as:
n
--
R = \ M x L
ij / ik kj
--
k=1
If the two matrices to be multiplied together have orders:
M = AxB and L = CxD
then the two values B and C must be identical.
Also, the resulting matrix has an order of AxD
Thus, it is possible to multiply a Nx4 matrix with a 4x4 matrix
but not the other way around.
For example, if the 4x4 matrix M is defined as:
| A B C D |
M = | E F G H |
| I J K L |
| M N O P |
and a 4x2 matrix L is defined as:
L = | Q R |
| S T |
| U V |
| W X |
then the size of the resulting matrix is 4x2. The resulting matrix
is defined as:
R = M x L
| A B C D | | Q R |
= | E F G H | x | S T |
| I J K L | | U V |
| M N O P | | W X |
| AQ+BS+CU+DW AR+BT+CV+DX |
= | EQ+FS+GU+HW ER+FT+GV+HX |
| IQ+JS+KU+LW IR+JT+KV+LX |
| MQ+NS+OU+PW MR+NT+OV+PX |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q12">Q12</a>. How do I square or raise a matrix to a power?
--------------------------------------------------
A matrix may be squared or even raised to an integer power. However
there are several restrictions. For all powers, the matrix must be
square, that is orthogonal and the same width and height
For example,
-1
M is the inverse of the matrix
0
M generates the identity matrix
1
M leaves the matrix unchanged.
2
M squares the matrix and
3
M generates the cube of the matrix
Raising a matrix to a power greater than one involves multiplying a matrix
by itself a specific number of times.
For example,
2
M = M . M
3
M = M . M . M
and so on.
Raising the identity matrix to any power always generates the identity
matrix ie.
n
I = I
One can be bit faster using the following piece of code, note that m and i
are both getting changed:
m -> matrix to be raised to a power
i -> power to raise matrix to
a -> matrix that will contain the result
I -> identity matrix
/ -> integer division (ie round down to nearest whole number)
% -> integer remainder operation
* -> matrix multiplication
a=I
while(i>0){
if(i%2) a=a*m
i=i/2
m=m*m
}
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q13">Q13</a>. How do I multiply one or more vectors by a matrix?
-------------------------------------------------------
The best way to perform this task is to treat the list of vectors as
a single matrix, with each vector represented as a column vector.
If N vectors are to be multiplied by a 4x4 matrix, then they can be
treated as a single 4xN matrix:
If the matrix is defined as:
| A B C D |
M = | E F G H |
| I J K L |
| M N O P |
and the list of vectors is defined as:
| x1 x2 x3 x4 x5|
V = | y1 y2 y3 y4 y5|
| z1 z2 z3 z4 z5|
| 1 1 1 1 1|
Note that an additional row of constant terms is added to the vector
list, all of which are set to 1.0. In real life, this row does not
exist. It is simply used to make the orders of the matrix M and the
vector list V match.
Then the multiplication is performed as follows:
M . V = V'
| A B C D | | x1 x2 x3 x4 x5 | | A.x1+B.y1+C.z1+D A.x2+B.y2+C.z2+D ... |
| E F G H | . | y1 y2 y3 y4 y5 | = | E.x1+F.y1+G.z1+H E.x2+F.y2+G.z2+H ... |
| I J K L | | z1 z2 y3 y4 z5 | | I.x1+J.y1+K.z1+L I.x2+J.y2+K.z2+L ... |
| M N O P | | 1 1 1 1 1 | | M.x1+N.y1+O.z1+P M.x2+N.y2+O.z2+P ... |
For each vector in the list there will be a total of 12 multiplication
16 addition and 1 division operation (for perspective).
If the matrix is known not to be a rotation or translation matrix then the
division operation can be skipped.
DETERMINANTS AND INVERSES
=========================
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q14">Q14</a>. What is the determinant of a matrix?
-----------------------------------------
The determinant of a matrix is a floating point value which is used to
indicate whether the matrix has an inverse or not. If zero, then no
inverse exists. If non-zero, then an inverse exists.
As an example, consider a matrix consisting of a single element:
M = [ 1 ].
For a matrix of this size, the determinant is simply the value of the
single element.
Also, the inverse is simply the reciprocal of this single element:
-1
M = [ 1 / M[0][0] ]
If this single value is non-zero, then an inverse exists. In the case
of the identity matrix, this happens to be 1 / 1 or 1.0
However, if the value of this single element is zero, then the determinant
is also zero.
Attempting to calculate the reciprocal of zero, generates a value of
infinity. This isn't permitted as far a matrices are concerned, so no
inverse of the matrix exists.
For an identity matrix, the determinant is always equal to one.
Any matrix with a determinant of 1.0 is said to be isotropic.
Thus all rotation matrices are said to be isotropic, since the
determinant is always equal to 1.0.
This can be proved as follows:
| A B | | cos X -sin X |
M = | | = | |
| C D | | sin X cos X |
D = AD - BC
D = (cos X . cos X) - (-sin X . sin X)
2 2
D = (cos X ) + (sin X)
2 2
But, cos X + sin X = 1
Therefore,
D = 1
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q15">Q15</a>. How do I calculate the determinant of a matrix?
----------------------------------------------------
The determinant of a matrix is calculated using Kramer's rule, where
the value can be calculated by breaking the matrix into smaller
matrices.
For a 2x2 matrix M, the determinant D is calculated as follows:
| A B |
M = | |
| C D |
D = AD - BC
For 3x3 and 4x4 matrices, this is more complicated, but can be solved
by methods such as Kramer's Rule.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q16">Q16</a>. What are Isotropic and Anisotropic matrices?
-------------------------------------------------
An Isotropic matrix is one in which the sum of the squares of all
three rows or columns add up to one.
A matrix in which this is not the case, is said to be Anisotropic.
When 3x3 or 4x4 matrices are used to rotate and scale an object, it
is sometimes necessary to enlarge or shrink one axis more than the
others.
For example, with seismic surveys, it is convenient to enlarge the
Z-axis by a factor or 50 or more, while letting the X and Y axii
remain the same.
Another example is the implementation of "squash" and "stretch"
with character animation. When a character is hit by a heavy object
eg. an anvil, the desired effect is to make the character look stretched out
sideways and squashed vertically:
A suitable matrix would be as follows:
| 2 0 0 0 |
M = | 0 2 0 0 |
| 0 0 0.5 0 |
| 0 0 0 1 |
However, there is problem looming ahead. While this matrix will cause
no problems with the transformation of vertex data, it will cause
problems with gouraud shading using outward normals.
Because the transformation stage is implemented using matrix
multiplication, both vertex data and outward normal data will be
multiplied with this matrix.
While this is not a problem with vertex data (it is the desired effect)
it causes a major headache with the outward normal data.
After raw multiplication, each outward normal will no longer be
normalised and consequently will affect other calculations such as
shading and back-face culling.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q17">Q17</a>. What is the inverse of a matrix?
-------------------------------------
-1
Given a matrix M, then the inverse of that matrix, denoted as M , is
the matrix which satisfies the following expression:
-1
M . M = I
where I is the identity matrix.
Thus, multiplying a matrix with its inverse will generate the identity
matrix. However, several requirements must be satisfied before the
inverse of a matrix can be calculated.
These include that the width and height of the matrix are identical and
that the determinant of the matrix is non-zero.
Calculating the inverse of a matrix is a task often performed in order
to implement inverse kinematics using spline curves.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q18">Q18</a>. How do I calculate the inverse of an arbitary matrix?
----------------------------------------------------------
Depending upon the size of the matrix, the calculation of the inverse
can be trivial or extremely complicated.
For example, the inverse of a 1x1 matrix is simply the reciprocal of
the single element:
ie. M = | x |
Then the inverse is defined as:
-1 | 1 |
M = | - |
| x |
Solving 2x2 matrices and larger can be achieved by using Kramer's Rule
or by solving as a set of simultaneous equations.
However, in certain cases, such as identity or rotation matrices, the
inverse is already known or can be determined from taking the transpose
of the matrix.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q19">Q19</a>. How do I calculate the inverse of an identity matrix?
----------------------------------------------------------
Don't even bother. The inverse of an identity matrix is the identity
matrix. ie.
-1
I . I = I
Any identity matrix will always have a determinant of +1.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q20">Q20</a>. How do I calculate the inverse of a rotation matrix?
---------------------------------------------------------
Since a rotation matrix always generates a determinant of +1,
calculating the inverse is equivalent of calculating the transpose.
Alternatively, if the rotation angle is known, then the rotation
angle can be negated and used to calculate a new rotation matrix.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q21">Q21</a>. How do I calculate the inverse of a matrix using Kramer's rule?
--------------------------------------------------------------------
Given a 3x3 matrix M:
| A B C |
| |
M = | D E F |
| |
| G H I |
Then the determinant is calculated as follows:
n
---
\ i
det M = / M * submat M * -1
--- 0,i 0,i
i=1
where
submat M defines the matrix composed of all rows and columns of M
ij
excluding row i and column j. submat may be called recursively.
ij
| A B C |
M = | D E F | becomes submat = | E F |
| G H I | 11 | H I |
If the determinant is non-zero then the inverse of the matrix exists.
In this case, the value of each matrix element is defined by:
-1 1 i+j
M = ----- * det submat M * -1
j,i det M i,j
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q22">Q22</a>. How do I calculate the inverse of a 2x2 matrix?
----------------------------------------------------
For a 2x2 matrix, the calculation is slightly harder. If the matrix is
defined as follows:
| A B |
M = | |
| C D |
Then the determinant is defined as:
det = AD - BC
And the inverse is defined as:
-1 1 | D -B |
M = --- | |
det | -C A |
This can be proved using Kramer's rule. Given the matrix M:
| A B |
M = | |
| C D |
Then the determinant is:
0 1
det = M * submat M * -1 + M * submat M * -1
0,0 0,0 0,1 0,1
<=> M * M * 1 + M * M * -1
0,0 1,1 0,1 1,0
<=> A * D + B * C * -1
<=> AD + BC . -1
<=> AD - BC
And the inverse is derived from:
-1 0+0 -1
M = det submat * -1 <=> M = M * 1 <=> D
0,0 0,0 0,0 1,1
-1 1+0 -1
M = det submat * -1 <=> M = M * -1 <=> C * -1
0,1 1,0 0,1 1,0
-1 0+1 -1
M = det submat * -1 <=> M = M * -1 <=> B * -1
1,0 0,1 1,0 0,1
-1 1+1 -1
M = det submat * -1 <=> M = M * 1 <=> A
1,1 1,1 1,1 0,0
Then the inverse matrix is equal to:
-1 1 | D -C |
M = --- | |
det | -B A |
Providing that the determinant is not zero.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q23">Q23</a>. How do I calculate the inverse of a 3x3 matrix?
----------------------------------------------------
For 3x3 matrices and larger, the inverse can be calculated by
either applying Kramer's rule or by solving as a set of linear
equations.
If Kramer's rule is applied to a matrix M:
| A B C |
M = | D E F |
| G H I |
then the determinant is calculated as follows:
det M = A * (EI - HF) - B * (DI - GF) + C * (DH - GE)
Providing that the determinant is non-zero, then the inverse is
calculated as:
-1 1 | EI-FH -(BI-HC) BF-EC |
M = ----- . | -(DI-FG) AI-GC -(AF-DC) |
det M | DH-GE -(AH-GB) AE-BD |
This can be implemented using a pair of 'C' functions:
VFLOAT m3_det( MATRIX3 mat )
{
VFLOAT det;
det = mat[0] * ( mat[4]*mat[8] - mat[7]*mat[5] )
- mat[1] * ( mat[3]*mat[8] - mat[6]*mat[5] )
+ mat[2] * ( mat[3]*mat[7] - mat[6]*mat[4] );
return( det );
}
int m3_inverse( MATRIX3 mr, MATRIX3 ma )
{
VFLOAT det = m3_det( ma );
if ( fabs( det ) < 0.0005 )
{
m3_identity( mr );
return(0);
}
mr[0] = ma[4]*ma[8] - ma[5]*ma[7] / det;
mr[1] = -( ma[1]*ma[8] - ma[7]*ma[2] ) / det;
mr[2] = ma[1]*ma[5] - ma[4]*ma[2] / det;
mr[3] = -( ma[3]*ma[8] - ma[5]*ma[6] ) / det;
mr[4] = ma[0]*ma[8] - ma[6]*ma[2] / det;
mr[5] = -( ma[0]*ma[5] - ma[3]*ma[2] ) / det;
mr[6] = ma[3]*ma[7] - ma[6]*ma[4] / det;
mr[7] = -( ma[0]*ma[7] - ma[6]*ma[1] ) / det;
mr[8] = ma[0]*ma[4] - ma[1]*ma[3] / det;
return(1);
}
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q24">Q24</a>. How do I calculate the inverse of a 4x4 matrix?
----------------------------------------------------
As with 3x3 matrices, either Kramer's rule can be applied or the
matrix can be solved as a set of linear equations.
An efficient way is to make use of the existing 'C' functions defined
to calculate the determinant and inverse of a 3x3 matrix.
In order to implement Kramer's rule with 4x4 matrices, it is necessary
to determine individual sub-matrices. This is achieved by the following
routine:
void m4_submat( MATRIX4 mr, MATRIX3 mb, int i, int j ) {
int di, dj, si, sj;
// loop through 3x3 submatrix
for( di = 0; di < 3; di ++ ) {
for( dj = 0; dj < 3; dj ++ ) {
// map 3x3 element (destination) to 4x4 element (source)
si = di + ( ( di >= i ) ? 1 : 0 );
sj = dj + ( ( dj >= j ) ? 1 : 0 );
// copy element
mb[di * 3 + dj] = mr[si * 4 + sj];
}
}
}
The determinant of a 4x4 matrix can be calculated as follows:
VFLOAT m4_det( MATRIX4 mr )
{
VFLOAT det, result = 0, i = 1;
MATRIX3 msub3;
int n;
for ( n = 0; n < 4; n++, i *= -1 )
{
m4_submat( mr, msub3, 0, n );
det = m3_det( msub3 );
result += mr[n] * det * i;
}
return( result );
}
And the inverse can be calculated as follows:
int m4_inverse( MATRIX4 mr, MATRIX4 ma )
{
VFLOAT mdet = m4_det( ma );
MATRIX3 mtemp;
int i, j, sign;
if ( fabs( mdet ) < 0.0005 )
m4_identity( mr );
return( 0 );
for ( i = 0; i < 4; i++ )
for ( j = 0; j < 4; j++ )
{
sign = 1 - ( (i +j) % 2 ) * 2;
m4_submat( ma, mtemp, i, j );
mr[i+j*4] = ( m3_det( mtemp ) * sign ) / mdet;
}
return( 1 );
}
Having a function that can calculate the inverse of any 4x4 matrix is
an incredibly useful tool. Application include being able to calculate
the base matrix for splines, inverse rotations and rearranging matrix
equations.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q25">Q25</a>. How do I calculate the inverse of a matrix using linear equations?
-----------------------------------------------------------------------
If a matrix M exists, such that:
| A B C |
M = | D E F |
| G H I |
then the inverse exists:
| P Q R |
M' = | S T U |
| V W X |
and the following expression is valid:
-1
M . M = I
| A B C | | P Q R | | 1 0 0 |
| D E F | . | S T U | = | 0 1 0 |
| G H I | | V W X | | 0 0 1 |
The inverse can then be calculated through the solution as a set of
linear equations ie.:
| AP + BS + CV | | 1 | Column 0 (X)
| DP + ES + FV | = | 0 |
| GP + HS + IV | | 0 |
| AQ + BT + CW | | 0 | Column 1 (Y)
| DQ + ET + FW | = | 1 |
| GQ + HT + IW | | 0 |
| AR + BU + CX | | 0 | Column 2 (Z)
| DR + EU + FX | = | 0 |
| GR + HU + IX | | 1 |
TRANSFORMS
==========
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q26">Q26</a>. What is a rotation matrix?
-------------------------------
A rotation matrix is used to rotate a set of points within a
coordinate system. While the individual points are assigned new
coordinates, their relative distances do not change.
All rotations are defined using the trigonometric "sine" and "cosine"
functions.
For a two-dimensional coordinate system, the rotation matrix is as
follows:
| cos(A) -sin(A) |
| |
| sin(A) cos(A) |
With the rotation angle A set to zero, this generates the identity
matrix:
| 1 0 |
I = | |
| 0 1 |
If the rotation is set to +90 degrees, then the matrix is as follows:
| 0 -1 |
M = | |
| 1 0 |
If the rotation is set to -90 degrees, then the matrix is as follows:
| 0 1 |
M = | |
| -1 0 |
Negating the rotation angle is equivalent to generating the transpose
of the matrix.
If a rotation matrix is multiplied with its transpose, the result is
the identity matrix.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q27">Q27</a>. How do rotation matrices relate to coordinate systems?
------------------------------------------------------
Rotation matrices relate to coordinate systems in the following way.
Mathematical convention requires that a positive rotation angle
generates a clockwise rotation when looking from the origin towards
the positive end of the rotation axis.
Applying this rule, allows for the derivation of three Cartesian
rotation matrices. Consider a right-handed coordinate system. For each
rotation axis, look from the origin towards the positive end of the
selected axis. This generates the following three views:
+----------------------------------------+
| |
| X-axis Y-axis Z-axis |
| |
| |
| ^ Y ^ Z Y ^ |
| | | | |
| | | | |
| | | | |
| | | | |
| O----> Z O----> X X <----O |
| |
+----------------------------------------+
Since a positive rotation angle generates a clockwise rotation, it is
possible to generate a set of coordinate mappings for each rotation.
For simplicity, a rotation of +90 will be considered:
Starting with the X-axis:
( 0, 1, 0 ) -> ( 0, 0, 1 )
( 0, 0, 1 ) -> ( 0,-1, 0 )
( 0,-1, 0 ) -> ( 0, 0,-1 )
( 0, 0,-1 ) -> ( 0, 1, 0 )
These can be simplified to:
X' = X
Y' = -Z
Z' = Y
These can then be placed into a matrix:
| 1 0 0 |
Rx = | 0 cos A -sin A |
| 0 sin A cos A |
Doing the same for the Y-axis:
( 0, 0, 1) -> ( 1,0, 0)
( 1, 0, 0) -> ( 0,0,-1)
( 0, 0,-1) -> (-1,0, 0)
(-1, 0, 0) -> ( 0,0, 1)
These can be simplified to:
X' = Z
Y' = Y
Z' = -X
These can then be placed into a matrix:
| cos A 0 sin A |
Ry = | 0 1 0 |
| -sin A 0 cos A |
And finally for the Z-axis:
( 0, 1, 0 ) -> ( -1, 0, 0 )
(-1, 0, 0 ) -> ( 0, -1, 0 )
( 0,-1, 0 ) -> ( 1, 0, 0 )
( 1, 0, 0 ) -> ( 0, 1, 0 )
These can be simplified to:
X' = -Y
Y' = X
Z' = Z
Placing these into a matrix:
| cos A -sin A 0 |
Rz = | sin A cos A 0 |
| 0 0 1 |
These are the three basic rotation matrices used by OpenGL.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q28">Q28</a>. How do I generate a rotation matrix in the X-axis?
-------------------------------------------------------
Use the 4x4 matrix:
| 1 0 0 0 |
M = | 0 cos(A) -sin(A) 0 |
| 0 sin(A) cos(A) 0 |
| 0 0 0 1 |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q29">Q29</a>. How do I generate a rotation matrix in the Y-axis?
-------------------------------------------------------
Use the 4x4 matrix:
| cos(A) 0 sin(A) 0 |
M = | 0 1 0 0 |
| -sin(A) 0 cos(A) 0 |
| 0 0 0 1 |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q30">Q30</a>. How do I generate a rotation matrix in the Z-axis?
-------------------------------------------------------
Use the 4x4 matrix:
| cos(A) -sin(A) 0 0 |
M = | sin(A) cos(A) 0 0 |
| 0 0 1 0 |
| 0 0 0 1 |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q31">Q31</a>. What are Euler angles?
---------------------------
Euler angles are the name given to the set of rotation angles which
specify the rotation in each of the X, Y and Z rotation axii.
These are specfied in vector format eg. |x y z| and can be stored
as a VECTOR data structure.
For example, the set
| 0 0 0 |
will always generate the identity matrix.
Other angles are represented as follows:
| 90 0 0 | is a rotation of +90 degrees in the X-axis.
| 0 90 0 | is a rotation of +90 degrees in the Y-axis and
| 0 0 90 | is a rotation of +90 degrees in the Z-axis.
Euler angles can be represented using a single vector data structure.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q32">Q32</a>. What are Yaw, Roll and Pitch?
----------------------------------
Yaw, Roll and Pitch are aeronautical terms for rotation using the
Euclidean coordinate system (Euler angles), relative to the local
coordinate system of an aeroplane.
Imagine you are viewing an aeroplane from above and from directly behind.
The Z-axis is lined up with the tail and nose of the aeroplane.
The X-axis runs from the tip of the left wing to the tip of the right
wing.
The Y axis points straight up from the ground.
Pitch then becomes rotation in the X-axis, Yaw becomes rotation in the
Y-axis and Roll becomes rotation in the Z-axis.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q33">Q33</a>. How do I combine rotation matrices?
----------------------------------------
Rotation matrices are combined together using matrix multiplication.
As a result, the order of multiplication is very important.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q34">Q34</a>. What is Gimbal lock?
-------------------------
Gimbal lock is the name given to a problem that occurs with the use of
Euler angles. Because the final rotation matrix depends on the order
of multiplication, it is sometimes the case that the rotation in one
axis will be mapped onto another rotation axis.
Even worse, it may become impossible to rotate an object in a desired
axis. This is called Gimbal lock.
For example, assume that an object is being rotated in the order Z,Y,X
and that the rotation in the Y-axis is 90 degrees.
In this case, rotation in the Z-axis is performed first and therefore
correctly. The Y-axis is also rotated correctly. However, after
rotation in the Y axis, the X-axis is rotated onto the Z-axis.
Thus, any rotation in the X-axis actually rotates the object in the
Z-axis. Even worse, it becomes impossible to rotate the object in the X-axis.
A convenient solution to this problem is to make use of Quaternions.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q35">Q35</a>. What is the correct way to combine rotation matrices?
----------------------------------------------------------
Really, there is no "correct way" of combining rotation matrices.
However, in order to be able to predict the result of combining
matrices together, some organisation is required. This is also
necessary if a full 3D matrix library is to be built.
The simplest way to rotate an object is to multiply the matrices
using the order:
M = X.Y.Z
where M is the final rotation matrix, and X,Y,Z are the individual
rotation matrices. This defines a rotation in the X-axis (pitch) first,
followed by the Y-axis (yaw) and a final rotation in the Z-axis (roll).
However, whenever the view from the camera viewpoint is being
evaluated, then the order and signs of the rotation is reversed.
For example, if you are standing up, and turn to your left, everything
in your field of view appears to move towards the right.
However, someone else facing you will say that you turned towards their
right.
Thus the view from the camera is modelled using the order:
M = -Z.-Y.-X
This is the inverse (or transpose) of the rotation matrix generated
if the camera were being rendered as another object.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q36">Q36</a>. How do I generate a rotation matrix from Euler angles?
-----------------------------------------------------------
At first glance, the most obvious method to generate a rotation matrix
from a set of Euler angles is to generate each matrix individually and
multiply all three together ie.
m3_rotx( mat_x, vec -> angle_x );
m3_roty( mat_y, vec -> angle_y );
m3_rotz( mat_z, vec -> angle_z );
m3_mult( mat_tmp, mat_z, mat_y );
m3_mult( mat_final, mat_tmp, mat_x );
This set of calls could be placed in a separate routine eg.
m3_fromeuler( MATRIX *mat_final, VECTOR3 *euler )
However, to perform this sequence of calls is very wasteful in terms
of processing time. Given that each 4x4 rotation matrix is guaranteed
to have 10 elements with value zero (0), 2 elements with value one (1)
and four others of arbitary value, over 75% of every matrix operation
is wasted. This does not include the set up and initialisation of each
matrix.
Altogether, over 75% of all matrix operations are spent processing
arithmetic expressions which lead to either zero or one.
A more efficient way must be found. Fortunately, there is another way
of determining the final resulting matrix.
If all three matrices are combined in algebraic format, the following
expression is defined:
M = X.Y.Z
where M is the final matrix,
X is the rotation matrix for the X-axis,
Y is the rotation matrix for the Y-axis,
Z is the rotation matrix for the Z-axis.
Expanding into rotation matrices in algebraic format gives:
| 1 0 0 |
X = | 0 A -B |
| 0 B A |
| C 0 D |
Y = | 0 1 0 |
| -D 0 C |
| E -F 0 |
Z = | F E 0 |
| 0 0 1 |
where A,B are the cosine and sine of the X-axis rotation axis,
C,D are the cosine and sine of the Y-axis rotation axis,
E,F are the cosine and sine of the Z-axis rotation axis.
Then the expression:
M = X.Y.Z
can be split into two matrix multiplications:
M' = X.Y
M = M'.Z
Evaluating M' first:
M' = X.Y
| 1 0 0 | | C 0 D |
M' = | 0 A -B | . | 0 1 0 |
| 0 B A | |-D 0 C |
| 1.C + 0.0 + 0.-D 1.0 + 0.1 + 0.0 1.D + 0.0 + 0.C |
M' = | 0.C + A.0 + -B.-D 0.0 + A.1 + -B.0 0.D + A.0 + -B.C |
| 0.C + B.0 + A.-D 0.0 + B.1 + A.0 0.D + B.0 + A.C |
Simplifying M' gives:
| C 0 D |
M' = | B.D A -B.C |
| -A.D B A.C |
Evaluating M gives:
M = M'.Z
| C 0 D | | E -F 0 |
M = | BD A -BC | . | F E 0 |
| -AD B AC | | 0 0 1 |
| C.E + 0.F + D.0 C.-F + 0.E + D.0 C.0 + 0.0 + D.1 |
M = | BD.E + A.F + -BC.0 BD.-F + A.E + -BC.0 BD.0 + A.0 + -BC.1 |
| -AD.E + B.F + AC.0 -AD.-F + B.E + AC.0 -AD.0 + 0.0 + AC.1 |
Simplifying M gives a 3x3 matrix:
| CE -CF D |
M = | BDE+AF -BDF+AE -BC |
| -ADE+BF ADF+BE AC |
This is the final rotation matrix. As a 4x4 matrix this is:
| CE -CF D 0 |
M = | BDE+AF -BDF+AE -BC 0 |
| -ADE+BF ADF+BE AC 0 |
| 0 0 0 1 |
The individual values of A,B,C,D,E and F are evaluated first. Also, the
values of BD and AD are also evaluated since they occur more than once.
Thus, the final algorithm is as follows:
A = cos(angle_x);
B = sin(angle_x);
C = cos(angle_y);
D = sin(angle_y);
E = cos(angle_z);
F = sin(angle_z);
AD = A * D;
BD = B * D;
mat[0] = C * E;
mat[1] = -C * F;
mat[2] = D;
mat[4] = BD * E + A * F;
mat[5] = -BD * F + A * E;
mat[6] = -B * C;
mat[8] = -AD * E + B * F;
mat[9] = AD * F + B * E;
mat[10] = A * C;
mat[3] = mat[7] = mat[11] = mat[12] = mat[13] = mat[14] = 0;
mat[15] = 1;
Using basic matrix calculations, the operation count would reach
128 multiplications, 96 additions and 80 assignments operations.
Using the optimised algorithm, only 12 multiplications, 6 subtractions
and 18 assignment operations are required.
So, it is obvious that by using the optimised algorithm, a performance
achievement of 1000% is achieved!
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q37">Q37</a>. How do I convert a rotation matrix to Euler angles?
--------------------------------------------------------
This operation is the exact opposite to the one answered in the question
above. Given that the rotation matrix is:
| CE -CF D 0 |
M = | BDE+AF -BDF+AE -BC 0 |
| -ADE+BF ADF+BE AC 0 |
| 0 0 0 1 |
where A,B are the cosine and sine of the X-axis rotation axis,
C,D are the cosine and sine of the Y-axis rotation axis,
E,F are the cosine and sine of the Z-axis rotation axis.
Using the C data structure for a 4x4 matrix, the index values are
as follows:
| 0 1 2 3 |
M = | 4 5 6 7 |
| 8 9 10 11 |
| 12 13 14 15 |
From looking at these two tables, it can be see that array element
[2] has the value of D or sin(Y). Then the rotation angle in the
Y-axis can be calculated from a call to to the inverse-sine function.
Passing this value to the cosine function then gives the value of C.
If C is not zero, then the rotation angles in each of the X and Z
axii, can be derived from the terms on the third column and first row
respectively. These are as follows:
X-axis: M[6] = -BC
M[10] = AC
Z-axis: M[0] = CE
M[1] = -CF
The actual rotation angles can be derived by taking each pair of values
dividing by C and passing the results to the inverse tangent function.
If C is zero, then these calculations are not possible. In this case
the rotation angle in the Y-axis will be either -90 or +90. Thus D
will either have the value of 1 or -1.
In this case, Gimbal Lock will have occurred. Rotations in both the
X and Z axii will appear to be in the same axis. This can be seen
through the evaluation of the rotation axis.
| 0.E -0.F 1 0 |
M = | B.1.E+AF -B.1.F+AE -B.0 0 |
| -A.1.E+BF A.1.F+BE A.0 0 |
| 0 0 0 1 |
Multiplying out each term gives:
| 0 0 1 0 |
M = | BE+AF -BF+AE 0 0 |
| -AE+BF AF+BE 0 0 |
| 0 0 0 1 |
Rearranging these terms gives:
| 0 0 1 0 |
M = | BE+AF AE-BF 0 0 |
| -(AE-BF) BE+AF 0 0 |
| 0 0 0 1 |
Then it can be seen that the matrix is really of the form:
| 0 0 1 0 |
M = | V W 0 0 |
| -W V 0 0 |
| 0 0 0 1 |
Where V has the value of BE+AF and
W has the value of AE-BF
These two values can be considered to be the sin and cosine of a
single rotation axis.
The final algorithm is then as follows:
angle_y = D = asin( mat[2]); /* Calculate Y-axis angle */
C = cos( angle_y );
angle_y *= RADIANS;
if ( fabs( C ) > 0.005 ) /* Gimball lock? */
{
trx = mat[10] / C; /* No, so get X-axis angle */
try = -mat[6] / C;
angle_x = atan2( try, trx ) * RADIANS;
trx = mat[0] / C; /* Get Z-axis angle */
try = -mat[1] / C;
angle_z = atan2( try, trx ) * RADIANS;
}
else /* Gimball lock has occurred */
{
angle_x = 0; /* Set X-axis angle to zero */
trx = mat[5]; /* And calculate Z-axis angle */
try = mat[4];
angle_z = atan2( try, trx ) * RADIANS;
}
/* return only positive angles in [0,360] */
if (angle_x < 0) angle_x += 360;
if (angle_y < 0) angle_y += 360;
if (angle_z < 0) angle_z += 360;
-----------------------------------
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q38">Q38</a>. How do I generate a rotation matrix for a selected axis and angle?
-----------------------------------------------------------------------
The simplest way to generate this type of rotation matrix is through the
use of quaternion mathematics.
See question [<a href="http://web.archive.org/web/20041029003853/http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q53">Q53</a>: How do I convert a quaternion to a rotation matrix?]
for further details.
The following code snipped does most of the work (phi being the rotation
angle and (u,v,w) the rotation (axis) vector):
rcos = cos(phi);
rsin = sin(phi);
matrix[0][0] = rcos + u*u*(1-rcos);
matrix[1][0] = w * rsin + v*u*(1-rcos);
matrix[2][0] = -v * rsin + w*u*(1-rcos);
matrix[0][1] = -w * rsin + u*v*(1-rcos);
matrix[1][1] = rcos + v*v*(1-rcos);
matrix[2][1] = u * rsin + w*v*(1-rcos);
matrix[0][2] = v * rsin + u*w*(1-rcos);
matrix[1][2] = -u * rsin + v*w*(1-rcos);
matrix[2][2] = rcos + w*w*(1-rcos);
Don't forget to set the rest of the matrix to 0 (1 at [3][3]) if
you are using 4x4 matrices!
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q39">Q39</a>. How do I generate a rotation matrix to map one vector onto another?
------------------------------------------------------------------------
When developing animation software, a common requirement is to find
a rotation matrix that will map one direction vector onto another.
This problem may be visualised by considering the two direction
vectors to be attached at their starting points. Then the entire
rotation space forms a unit sphere.
In theory, there are an infinite number of rotation axii and angles
that will map one vector onto the other. All of these axii lie on the
plane where all of the points are the exact same distance from both
vectors.
However, only one solution is of practical interest. This is the path
which covers the shortest angular distance between the two vectors.
The rotation axis to this path is calculated by taking the cross
product between the two vectors:
Vaxis = Vs x Vf
The rotation angle is calculated by taking the dot product between the
two vectors:
-1
Vangle = cos ( Vs . Vf )
One practical application of the solution to this problem is finding
the shortest flight path between two cities. In this case, each city
is represented as a direction vector generated from spherical
coordinates. Since planet Earth is spherical, the desired flight path
is the shortest angular rotation between the two cities.
Note: If Vs and Vf are colinear, the cross product returns (0,0,0).
You should test for that case and use any of the 90 degree rotations
of either Vs or Vf as a rotation axis, e.g. (y,z,x). If x==y==z, then
using one of x,y, or z from the second vector might help.
--> Is there a better way?
Having the rotation angle and vector, generating the corresponding matrix
is easy, see [<a href="http://web.archive.org/web/20041029003853/http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q38">Q38</a>: How do I generate a rotation matrix for
a selected axis and angle?] for details.
Don't let the spectre of Gimbal Lock fool you: Euler angles are still
a complete representation of any rotation in 3D space; it's just that
the actual Euler angles needed to achieve some particular desired
rotation may be rather unintuitive.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q40">Q40</a>. How do I use matrices to convert one coordinate system to another?
-----------------------------------------------------------------------
Similar to the previous problem, the requirement is to map one
coordinate system onto another. However, instead of just trying to
map one coordinate axis onto another, all three axii have to be matched.
Both coordinate systems are therefore represented as either 3x3 or
4x4 matrices.
The problem is therefore to find the rotation matrix that will map one
matrix onto another. This can be expressed mathematically:
Mfinal = Mrot . Morig
where Mfinal is the final coordinate system matrix,
Morig is the original coordinate system and
Mrot is the desired rotation matrix.
The goal is then to find the matrix Mrot. This can be achieved by
rearranging the equation to give:
-1
Mfinal . Morig = Mrot
-1
Mrot = Mfinal . Morig
Thus, the desired rotation matrix can be by calculatng the inverse of
the original coordinate system and multiplying it with the final
rotation matrix.
As a check, consider the cases when either the original or final
rotation matrices are the identity matrix. In each case, the rotation
matrix should match the final matrix and the inverse of the final
matrix respectively.
Once calculated, the rotation matrix may be converted into a
quaternion.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q41">Q41</a>. What is a translation matrix?
----------------------------------
A translation matrix is used to position an object within 3D space
without rotating in any way. Translation operations using matrix
multiplication can only be performed using 4x4 matrices.
If the translation is defined by the vector [X Y Z ], then the 4x4
matrix to implement translation is as follows:
| 1 0 0 X |
| |
| 0 1 0 Y |
M = | |
| 0 0 1 Z |
| |
| 0 0 0 1 |
If the vector is [0 0 0] then the vertex list will remain as before.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q42">Q42</a>. What is a scaling matrix?
------------------------------
A scaling matrix is used to enlarge or shrink the size of a 3D model.
If the scaling vector is [X Y Z] then the matrix to perform this is
as follows:
| X 0 0 0 |
| |
| 0 Y 0 0 |
M = | |
| 0 0 Z 0 |
| |
| 0 0 0 1 |
If the scaling vector is [1 1 1], then this generates the identity
matrix and vertex geometry will remain unchanged.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q43">Q43</a>. What is a shearing matrix?
-------------------------------
A shearing matrix is used to make a 3D model appear to slant sideways.
For example, "italic" text requires each character to slant towards the
right.
In three dimensions six possible shearing directions exist:
o shear X by Y
o shear X by Z
o shear Y by X
o shear Y by Z
o shear Z by X
o shear Z by Y
All six shearing directions may be combined into a single matrix:
| 1 Syx Szx 0 |
| |
| Sxy 1 Szy 0 |
M = | |
| Sxz Syz 1 0 |
| |
| 0 0 0 1 |
| |
Where Sij implements a shear of I by J
Thus, Sxy shears X by Y
In theory, rotation in three dimensions may be considered a combination
of six shearing directions.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q44">Q44</a>. How do I perform linear interpolation between two matrices?
----------------------------------------------------------------
Given two rotation matrices, the problem is to find a way of
determining intermediate positions specified by a parametric
variable t, where t ranges from 0.0 to 1.0
This can be achieved by converting the two matrices into either
Euler angles or Spherical rotation angles (via quaternions) and
a translation vector.
In either case, each matrix is converted into a pair of 3D vectors.
Interpolation between these two vectors can then be performed
through the use of the standard linear interpolation equation:
Vr = Va + t .(Vb - Va )
where Vr is the resulting vector
Va is the start position vector
Vb is the final position vector
This equation may be applied to both translation and rotation vectors.
Once determined, the resulting translation and rotation are then
converted back into the desired intermediate matrix.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q45">Q45</a>. How do I perform cubic interpolation between four matrices?
----------------------------------------------------------------
Given four rotation or translation matrices, the problem is to
find a way of determining intermediate positions specified by a
parametric variable t.
This can be achieved by making use of cubic interpolation. As with
linear interpolation, the four matrices are converted into their
corresponding translation and rotation vectors (Again, either Euler
angles or spherical rotation angles).
Each set of four vectors is then converted into a single geometry
vector G. Through the use of spline mathematics, this geometry vector
is converted into an interpolation matrix M.
If the geometry vector is defined as:
| x1 x2 x3 x4 |
G = | y1 y2 y3 y4 |
| z1 z2 z3 z4 |
Then multiplication by the base matrix:
| -4.5 9.0 -5.5 1.0 |
Mb = | 13.5 -22.5 9.0 0.0 |
| -13.5 18.0 -4.5 0.0 |
| 4.5 -4.5 1.0 0.0 |
will generate the 3x4 interpolation matrix Mi:
Mi = G .Mb
This can be implemented through a standard matrix-vector multiplication.
Interpolation can then be performed by the use of the parametric
variable t:
R = Mi . t
|t^3|
| xr | | A B C D | |t^2|
| yr | = | E F G H | . |t |
| zr | | I J K L | |1 |
The result vector can then be converted back into a rotation or
translation matrix.
It should be noted that the rotation paths that are generated may
occasionally become rather loopy. This is normal, as the algorithm
is trying to find the path with the least amount of rotation between
all four vectors.
Of the two methods, spherical rotation angles will usually be seen to
provide the cleanest interpolation paths for rotation.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q46">Q46</a>. How can I render a matrix?
-------------------------------
When using a graphics window for 3D animation, it is convenient to be
able to view a rotation matrix concurrently with the animation.
However, displaying a rotation matrix as an array of numeric values
does not provide a very meaningful context.
An alternative to rendering numeric data is to make use of graphical
display methods such as bar-graphs.
Much like a graphic equalizer on a stereo, a rotation matrix may be
displayed in a bar graph format. Each element of the rotation matrix
is rendered as an individual bar-graph in the range -1 to +1.
A 3x3 matrix would look like the following:
+--+ +--+ +--+
|##| | | | |
+--+ +--+ +--+
| | | | | |
+--+ +--+ +--+
+--+ +--+ +--+
| | |##| | |
+--+ +--+ +--+
| | | | | |
+--+ +--+ +--+
+--+ +--+ +--+
| | | | |##|
+--+ +--+ +--+
| | | | | |
+--+ +--+ +--+
In this case, the rotation matrix is the identity matrix, since each
element in the major diagonal is +1, and all others are zero.
For added visual clarity, parameters which are negative may shaded
in a different colour than those which are positive.
QUATERNIONS
===========
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q47">Q47</a>. What are quaternions?
--------------------------
Quaternions extend the concept of rotation in three dimensions to
rotation in four dimensions. This avoids the problem of "gimbal-lock"
and allows for the implementation of smooth and continuous rotation.
In effect, they may be considered to add a additional rotation angle
to spherical coordinates ie. Longitude, Latitude and Rotation angles
A Quaternion is defined using four floating point values |x y z w|.
These are calculated from the combination of the three coordinates
of the rotation axis and the rotation angle.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q48">Q48</a>. How do quaternions relate to 3D animation?
-----------------------------------------------
As mentioned before, Euler angles have the disadvantage of being
susceptible to "Gimbal lock" where attempts to rotate an
object fail to appear as expected, due to the order in which the
rotations are performed.
Quaternions are a solution to this problem. Instead of rotating an
object through a series of successive rotations, quaternions allow
the programmer to rotate an object through an arbitary rotation axis
and angle.
The rotation is still performed using matrix mathematics. However,
instead of multiplying matrices together, quaternions representing
the axii of rotation are multiplied together. The final resulting
quaternion is then converted to the desired rotation matrix.
Because the rotation axis is specifed as a unit direction vector,
it may also be calculated through vector mathematics or from
spherical coordinates ie (longitude/latitude).
Quaternions offer another advantage in that they be interpolated.
This allows for smooth and predictable rotation effects.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q49">Q49</a>. How do I calculate the conjugate of a quaternion?
------------------------------------------------------
This can be achieved by reversing the polarity (or negating) the
vector part of the quaternion, ie:
Qr = ( Qr.scalar, -Qr.vector )
----------------------------------------------------------------
quaternion_conjugate( QUAT *qr, QUAT *qa )
{
qr -> qw = qa -> qw;
qr -> qx = -qa -> qx;
qr -> qy = -qa -> qy;
qr -> qz = -qa -> qz;
}
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q50">Q50</a>. How do I calculate the inverse of a quaternion?
----------------------------------------------------
This is equivalent to calculating the conjugate of the quaternion,
if the quaternion is normalized (or a unit quaternion).
In all other cases, the magnitude of the inverse is 1/|q|.
See <a href="http://web.archive.org/web/20041029003853/http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q49">Q49</a>: How do I calculate the conjugate of a quaternion?
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q51">Q51</a>. How do I calculate the magnitude of a quaternion?
------------------------------------------------------
The magnitude of a quaternion is calculated by multiplying the
quaternion with its conjugate ie:
------------
/ --
|Qr| = \/ Qr.Qr
This can be implemented as the following code sequence:
-------------------------------------------------------------------
QFLOAT quaternion_magnitude( QUAT *qa )
{
return( sqrt(qa->qw*qa->qw+
qa->qx*qa->qx+ qa->qy*qa->qy+qa->qz*qa->qz) )
}
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q52">Q52</a>. How do I normalise a quaternion?
-------------------------------------
A quaternion can be normalised in a way similar to vectors. The
magnitude of the quaternion is calculated first. Then both the
scalar and vector part of the quaternion are divided by this value.
A unit quaternion will always have a magnitude of 1.0
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q53">Q53</a>. How do I multiply two quaternions together?
------------------------------------------------
Given two quaternions Q1 and Q2, the goal is to calculate the
combined rotation Qr:
Qr = Q1.Q2
This is achieved through the expression:
Qr = Q1.Q2 = ( w1.w2 - v1.v2, w1.v2 + w2.v1 + v1 x v2 )
where v1 = (x,y,z) of Q1
w1 = (w) of Q1
v2 = (x,y,z) of Q2
w2 = (w) of Q2
and both . and x are the standard vector dot and cross products.
This can be implemented using the following code segment:
---------------------------------------------------
quaternion_multiply( QUAT *qr, QUAT *qa, QUAT *qb )
{
qr.scalar = qa->scalar * qb->scalar - v3_dot( &qa->vector, &qb->vector );
v3_cross( &va, &qa->vector, &qb->vector );
v3_scalef( &vb, &qa->vector, &qb->scalar );
v3_scalef( &vc, &qb->vector, &qa->scalar );
v3_add( &va, &va, &vb );
v3_add( &qr->vector, &va, &vc );
quaternion_normalise( qr );
}
---------------------------------------------------
An optimization can also be made by rearranging to
w = w1w2 - x1x2 - y1y2 - z1z2
x = w1x2 + x1w2 + y1z2 - z1y2
y = w1y2 + y1w2 + z1x2 - x1z2
z = w1z2 + z1w2 + x1y2 - y1x2
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q54">Q54</a>. How do I convert a quaternion to a rotation matrix?
--------------------------------------------------------
Assuming that a quaternion has been created in the form:
Q = |X Y Z W|
Then the quaternion can then be converted into a 4x4 rotation
matrix using the following expression (Warning: you might have to
transpose this matrix if you (do not) follow the OpenGL order!):
¦ 2 2 ¦
¦ 1 - (2Y + 2Z ) 2XY + 2ZW 2XZ - 2YW ¦
¦ ¦
¦ 2 2 ¦
M = ¦ 2XY - 2ZW 1 - (2X + 2Z ) 2YZ + 2XW ¦
¦ ¦
¦ 2 2 ¦
¦ 2XZ + 2YW 2YZ - 2XW 1 - (2X + 2Y ) ¦
¦ ¦
If a 4x4 matrix is required, then the bottom row and right-most column
may be added.
The matrix may be generated using the following expression:
xx = X * X;
xy = X * Y;
xz = X * Z;
xw = X * W;
yy = Y * Y;
yz = Y * Z;
yw = Y * W;
zz = Z * Z;
zw = Z * W;
mat[0] = 1 - 2 * ( yy + zz );
mat[1] = 2 * ( xy - zw );
mat[2] = 2 * ( xz + yw );
mat[4] = 2 * ( xy + zw );
mat[5] = 1 - 2 * ( xx + zz );
mat[6] = 2 * ( yz - xw );
mat[8] = 2 * ( xz - yw );
mat[9] = 2 * ( yz + xw );
mat[10] = 1 - 2 * ( xx + yy );
mat[3] = mat[7] = mat[11] = mat[12] = mat[13] = mat[14] = 0;
mat[15] = 1;
The resulting matrix uses the following positions:
¦ mat[0] mat[4] mat[ 8] mat[12] ¦
M = ¦ mat[1] mat[5] mat[ 9] mat[13] ¦
¦ mat[2] mat[6] mat[10] mat[14] ¦
¦ mat[3] mat[7] mat[11] mat[15] ¦
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q55">Q55</a>. How do I convert a rotation matrix to a quaternion?
--------------------------------------------------------
A rotation may be converted back to a quaternion through the use of
the following algorithm:
The process is performed in the following stages, which are as follows:
Calculate the trace of the matrix T from the equation:
2 2 2
T = 4 - 4x - 4y - 4z
2 2 2
= 4( 1 -x - y - z )
= 1 + mat[0] + mat[5] + mat[10]
If the trace of the matrix is greater than zero, then
perform an "instant" calculation.
Important note wrt. rouning errors:
Test if ( T > 0.00000001 ) to avoid large distortions!
S = sqrt(T) * 2;
X = ( mat[9] - mat[6] ) / S;
Y = ( mat[2] - mat[8] ) / S;
Z = ( mat[4] - mat[1] ) / S;
W = 0.25 * S;
If the trace of the matrix is equal to zero then identify
which major diagonal element has the greatest value.
Depending on this, calculate the following:
if ( mat[0] > mat[5] && mat[0] > mat[10] ) { // Column 0:
S = sqrt( 1.0 + mat[0] - mat[5] - mat[10] ) * 2;
X = 0.25 * S;
Y = (mat[4] + mat[1] ) / S;
Z = (mat[2] + mat[8] ) / S;
W = (mat[9] - mat[6] ) / S;
} else if ( mat[5] > mat[10] ) { // Column 1:
S = sqrt( 1.0 + mat[5] - mat[0] - mat[10] ) * 2;
X = (mat[4] + mat[1] ) / S;
Y = 0.25 * S;
Z = (mat[9] + mat[6] ) / S;
W = (mat[2] - mat[8] ) / S;
} else { // Column 2:
S = sqrt( 1.0 + mat[10] - mat[0] - mat[5] ) * 2;
X = (mat[2] + mat[8] ) / S;
Y = (mat[9] + mat[6] ) / S;
Z = 0.25 * S;
W = (mat[4] - mat[1] ) / S;
}
The quaternion is then defined as:
Q = | X Y Z W |
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q56">Q56</a>. How do I convert a rotation axis and angle to a quaternion?
----------------------------------------------------------------
Given a rotation axis and angle, the following
algorithm may be used to generate a quaternion:
vector_normalize(axis);
sin_a = sin( angle / 2 );
cos_a = cos( angle / 2 );
X = axis -> x * sin_a;
Y = axis -> y * sin_a;
Z = axis -> z * sin_a;
W = cos_a;
It is necessary to normalise the quaternion in case any values are
very close to zero.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q57">Q57</a>. How do I convert a quaternion to a rotation axis and angle?
----------------------------------------------------------------
A quaternion can be converted back to a rotation axis and angle
using the following algorithm:
quaternion_normalise( |X,Y,Z,W| );
cos_a = W;
angle = acos( cos_a ) * 2;
sin_a = sqrt( 1.0 - cos_a * cos_a );
if ( fabs( sin_a ) < 0.0005 ) sin_a = 1;
axis -> x = X / sin_a;
axis -> y = Y / sin_a;
axis -> z = Z / sin_a;
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q58">Q58</a>. How do I convert spherical rotation angles to a quaternion?
----------------------------------------------------------------
A rotation axis itself may be defined using spherical coordinates
(latitude and longitude) and a rotation angle
In this case, the quaternion can be calculated as follows:
sin_a = sin( angle / 2 )
cos_a = cos( angle / 2 )
sin_lat = sin( latitude )
cos_lat = cos( latitude )
sin_long = sin( longitude )
cos_long = cos( longitude )
X = sin_a * cos_lat * sin_long
Y = sin_a * sin_lat
Z = sin_a * sin_lat * cos_long
W = cos_a
WARNING: There might be a problem in this code.
An alternative is the code snipped given in [<a href="http://web.archive.org/web/20041029003853/http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q60">Q60</a>: How
do I convert Euler rotation angles to a quaternion?"].
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q59">Q59</a>. How do I convert a quaternion to spherical rotation angles?
----------------------------------------------------------------
A quaternion can be converted to spherical coordinates by extending
the conversion process:
cos_a = W;
sin_a = sqrt( 1.0 - cos_a * cos_a );
angle = acos( cos_a ) * 2;
if ( fabs( sin_angle ) < 0.0005 ) sin_a = 1;
tx = X / sin_a;
ty = Y / sin_a;
tz = Z / sin_a;
latitude = -asin( ty );
if ( tx * tx + tz * tz < 0.0005 )
longitude = 0;
else
longitude = atan2( tx, tz );
if ( longitude < 0 )
longitude += 360.0;
WARNING: In this code might still be a problem.
Please let me know what it is and how to fix this.
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q60">Q60</a>. How do I convert Euler rotation angles to a quaternion?
-------------------------------------------------------------------
Converting Euler rotation angles to quaterions can be achieved through
the use of quaternion multiplication. Each rotation angle is converted
to an axis-angle pair, with the axis corresponding to one of the
Euclidean axii. The axis-angle pairs are converted to quaternions and
multiplied together. The final quaternion is the desired result.
The following code segment demonstrates this:
quaternion_from_euler( QUATERNION *q, VFLOAT ax, VFLOAT ay, VFLOAT az )
{
VECTOR3 vx = { 1, 0, 0 }, vy = { 0, 1, 0 }, vz = { 0, 0, 1 };
QUATERNION qx, qy, qz, qt;
quaternion_from_axisangle( qx, &vx, rx );
quaternion_from_axisangle( qy, &vy, ry );
quaternion_from_axisangle( qz, &vz, rz );
quaternion_multiply( &qt, &qx, &qy );
quaternion_multiply( &q, &qt, &qz );
}
The following more or less comes from:
http://vered.rose.utoronto.ca/people/david_dir/GEMS/GEMS.html
//Pitch->X axis, Yaw->Y axis, Roll->Z axis
Quaternion::Quaternion(float fPitch, float fYaw, float fRoll)
{
const float fSinPitch(sin(fPitch*0.5F));
const float fCosPitch(cos(fPitch*0.5F));
const float fSinYaw(sin(fYaw*0.5F));
const float fCosYaw(cos(fYaw*0.5F));
const float fSinRoll(sin(fRoll*0.5F));
const float fCosRoll(cos(fRoll*0.5F));
const float fCosPitchCosYaw(fCosPitch*fCosYaw);
const float fSinPitchSinYaw(fSinPitch*fSinYaw);
X = fSinRoll * fCosPitchCosYaw - fCosRoll * fSinPitchSinYaw;
Y = fCosRoll * fSinPitch * fCosYaw + fSinRoll * fCosPitch * fSinYaw;
Z = fCosRoll * fCosPitch * fSinYaw - fSinRoll * fSinPitch * fCosYaw;
W = fCosRoll * fCosPitchCosYaw + fSinRoll * fSinPitchSinYaw;
}
The following might also work:
QUATERNION qx = { cos(pitch/2f), sin(pitch/2f), 0, 0 }
QUATERNION qy = { cos(yaw/2f), 0, sin(yaw/2f), 0 }
QUATERNION qz = { cos(roll/2f), 0, 0, sin(roll/2f) }
quaternion_multiply( &qt, &qx, &qy );
quaternion_multiply( &q, &qt, &qz );
In Java looks like this:
public static void setQ( Quat4f q, float pitch, float yaw, float roll )
{
Quat4f qx = new Quat4f((float) Math.cos(pitch/2f),
(float) Math.sin(pitch/2f), 0, 0);
Quat4f qy = new Quat4f((float) Math.cos(yaw/2f), 0,
(float) Math.sin(yaw/2f),0);
Quat4f qz = new Quat4f((float) Math.cos(roll/2f), 0, 0,
(float) Math.sin(roll/2f) );
Quat4f qt = new Quat4f();
qt.set( qx );
qt.mul( qy );
qt.mul( qz );
q.set( qt );
}
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q61">Q61</a>. How do I use quaternions to perform linear interpolation between matrices?
-------------------------------------------------------------------------------
For many animation applications, it is necessary to interpolate
between two rotation positions of a given object. These positions may
have been specified using keyframe animation or inverse kinematics.
Using either method, at least two rotation matrices must be known, and
the desired goal is to interpolate between them. The two matrices are
referred to as the starting and finish matrices( MS and MF).
Using linear interpolation, the interpolated rotation matrix is
generated using a blending equation with the parameter T, which
ranges from 0.0 to 1.0.
At T=0, the interpolated matrix is equal to the starting matrix.
At T=1, the interpolated matrix is equal to the finishing matrix.
Then the interpolated rotation matrix (MI) is specified as:
MI = F( MS, MF, T )
where F is a blending function.
The first stage in interpolating between the two matrices is to
determine the rotation matrix that will convert MS to MF.
This is achieved using the following expression:
-1
T = Ms . Mf
where Ms is the start matrix,
Mf is the finish matrix,
and T is the intermediate matrix.
The next stage is to convert this matrix into a rotation axis and
angle. This is achieved by converting the matrix into a quaternion
and finally into the required rotation axis and angle.
In order to generate the interpolated rotation matrix, it is only
necessary to scale the rotation angle and convert this angle and
the rotation axis back into a rotation matrix.
Using a 4x4 matrix library, this is as follows:
m4_transpose( mt, ms ); /* Inverse */
m4_mult( ms, mt, mb ); /* Rotation matrix */
m4_to_axisangle( ms, axis, angle ); /* Rotation axis/angle */
for ( t = 0; t < 1.0; t += 0.05 )
{
m4_from_axisangle( mi, axis, angle * t ); /* Final interpolation */
... whatever ...
}
where t is the interpolation factor ranging from 0.0 to 1.0
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q62">Q62</a>. How do I use quaternions to perform cubic interpolation between matrices?
------------------------------------------------------------------------------
For some applications, it may not be convenient or possible to use linear
interpolation for animation purposes. In this case, cubic interpolation
is another alternative.
In order to use cubic interpolation, at least four rotation matrices must
be known.
Each of these is then converted into a set of spherical rotations
via quaternions and spherical rotation angles (ie. longitude, latitude
and rotation angle).
These are then multiplied with the base matrix for a Cardinal spline
curve. This interpolation matrix can then be used to determine the
intermediate spherical rotation angles.
Once the interpolated coordinates are known (latitude, longitude and
rotation angle), the interpolated rotation matrix can then be generated
through the conversion to quaternions.
Using a 4x4 matrix library, the algorithm is as follows:
for ( n = 0; n < 4; n++ )
m4_to_spherical( mat[n], &v_sph[n] ); /* Spherical coordinates */
m4_multspline( m_cardinal, v_sph, v_interp ); /* Interpolation vector */
...
v3_cubic( v_pos, v_interp, t ); /* Interpolation */
m4_from_spherical( m_rot, v_pos ); /* Back to a matrix */
<a href="http://www.blogger.com/blogger.g?blogID=2073270612133201407" name="Q63">Q63</a>. How do I use quaternions to rotate a vector?
------------------------------------------------------------------------------
A rather elegant way to rotate a vector using a quaternion directly
is the following (qr being the rotation quaternion):
-1
v' = qr * v * qr
This can easily be realised and is most likely faster then the transformation
using a rotation matrix.
</pre>
<br class="Apple-interchange-newline" />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-44498887267144221432012-01-09T21:51:00.001+00:002012-02-21T13:13:38.747+00:00Inverse Kinematics And Trigonometry Basics<span class="Apple-style-span" style="background-color: #efefef; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;"></span><br />
<span style="background-color: #efefef; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;"><br /></span><br />
<span style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">So firstly, why do we need kinematics? What are they?</span><br />
<span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;"><br /><span style="font-size: 12px; font-weight: bold;">Motivation</span><br /><br /><span style="font-size: 12px;">With your robot having legs the position of those legs dictates where its feet are. Where its feet are dictate its point of balance.</span><br /><br /><span style="font-size: 12px;">As you undoubtedly know balance can be defined as the robot's centre of mass (affectionately referred to as its centre of gravity) being between its centre of pivots (i.e. the edges of where its feet contact the ground).</span><br /><br /><span style="font-size: 12px;">If the centre of mass is above the centre of pivots and between them the robot will balance (almost an unstable equilibrium, if you're an applied mathemetician).</span><br /><br /><span style="font-size: 12px;">If the centre of mass is above but outside the centre of pivots (i.e. beyond the edges of his feet) the robot will overbalance and fall. Fast.</span></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 12px;"><br /></span></span><br />
<span style="background-color: white;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"></span></span><br />
<a name='more'></a><span style="background-color: white;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span></span><br />
<span style="background-color: white;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;">If you feel confident about the basics, here is an implementation example of a 3 DOF hexapod robot using IK:</span></span><br />
<span style="background-color: white;"><a href="http://arduin0.blogspot.com/2012/01/inverse-kinematics-ik-implementation.html">http://arduin0.blogspot.com/2012/01/inverse-kinematics-ik-implementation.html</a>
</span><br />
<span style="background-color: white;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /><span style="font-size: 12px;">If you're a little unclear about this start with something basic, a cube is a good start, and imagine that its centre of mass is right in the middle (which it will be if its density is even throughout). When the cube is just sat there it's stable. The centre of mass is above the centre of pivot (the edges) but because it's between them (when viewed from every direction) it will just sit there until you prod it.</span><br /><br /><span style="font-size: 12px;">Now you prod it and slowly tilt it. As the centre of mass approaches a point directly above one of the edges (our centre of pivot) the cube will feel lighter to your touch and if you can get the centre of mass directly over that centre of pivot it will balance. As soon as you push it past that point, so the centre of mass is the other side of the centre of pivot it will fall.</span><br /><br /><span style="font-size: 12px;">The robot is exactly the same. This is why the kinematics of the feet are important to you. If you want the robot to balance dynamically you NEED to know where the feet are and where they're going to need to be.</span></span><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">Please understand that I'm not going to do all your work for you, so the code or equations I share are not guaranteed on their accuracy but purely a demonstration of how the method is derived and works. </span></span><br />
<span style="background-color: white;"><br class="Apple-interchange-newline" /></span><br />
<span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;"><br />==================================================</span><br />
<span style="background-color: white;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><b>Forward and </b><b>Inverse </b><b>Kinematics</b></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><span class="Apple-style-span"><b><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span></b>Forward kinematics is the method for determining the orientation and position of the end effector <span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 12px;">(x,y,z) </span></span></span><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">coordinates </span><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">relative to the centre of mass</span><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;"> </span><span class="Apple-style-span">, given the joint angles and link lengths of the robot arm (</span><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">servo positions)</span><span class="Apple-style-span">. </span><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">This equation is deterministic. You know absolutely from the servo positions exactly where the foot is.</span></span><br />
<span style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;">Inverse kinematics is the opposite of forward kinematics. This is when you have a desired end effector position, but need to know the joint angles required to achieve it. This is harder than FK, and there could be more than one solution. </span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span"><span style="background-color: white; font-family: Tahoma;">The FK is not very useful here, because if we are given a change of angle of a servo, only one effector moves in the chain. But if we are given a change of coordinate, the whole chain of effectors (servos) might have to move a certain angle for the end point to reach the desired position. And also the movement tend to be more natural as well!</span></span><br />
<span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 12px;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 12px;"><br /></span></span><br />
<span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 12px;"><br /></span></span><br />
<span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 12px;">=====================================================================</span></span><br />
<span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 12px;"><br /></span></span><br />
</span></span><br />
<div>
<span class="Apple-style-span" style="background-color: white;">There are two approaches to solving inverse kinematics:</span></div>
<ul>
<li><span class="Apple-style-span" style="background-color: white;">Analytical - requires a lot of trigonometry or matrix algebra</span></li>
<li><span class="Apple-style-span" style="background-color: white;">Iterative - better if there are lots of links and degrees of freedom.</span></li>
</ul>
<div>
<h4>
<span class="Apple-style-span" style="background-color: white;">IK - Analytical approach</span></h4>
<div>
<span class="Apple-style-span" style="background-color: white;">If there are only two or three links then it may be possible to solve it analytically. One possibly might be to draw out the arm with the angles shown on it, then solve for the angles using geometry. The problem is that this is not really a very general approach.</span></div>
<div>
<span class="Apple-style-span" style="background-color: white;">Another analytical approach is to represent each links rotation and translation by a matrix. The end point is then given by all these matrixes multiplied together, so we just need to solve this matrix equation. Then find what rotation each matrix represents.</span></div>
<div>
<span class="Apple-style-span" style="background-color: white;">There may be many solutions or there may not be any solutions. In other words there are lots of ways to reach to a given point, or it may be out of reach.</span></div>
<div>
<span class="Apple-style-span" style="background-color: white;">If there are many solutions, then you might need to apply additional constraints. For instance, human joints can only bend within certain limits.</span></div>
<h4>
<span class="Apple-style-span" style="background-color: white;">IK - Iterative -approach (only if you are interested reading)</span></h4>
<div>
<span class="Apple-style-span" style="background-color: white;">This is a more general approach for programming complex chains.</span></div>
<table border="0" style="color: black;"><tbody>
<tr><td><span style="background-color: white;"><br /></span></td><td><span style="background-color: white;">Start off with the joints in any position, then move each of the joints in turn, so that each movement takes the endpoint toward the target.</span><br />
<span style="background-color: white;">Starting with the joint nearest the end point, rotate the joint so that the current end point moves toward the required end point. Then do the same with the next joint toward the base and so on until the base is rotated. Then keep repeating this, until the end point is close enough to the required end point or if further iterations are not moving it closer to the required point.</span><br />
<span style="background-color: white;">It may be possible to have a more realistic strategy than this, for instance, if I am using my arm to pick up an object then, if the object is a long way away, I will move the bigger joints in the arm, then as the hand gets closer the smaller joints of the hand are used for the fine adjustments.</span><br />
<span style="background-color: white;">The angle of rotation for each joint is found by taking the dot product of the vectors from the joint to the current point and from the joint to the desired end point. Then taking the arcsin of this dot product.</span><br />
<span style="background-color: white;">To find the sign of this angle (ie which direction to turn), take the cross product of these vectors and checking the sign of the Z element of the vector.</span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span></td></tr>
</tbody></table>
</div>
<div>
<span style="background-color: white;"><br /></span></div>
<span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;">because we will be mainly dealing with 3DOF hexapod or Quadurped robot legs, Analytical, or trigonometry would do the trick for now.</span><br />
</span><br />
<div>
<span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span></span></div>
<span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;">
</span><br />
<div>
<span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span></span></div>
<span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;">
</span><br />
<div>
<span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif;">================================================</span></span></div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Let's get started, write a trigonometric library first!</span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">1. need to do is refresh your memory on trigonometry. </span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Understand how you can obtain the sine and cosine of an angle, what they mean when converting angles and distances into x/y coordinates. </span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Also understand how you take a two dimensional coordinate (x,y) and rotate it about a point (say a,b) by a given angle. This is absolutely CRITICAL to understanding kinematics. </span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">2. implement trigonometric functions </span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Once you've understood all this you need to implement sines, cosines and tangents (and the inverse versions) in your software. Using the library versions of these functions is going to be expensive in space and computation. So, try not to use standard library function, WRITE your own functions! </span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Scared? Don't be. Writing your own on a microcontroller is actually surprisingly easy. All we need to do is to pre-calculate values and store them in a table, so we can just look it up. </span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Let's try to write sine and cos functions first and test them. 3D trigonometry is just 2D trigonometry applied in three dimensions. Create yourself some functions that rotate 3D points around each of the three axes.</span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Now test again. You have to be confident that it works without bugs and with an accuracy suitable to your application.</span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">If you've got this far you've got trig working in your microcontroller. You've probably also written a whole bunch of supporting functions (e.g. printf() debugging, square root functions etc). You're probably pretty damn proud of yourself.</span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;">Now, the fun starts from here.</span><br />
<div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br /></span></div>
<br />
<b style="background-color: white;"><br /></b><br />
<div>
<span class="Apple-style-span" style="background-color: white;"><br /></span></div>
<div>
<span class="Apple-style-span" style="background-color: white;">============================</span></div>
<div>
<span style="background-color: white;"><br /></span></div>
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;">15/12/2012</span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;"><span style="font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">To get this turned into a program, you'll have to remember that the angles are the unknowns, and proceed from there.</span>
</span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6331jhzf5UJaMUxKL3Kn_A07jhJB75KFD1SLNaJP9bZCvXnBD4gOm1kFfkNetwEAiFI96KyJ4UDLW_Mv01pVAK14cj1SEXPtNlKYY-LR09j-LeUjsM8lEWrPrA2GZqpD4XgLa-E5KrMc/s1600/160120121365.jpg" imageanchor="1" style="background-color: white; margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6331jhzf5UJaMUxKL3Kn_A07jhJB75KFD1SLNaJP9bZCvXnBD4gOm1kFfkNetwEAiFI96KyJ4UDLW_Mv01pVAK14cj1SEXPtNlKYY-LR09j-LeUjsM8lEWrPrA2GZqpD4XgLa-E5KrMc/s400/160120121365.jpg" width="400" /></a></div>
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><span class="Apple-style-span" style="font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">So, first thing is going to be turn this from a 3D problem into a 2D one, by solving for gamma. I would recommend thinking about theta in terms of the tangent function, X and Y. There is a common function called atan2 which is typically used to find </span> <span style="font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">gamma</span> <span class="Apple-style-span" style="font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">, given X and Y. So, a single function gets you </span> <span style="font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">gamma</span> <span class="Apple-style-span" style="font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">(sweet!).</span>
</span><br />
<span style="background-color: white;"><br /></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaZr33yUlx890jsrttKxdnAygqJTNd5lveDEuNLlBxQJ7LlCxCHskmu0_bO6KoS48_h22jbWo5ulfRGJLoh0HqWakTlBPWaj3wahDewHTM6kA2hDOuF4Hc4j1FVybM0KgSVz58UHy8toI/s1600/160120121366.jpg" imageanchor="1" style="background-color: white; margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaZr33yUlx890jsrttKxdnAygqJTNd5lveDEuNLlBxQJ7LlCxCHskmu0_bO6KoS48_h22jbWo5ulfRGJLoh0HqWakTlBPWaj3wahDewHTM6kA2hDOuF4Hc4j1FVybM0KgSVz58UHy8toI/s400/160120121366.jpg" width="400" /></a></div>
<span style="background-color: white;"><br /></span><br />
<br />
<span class="Apple-style-span"><span class="Apple-style-span" style="background-color: white; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Now that you have gamma, you have two links and two joints left to place (and they are in the same plane), which are your red leg lines:</span></span><br />
<ol class="decimal" style="margin-bottom: 1em; margin-left: 2em; margin-right: 1em; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<li style="list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span class="Apple-style-span" style="background-color: white;">You would typically then find OB using OB^2 = (L1^2 + L2^2). OB, L1, and L2 form a plane, which all our calculations are now on.</span></li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span class="Apple-style-span" style="background-color: white;">Now, we notice that the same atan2 function could be used to find alpha (based on Zb and the length of the horizontal projection of OB).</span></li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span class="Apple-style-span" style="background-color: white;">You can then solve for (alpha + delta), because you have all three sides of your triangle -- and then subtract the alpha value you just determined to find delta.</span></li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span class="Apple-style-span" style="background-color: white;">And now, you have a function to describe phi in your sheet (as acos of a really nasty set of numbers).</span></li>
</ol>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlopvjhyphenhyphenjfqBw5Adrj8h8MWYxSHMy6ACVSB31mwIW0C2ibNOdKsnuSF2C7plzOvDCGcleKsvVGrd-NrQgPgc1yJVNB_H7YUHp6YV_9DpzNjkr_ue-NCD1o-gy-JQ0PudzQI42NlKYwpw4/s1600/160120121367.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlopvjhyphenhyphenjfqBw5Adrj8h8MWYxSHMy6ACVSB31mwIW0C2ibNOdKsnuSF2C7plzOvDCGcleKsvVGrd-NrQgPgc1yJVNB_H7YUHp6YV_9DpzNjkr_ue-NCD1o-gy-JQ0PudzQI42NlKYwpw4/s640/160120121367.jpg" width="480" /></a></div>
<br />
<ol class="decimal" style="margin-bottom: 1em; margin-left: 2em; margin-right: 1em; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</ol>
<span class="Apple-style-span" style="background-color: white;">At that point, you have your values for your servos!</span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;">===========================================================</span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
So now we have IK, the next step would be on 'How to use IK to form Gaits'.<br />
<br />
the idea is, to make a step, we will have to tell the servo to move to a set of positions. the more positions, the more smooth the motion would be. and that's how gaits are generated.<br />
<br />
The best way to study gaits generation, is to go through people's code. Here are some good code we could study:<br />
<br />
<span style="background-color: white;">Best way to learn with those topic is to download the PowerPod program from Lynxmotion's shopsite:</span><br />
<br />
http://www.lynxmotion.com/images/files/firmware/ppod102_x44.zip<br />
<br />
<span style="background-color: white;">Generate a basic code, and try to follow the code line by line and understand what its doing (not necessarily focusing on how), then once you figure out the flow of the code, you can go back into the details of the how by following some basic trig.</span><br />
<br />
<span style="background-color: white;">It took quite a while for me to figure out what it's doing.</span><br />
<br />
<span style="background-color: white;">The code is basically doing inverse-kinematics. Kinematics is giving the servo an angle and calculating where it's supposed to land given the length of the arm/apendage. Inverse is giving it a target location and figuring out the angle the servo needs to move in order to accomplish the movement [of the tip of the appendage] to that location. But that's a very high level understanding.</span><br />
<br />
<span style="background-color: white;">For me, I printed out the awesome explanation of the code by Luis Hidalgo, the code generated by Powerpod, and also the IK-diagram, and just kept studying it over and over until it started to click.</span><br />
<br />
<span style="background-color: white;">I'm no expert at it, but I'm still on the path to getting to know it more. You should do some google search on this topic (inverse kinematics) and there are several websites out that explains this quite readily. Some useful ones I found are:</span>
<br />
<br />
==========================================================<br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;"></span><br />
<div>
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="background-color: white;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small;">Here are some good sites to explore more of the IK field:</span></span></span><br />
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="background-color: white;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small;"><br /></span></span></span></div>
<div>
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="background-color: white;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small;"><span style="font-family: 'Times New Roman';">http://freespace.virgin.net/hugo.elias/models/m_ik.htm</span>
</span></span></span></div>
<div>
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="background-color: white;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Tahoma; font-size: small;"><a href="http://freespace.virgin.net/hugo.elias/models/m_ik2.htm">http://freespace.virgin.net/hugo.elias/models/m_ik2.htm</a></span></span></span><br />
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="background-color: white;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="background-color: white;">http://www.lynxmotion.net/viewtopic.php?t=2534<br />http://www.lynxmotion.net/viewtopic.php?t=3361
</span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2073270612133201407.post-60375667587215093102012-01-02T02:24:00.000+00:002013-02-21T12:57:09.257+00:00Control Arduino Through Serial Connection (USB) VB Visual Basic programContent Has been moved to my new blog<br />
<br />
<a href="http://www.blogger.com/goog_531529895"><br /></a>
<a href="http://blog.oscarliang.net/control-arduino-through-serial-connection-usb-vb-visual-basic-program/">http://blog.oscarliang.net/control-arduino-through-serial-connection-usb-vb-visual-basic-program/</a><br />
<br />
<br />
<br />
<br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><br /></b></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>LED Example:</b></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><br /></b></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/1u1LZV6o6iY?feature=player_embedded' frameborder='0'></iframe></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><br /></b></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><br /></b></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>Hexapod Example:</b></span><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/9Z9RObSeuuE?feature=player_embedded' frameborder='0'></iframe></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><br /></b></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><br /></b></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>Why?</b></span><br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">When we are debugging and testing our circuits and codings, most of the times we reset the Arduino board and upload the new program. But the thing is everything has a finite lifetime, and by doing harmful things to the body would even reduce life quicker. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Just like smoking could kill you, repetitively uploading could kill your arduino too! I still remember I read from somewhere, and someone said an Arduino board has an average uploading limit of about 1000 times... I don't know if this is true, but if we could avoid doing something that could harm the arduino, then why not?</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">So here we are, I was looking for a way to test and develop new moves and gaits for my hexapod robot. But frequently uploading new codes really cost me time and risking killing the arduino, so I thought it would be nice to test it just by sending the arduino a command through USB connection (Serial communication), therefore the possibility of program uploading could be minimized.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">This is also useful when we use bluetooth to control arduino.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span><br />
<a name='more'></a><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>How?</b></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><br /></b></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Arduino has already provided a serial communication class, and there are built in examples of how to use them. Here is the official doc:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><a href="http://arduino.cc/en/Reference/Serial">http://arduino.cc/en/Reference/Serial</a></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">I will first try to establish a basic class and working Arduino program in the Arduino development IDE, and then move on to write a VB program to provide better and more user friendly interface. I will also publish my source code in the near future.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span class="Apple-style-span" style="font-family: Arial;"></span><br />
<span class="Apple-style-span" style="font-family: Arial;"><br /></span>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">=======================================================</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">1/1/2012</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Happy new year!</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">I will divide this tutorial into 2 sections: Receiver and Sender ends.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div style="font-size: 16px;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><u>Receiver side coding:</u></b></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">So the command I designed would look like this. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">MxPxDx/</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">x - arbitrary number</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">M - mode (0 - write, 1 - read, 2 - servo control)</span></span></div>
<div>
P - pin (0 - 13), or servo number (specified in arduino program)</div>
<div>
D - data (0 - LOW, 1 - HIGH, or (600 to 2400) - servo position)</div>
<div>
/ - indicate end of command (to execute)</div>
<div>
<br /></div>
<div>
for example, </div>
<div>
M0P2D0/ - means to make pin 2 LOW</div>
<div>
M2P1D900/ - means to make servo number 1 to 900 ms (1500 = 90 degree)</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
The idea is that the command get sent to the arduino as a array of charaters one by one, which has delay between each charaters. </div>
<div>
notice that the function <b>Serial.read()</b> can only read one byte (one charater) at a time. So if you write something like this:</div>
<div>
<br /></div>
<div>
<b>a = Serial.read()</b></div>
<div>
<b>b = Serial.read()</b></div>
<div>
<br /></div>
<div>
you can get the first character, but the second one might not be read as it hasn't arrived at the serial receiving buffer yet.</div>
<div>
So I use this statement:</div>
<div>
<br /></div>
<div>
void loop(){</div>
<div>
<br /></div>
<div>
if (if (Serial.available() > 0) {</div>
<div>
<br /></div>
<div>
//...<b>Read one byte and store in array...</b></div>
<div>
<b><br /></b></div>
<div>
<b> //...if the last character read was '/' then...</b></div>
<div>
<b> //...execute the command...</b></div>
<div>
<b><br /></b></div>
<div>
<b> //... reset the command array, ...</b></div>
<div>
<b> //...keep listening to serial port...</b></div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Serial.available()</b> indicates how many bytes are available to be read. So the arduino just keeps running, and reads data when it becomes available and that's how commands are received. Here is how the command is decoded and executed:</div>
<div>
<br /></div>
<div>
1. When I received a character 'M', I remember all the char after 'M', before I encounter 'P', and store that in variable 'mode'</div>
<div>
2. same, store characters after 'P' and before 'D', in variable 'pin'</div>
<div>
3. store characters before '/', in variable 'data'</div>
<div>
<br /></div>
<div>
Then convert these char into int type (you can also do it during above process), by subtracting '0', which has an ASCII value of 48.</div>
<div>
So now we have 3 variables, which is basically the commands. To execute the command, we can write something like this:</div>
<div>
<br /></div>
<div>
switch (mode){<br />
case 0:<br />
<b>digitalWrite(pin,data);</b><br />
break;<br />
<br />
case 1:<br />
//...Read digital pin...</div>
<div>
// ... Read analogue pin...<br />
break;<br />
<br />
case 2:</div>
<div>
// ...Control Servo...</div>
<div>
// ... set position, read position so on...<br />
break;<br />
</div>
<div>
}</div>
<div>
<br /></div>
<div>
To execute read and servo commands, we will need more complicated coding, but that's roughly how it would work.</div>
<div>
<br /></div>
<div>
<b><u>Sender side Coding:</u></b></div>
<div>
<br /></div>
<div>
To use this serial command system, no coding is needed when using arduino serial monitor. just type in the command and it just works!</div>
<div>
<br /></div>
<div>
But that isn't even 5% of the amazing things it could achieve! If you could write a program and introduce graphical interface, controlling the arduino would be so intuitive and clear! also command can be sent more rapidly through computer programs, especially useful when testing robot moves, or LED lighting effects!</div>
<div>
<br /></div>
<div>
I think the most popular choices for serial programming would be Python, C/C++, or Basic. I know C/C++ the best here, but the thing is C/C++ is not easy to write the graphical interface. So I went for Basic, which I realized its simplicity and fast development time. I spent 2 hours learning the basics, and got my program working 3,4 hours later. Surely most of us could do better.</div>
<div>
<br /></div>
<div>
In the example video (the LED control program), when the ON/OFF button is pressed, it goes to a 'switch - case' statement, depending on what LED is selected, corresponding LED is switched on or off. The Display function is even easier. it sends out a command, delay for sometime, before sends out another one. So the LED flashes and creates some kind of fabulous visual effect.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
That's it for the basics. I will carry on completing the code, especially the servo control for my hexapod robot. Finally will put it in a header file.</div>
<div>
<br />
<br />
=====================================================<br />
02/01/2012<br />
<br />
<b><span class="Apple-style-span" style="font-size: large;">Servo Control coding:</span></b><br />
<br />
Receiver Side (arduino):<br />
<br />
<br />
command example:<br />
<b>M2P0D1500/ </b> --------- set servo number 1 to middle position (1500 ms).<br />
<br />
This command works the best with my way of updating servos' positions (described <a href="http://arduin0.blogspot.com/2011/12/quadruped-robot-project-stalker.html">here</a>, search for "<span class="Apple-style-span" style="background-color: #fefdfa; color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;">26/12/2011" update. )</span><br />
<span class="Apple-style-span" style="background-color: #fefdfa; color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;"><br /></span>
<span class="Apple-style-span" style="background-color: #fefdfa; color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;">Basically what it does is, there is a variable for the position of each servo, when command is received and executed, the variable will be updated rather than writing the servo position straight away. The position is only written at the end of the loop process (or when the timer has reach certain point if you want delay).</span><br />
<span class="Apple-style-span" style="background-color: #fefdfa; color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;"><br /></span>
<span class="Apple-style-span" style="background-color: #fefdfa; color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;">for example:</span></span></span><br />
<span class="Apple-style-span" style="background-color: #fefdfa; color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;"><br /></span></span></span>
<br />
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="font-family: Tahoma;"><br />
void loop(){<br /><br />
// ... command receiving<br />
// ... command executing (update servo position and store in variable 'pos')<br /><br />
servo.writeMicroseconds(pos);<br />
<br /><br />
}</span></span></td></tr>
</tbody></table>
<br />
<br />
<span class="Apple-style-span" style="background-color: #fefdfa; color: #333333; font-family: Tahoma; font-size: 13px; line-height: 18px;"><br /></span>
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;"><span class="Apple-style-span" style="line-height: 18px;">So in the execution coding block, we add:</span></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;"><span class="Apple-style-span" style="line-height: 18px;"><br /></span></span>
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;"><span class="Apple-style-span" style="line-height: 18px;"></span></span><br />
<div>
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></span>
<br />
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
// ============ Execute command ======<br />
switch (mode){<br />
case 0:<br />
digitalWrite(pin,data);<br />
break;<br />
<br />
case 1:<br />
digitalRead(pin);<br />
break;<br />
<br />
case 2:<br />
switch (pin){<br />
case 0:<br />
pos0 = data; //<br />
break;<br />
case 1:<br />
//pos1 = data;<br />
break;<br />
case 2:<br />
//pos2 = data;<br />
break;<br />
<br />
<br />
}<br />
break;<br />
<br />
}</td></tr>
</tbody></table>
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;">
</span>
<br />
<div>
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></span></div>
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;">
</span></div>
<div>
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></span></div>
<br />
<br />
<span class="Apple-style-span" style="color: #333333; font-family: Tahoma; font-size: x-small;"><span class="Apple-style-span" style="line-height: 18px;"><br /></span></span>
<br />
<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b><u><br />
Sender side:</u></b></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"> </span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">When we are testing using arduino serial monitor, no coding is needed.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">In VB (basic), it's best to use track bar. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.c-sharpcorner.com/UploadFile/mahesh/trackbar-in-C-Sharp/Images/TrackBarImg1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.c-sharpcorner.com/UploadFile/mahesh/trackbar-in-C-Sharp/Images/TrackBarImg1.jpg" /></a></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Create events when trackbar is scrolled, this is an example </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Private</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Sub</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> TrackBar1_Scroll(</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">ByVal</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> sender </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">As</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> System.</span></span><span style="color: #2b91af; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Object</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">, </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">ByVal</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> e </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">As</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> System.</span></span><span style="color: #2b91af; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">EventArgs</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Handles</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> TrackBar1.Scroll</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Dim</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> valueInStr </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">As</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">String</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> = </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">CStr</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">(TrackBar1.Value)</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Dim</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> command </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">As</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">String</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> = </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">"M2P0D"</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> + valueInStr + </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">"/"</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> SerialPort1.Write(command)</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> LB_ServoPos.Text = valueInStr</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> System.Threading.</span></span><span style="color: #2b91af; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Thread</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">.Sleep(100)</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">End</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Sub</span></span></div>
</td></tr>
</tbody></table>
<div>
<br /></div>
</div>
<div>
it works when you only have one servo, if there are more servos need to be deal with, has to write more codes to determine 'P' (which servo to control).<br />
<br />
<br />
<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br />
================================================================</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">03/01/2012</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Tested the serial command system, one big drawback is that between each command, the delay is quite obvious. When I intend to move 2 servo positions at the at same, one servo is actually moving before the other.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">That's because it uses this algorithm:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">(waiting and listening to USB) ---> (receive command 1) --> (Execute command 1) --> (waiting and listening to USB) ---> (receive command 2) ---> (Execute command 2) --->.......</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Although command 1 and 2 are intended to be executed at the same time (sent at the same time), there will be a delay.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">I re-consider the system, decided to fix this synchronization problem by adding an additional command:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">SxCa...SyCb/</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">which contains all the servos and changes of position at the same time, and execute them all together, so delay could be reduced between servo moves.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">The length of this command is indefinite, but can be determined by how many servos wants to be controlled. E.g. max length of command = (1+2+1+4)*number of servos</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">assuming we control 18 servos at most, the command buffer length would be 8*18 = 144 (this can be modified easily when needed)</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">for example:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">S0C-200S4C600/ --- would turn Servo 0 backward 200us, Servo 4 forward 600us.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">You might notice, when 2 or more servos are moved at the same time, if the changes of positions are different, it will also result in a different duration (where some servo reach destination faster than others).</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">To address this, I added one more string of data at the end of the new command, </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Lxxx, </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">which means Loops, or steps, required to finish transition. So ideally, when we have a command like the example above, "S0C-200S4C600L50/" Servo 0 will have to spend 50 loops in the arduino program to finish the transition, which divides servo 0 to move -4 each loop, and servo 4 to move 12. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">You might think it's unnecessary, but one big good thing it brings is smoothness! let image you want to change a servo position from 1500 to 800, you could do it at once (within 1 loop), but it introduces instability to your robot and circuit (draw of current). Also when motion gets too big, it won't look pretty. with additional loop control, big motion can be broken down into small, digestible pieces. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Now we have the final template servo command:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>SxCa...SyCbLc/</b></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">--------------------------------------------------</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">As we have a new command, additional algorithm in the arduino programm will be needed to code with it. What I will do is:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">1. create a function that generate a new position for each servo at each loop. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">2. make arduino to talk back! Sending the computer a signal, when we have complete a command, and available for another one. (so we can have a collection of commands waiting on the PC side, and are sent when arduino finishes the last one)</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">====================================================</span><br />
<span class="Apple-style-span" style="font-family: Arial;">05/01/2012</span></div>
<br />
This will be the final update on this topic.<br />
<br />
<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">new idea of the command analysis process:</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTx2ZWwIg7QDV-WhNterIlDmxquat06gBZXMQYsUpT4UTwkVYUiilsL7gekdtuCW7E8QafeDyFFh5fEEqmyZyXufCy733RxyNJoRCKLGfXsUZW3aSCFP4vdvjl35SHw2f7o58TMQ1suOc/s1600/080120121360.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTx2ZWwIg7QDV-WhNterIlDmxquat06gBZXMQYsUpT4UTwkVYUiilsL7gekdtuCW7E8QafeDyFFh5fEEqmyZyXufCy733RxyNJoRCKLGfXsUZW3aSCFP4vdvjl35SHw2f7o58TMQ1suOc/s400/080120121360.jpg" width="400" /></a></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">first of all we need to have a fixed length of command, by making unused its zero, and use '1' to represent negative in servo command e.g.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"> M00P05D0235/ --- write pin 5 a PWM value of 235 </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"> S10C00300S02C10700L0100/ --- turn servo 10 300um, turn servo 2 -700um after 100loops</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">in which case, instead of having a switch, we can now just loop through the command buffer char by char, to store the variables and data.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">I want to do this is because</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">1. cleaner code block</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">2. less likely to have bug.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">3. commands are easier to handle when have fixed length.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">==============================================================</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial; font-size: large;"><b>Source Code:</b></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>LED- VB (visual basic) program </b></span><span class="Apple-style-span" style="font-family: Arial;"><b>and command files</b></span><span class="Apple-style-span" style="font-family: Arial;"><b>:</b></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; orphans: 2; text-indent: 0px; widows: 2;">https://dl.dropbox.com/u/457167/Blog_Download_Resources/PC_Arduino_Controller_VB.7z</span><br />
<br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>Hexapd - VB (visual basic) program </b></span><span class="Apple-style-span" style="font-family: Arial;"><b>and command files</b></span><span class="Apple-style-span" style="font-family: Arial;"><b>:</b></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; orphans: 2; text-indent: 0px; widows: 2;">https://dl.dropbox.com/u/457167/Blog_Download_Resources/Hexapod_Controller_VB.7z</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; orphans: 2; text-indent: 0px; widows: 2;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>Arduino Main program (An example on hexapod robot, to just make you understand):</b></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span><br />
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// Oscar's Project</span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">#include</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><Servo.h></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">#include</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">"serial_command.h"</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ========== Position Table ===========</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">SerialCommand command;</span></span></div>
<div align="left">
<span class="Apple-style-span" style="color: #010101;"><span class="Apple-style-span" style="font-size: 12px;"><br /></span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ========= Servo ===================</span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// 12 servos</span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// first 6 - legs </span></span><span class="Apple-style-span" style="color: green; font-size: 12px;"> last 6 - sholders</span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">Servo servo[12];</span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos[12];</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ========== Pins ============</span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// first 6 legs, last 6 sholder</span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">const</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> byte pin[12] = {8,9,10,11,12,13,2,3,4,5,6,7};</span></span></div>
<div align="left">
<span class="Apple-style-span" style="color: #010101;"><span class="Apple-style-span" style="font-size: 12px;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">void</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> setup()</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">{</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> Serial.begin(9600);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// == Setup Servos ==</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<12; i++){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servo[i].attach(pin[i]);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos[i] = 1400;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servo[i].writeMicroseconds(servoPos[i]);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> delay(100);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> delay(2000);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> command.Reset();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
<div align="left">
<span class="Apple-style-span" style="color: #010101;"><span class="Apple-style-span" style="font-size: 12px;"><br /></span></span>
<span class="Apple-style-span" style="color: #010101;"><span class="Apple-style-span" style="font-size: 12px;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">void</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> loop()</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">{</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command.ReceiveCommand()){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command.DecodeCommand()){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command.ExecuteCommand()) {</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">(</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> curPos=0; curPos<command.loops; curPos++){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<12; i++){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// UPDATE POSITIONS </span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos[i] += command.servoPosAdjust[i];</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos[i] = constrain(servoPos[i], 600, 2400);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// WRITE POSITIONS</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servo[i].writeMicroseconds(servoPos[i]);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> delay(40);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// Finish, send signal to PC</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> Serial.write(</span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'1'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">else</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> Serial.println(</span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">"execution failed"</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">); </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// execution failed</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">else</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> Serial.println(</span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">"decoding failed"</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">); </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// decoding failed</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">//if (command.executed && command.listening)</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> command.Reset();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
</td></tr>
</tbody></table>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
</div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>Command class (this is the class for the command system, it's a general purpose class)</b></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span><br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></span>
<br />
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">#include</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">"WProgram.h"</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">class</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> SerialCommand{</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">private</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">:</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">static</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">const</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> MAX_SERVO_NUM = 18;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">static</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">const</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> SINGLE_COMMAND_LENGTH = 3+5;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">static</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">const</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> MAX_COMMAND_LENGTH = MAX_SERVO_NUM * SINGLE_COMMAND_LENGTH + 5;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> index;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> command[MAX_COMMAND_LENGTH]; </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// longest command is 12 char long</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">public</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">:</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> boolean executed; </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// true - ready for new command</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> boolean listening; </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// true - recieved part of the command but not '/' yet</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// false - still listening to command</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> pin; </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// pin number, OR servo number</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> mode; </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// 0 - write, 1 - read, 2 - servo control</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> data;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// Servo data</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> loops;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos[MAX_SERVO_NUM];</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos_LastUpdated;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPosChange[MAX_SERVO_NUM];</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">float</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPosAdjust[MAX_SERVO_NUM];</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ============ Functions ===============</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">private</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">:</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">long</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> GetSerialByte();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> Char2Int(</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">char</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> chr);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">public</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">:</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> SerialCommand();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">void</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> Reset();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> boolean ReceiveCommand();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> boolean DecodeCommand();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> boolean ExecuteCommand();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">};</span></span></div>
</td></tr>
</tbody></table>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
</div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</span>
<br />
<div>
<span class="Apple-style-span" style="font-family: Arial;"><b>(this is the command class functions, goes with the class)</b></span><br />
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><div align="left">
<span style="color: #010101; font-family: Consolas;"><span style="font-size: 12px;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">#include</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">"serial_command.h"</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">SerialCommand::SerialCommand(){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos_LastUpdated = 1500;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<MAX_SERVO_NUM; i++)</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos[i] = 1500; </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// longest command is 12 char long</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> Reset();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">long</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> SerialCommand::GetSerialByte(){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> Serial.read();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> SerialCommand::Char2Int(</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">char</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> chr) {</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> ((chr < </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'0'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">) || (chr > </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'9'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">))</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> -1;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">else</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> chr - </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'0'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
<div align="left">
<span class="Apple-style-span" style="color: #010101;"><span class="Apple-style-span" style="font-size: 12px;"><br /></span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// =========================================================</span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ===================== Main functions ====================</span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// =========================================================</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">boolean SerialCommand::ReceiveCommand(){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (Serial.available() > 0) {</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// determine</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (index >= MAX_COMMAND_LENGTH) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// Receiving</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> command[index] = GetSerialByte();</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> listening = </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command[index] == </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'/'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">true</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> listening = </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">true</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> index++;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// no signal available</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
<div align="left">
<span class="Apple-style-span" style="color: #010101;"><span class="Apple-style-span" style="font-size: 12px;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">boolean SerialCommand::DecodeCommand(){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command[index] != </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'/'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> boolean negative = </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> indexCur = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// Decoding</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// differentiate type of command</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command[indexCur] == </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'M'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">) {</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// pin mode</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ... more code...</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">else</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command[indexCur] == </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'S'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// servo mode</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">while</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (indexCur < index) {</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> tempServoNum = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> tempServoPos = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// extracting servo number (2 integers)</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">(</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<2; i++){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> indexCur++;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> temp = Char2Int(command[indexCur]);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (temp < 0) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> tempServoNum = tempServoNum*10 + temp;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// extracting pos number</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> indexCur++;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command[indexCur] != </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'C'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> indexCur++;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> boolean negative = Char2Int(command[indexCur]); </span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<4; i++) {</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> indexCur++;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> temp = Char2Int(command[indexCur]);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (temp < 0) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> tempServoPos = tempServoPos*10 + temp;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (negative) tempServoPos = -tempServoPos;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPosChange[tempServoNum] = tempServoPos;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// extracting loop number</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> indexCur++;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (command[indexCur] == </span></span><span style="color: #a31515; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">'L'</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> loops = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<4; i++){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> indexCur++;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> temp = Char2Int(command[indexCur]);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">if</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (temp < 0) </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> loops = loops*10 + temp;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<MAX_SERVO_NUM; i++)</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPosAdjust[i] = (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">float</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">)servoPosChange[i]/(</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">float</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">)loops;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> indexCur++;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> } </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// end of while indexCur < index</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">true</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> } </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// end of if 'S'</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">else</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> {</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> ;</span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// unknown command</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ... more code...</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">boolean SerialCommand::ExecuteCommand(){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">/*</span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> if ((pin < 0) || (mode < 0) || (data < 0))</span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> return false;</span></span></div>
<div align="left">
<span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> */</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">switch</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (mode){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">case</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> 0:</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// do noting.</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">break</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">case</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> 1:</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ... more code...</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> digitalWrite(pin,data);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">break</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">case</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> 2:</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ... more code...</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> digitalRead(pin);</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">break</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">case</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> 3:</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// ... more code...</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos[pin] = data;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPos_LastUpdated = data;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">break</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> executed = </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">true</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">return</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">true</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">void</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> SerialCommand::Reset(){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">// initialize variables and parameters</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> executed = </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> listening = </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">false</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> index = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: green; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">//loops = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> mode = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> pin = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> data = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<MAX_COMMAND_LENGTH; i++){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> command[i] = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">for</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> (</span></span><span style="color: blue; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">int</span></span><span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> i=0; i<MAX_SERVO_NUM; i++){</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPosChange[i] = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> servoPosAdjust[i] = 0;</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"> }</span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;"><br /></span></span></div>
<div align="left">
<span style="color: #010101; font-family: 'Times New Roman'; font-size: xx-small;"><span style="font-size: 9pt;">}</span></span></div>
<div align="left">
</div>
</td></tr>
</tbody></table>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
</div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<br />
<br /></div>
</div>
Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-16727905848794976192012-01-01T12:50:00.000+00:002013-05-09T19:36:27.379+01:00Hexapod Robot with 2 DOF legs (degree of freedom)First Motion, Legs flexibility:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/9ADLwx-jYpQ?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<span class="Apple-style-span" style="background-color: #ebebeb; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;">stalker is dead... but the body and components are preserved well, so I decided to reuse them and therefore Mini is born.</span><br />
<span class="Apple-style-span" style="background-color: #ebebeb; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;"><br /></span>
<span class="Apple-style-span" style="background-color: #ebebeb; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;"><br /></span>
<span class="Apple-style-span" style="background-color: #ebebeb; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;">Lastest update (12/01/2012)</span><br />
<span class="Apple-style-span" style="background-color: #ebebeb; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/pMg3WCWFniE?feature=player_embedded' frameborder='0'></iframe></div>
<span class="Apple-style-span" style="background-color: #ebebeb; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;"><br /></span>
<span class="Apple-style-span" style="background-color: #ebebeb; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;"><br /></span>
<br />
<br />
<a name='more'></a><br />
Original Post can be found here:<br />
<a href="http://blog.oscarliang.net/simple-hexapod-robot-arduino/">http://blog.oscarliang.net/simple-hexapod-robot-arduino/</a><br />
<br />
===================================================================<br />
31/12/2011<br />
<br />
I just love working with Styrene plastic when building small robots... so flexible and shapable!<br />
<br />
although it could take a while to cut and get good at it, but it's definitely a very good choice for people with small budget!<br />
<br />
Here is a very good site selling them, it's the cheapest I have found so far (let me know if you know anywhere else cheaper ; )<br />
<a href="http://www.stationroadbaseboards.co.uk/cart_plastic.htm?tp=CONTINUE+SHOPPING">Styrene Sheet (Plasticard) from Station Road Baseboards)</a><br />
<br />
In this one, I basically reused all the servos and parts from <a href="http://arduin0.blogspot.com/2011/12/quadruped-robot-project-stalker.html">the Stalker</a>, the only things I need to rebuild was the base and the legs..<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizu8ZG0bXNe_o24wVo0nqPZ4YuZTR-cGVXdNPbOhUYGQDP0fucPh2yZ8mQlvhyphenhyphencGEzXWyahxZwHvyA3urgX-4Dw5sFviCp-xs3jUkKkW52uCJFwNg4Dj-MeuZeX86c2gYWn4_RXbVxDyA/s1600/311220111352.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizu8ZG0bXNe_o24wVo0nqPZ4YuZTR-cGVXdNPbOhUYGQDP0fucPh2yZ8mQlvhyphenhyphencGEzXWyahxZwHvyA3urgX-4Dw5sFviCp-xs3jUkKkW52uCJFwNg4Dj-MeuZeX86c2gYWn4_RXbVxDyA/s400/311220111352.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxjbrxrgVQR_xKTZ64_83OPpKax0CyTieAimz9oS7zcbORF6NbBQiXmyOFxB3ynzZ2PjhMG2KbS4tYLbV-I9WxfzW35m5DhpRUuR6Vl0yJ5-la4kqzpEb4CFicB-GZWW86Jd6T2CxxDqQ/s1600/311220111353.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxjbrxrgVQR_xKTZ64_83OPpKax0CyTieAimz9oS7zcbORF6NbBQiXmyOFxB3ynzZ2PjhMG2KbS4tYLbV-I9WxfzW35m5DhpRUuR6Vl0yJ5-la4kqzpEb4CFicB-GZWW86Jd6T2CxxDqQ/s400/311220111353.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2DbfnMQTdRMre9NrAJDWuQf_EyHVOfd3daavkoABD9bI47-6sitx4Uapni3tXtLMuaOONDlJM7syg7BHeArphWu8TiAGdVwGGDJx0snxes6ZkLRJZdWjTZM4bycL0evY7_JKV9FiDCso/s1600/311220111354.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2DbfnMQTdRMre9NrAJDWuQf_EyHVOfd3daavkoABD9bI47-6sitx4Uapni3tXtLMuaOONDlJM7syg7BHeArphWu8TiAGdVwGGDJx0snxes6ZkLRJZdWjTZM4bycL0evY7_JKV9FiDCso/s400/311220111354.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9079eHuFN_Lzxzil0ORoAt02Eon1dbXbkrGNrFqN8cV0rfrwWWGtKt42-C5JUNRTIDxl8ikB7yitlLcslKk26PY-cyVcjE6_d3QLPDPr0FLl6VAZOMOQHpUqynkNof-GCQgYYDNfTCTM/s1600/311220111355.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9079eHuFN_Lzxzil0ORoAt02Eon1dbXbkrGNrFqN8cV0rfrwWWGtKt42-C5JUNRTIDxl8ikB7yitlLcslKk26PY-cyVcjE6_d3QLPDPr0FLl6VAZOMOQHpUqynkNof-GCQgYYDNfTCTM/s400/311220111355.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLbNAYZsMk3sjk5tXjUvyueFT5W_PNCxOiysyKyp369wGKZfFpKt00SiWjHegg1pTX6JwJdQaH5ugFwm7R4it7-BP23kMFSQQBScYSolsu9or7cUdJRtHM43KguAkUuoBEN2pbnjLWKJI/s1600/311220111357.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLbNAYZsMk3sjk5tXjUvyueFT5W_PNCxOiysyKyp369wGKZfFpKt00SiWjHegg1pTX6JwJdQaH5ugFwm7R4it7-BP23kMFSQQBScYSolsu9or7cUdJRtHM43KguAkUuoBEN2pbnjLWKJI/s400/311220111357.jpg" width="400" /></a></div>
<br />
<br />
I hope I can work out some more gaits and moves soon and get it uploaded on youtube.<br />
In the mean time, I will be working on the serial communication program to talk to the robot from the PC ; )<br />
<br />
Ciao!<br />
<br />
==================================================<br />
07/01/2012<br />
<br />
Mini can be now controlled by a VB program via USB connection, check here<br />
<a href="http://arduin0.blogspot.com/2012/01/control-arduino-through-serial.html">http://arduin0.blogspot.com/2012/01/control-arduino-through-serial.html</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/9Z9RObSeuuE?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
<br />
<br />
==================================================<br />
11/01/2012<br />
<br />
further modification to the leg:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFrIfHgwCQzsLU-95bzOwMaTQMgRjzRySZdlxQfx-J7HsWJiNhs6-hCGLX93n7ggbaTAYDWFd7V65gh7ZX2a9wn6-y_ukB0jzcmiJX9T7vEQZldnn77YPphmCYeSwfJkykICWGf7iaAwg/s1600/120120121362.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFrIfHgwCQzsLU-95bzOwMaTQMgRjzRySZdlxQfx-J7HsWJiNhs6-hCGLX93n7ggbaTAYDWFd7V65gh7ZX2a9wn6-y_ukB0jzcmiJX9T7vEQZldnn77YPphmCYeSwfJkykICWGf7iaAwg/s400/120120121362.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivzABH2BgBqzBVpXLr27YCEhveweim4VLHrjP337kR10bSC908331zf-yiX0jzsvts2W5h_1nsAm6ym8hso_YiToltmARCzpLbLEsy8Mv-HEwCh2vu_U2tD7Er-z2NBTnDAoIAoGdRSC8/s1600/120120121363.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivzABH2BgBqzBVpXLr27YCEhveweim4VLHrjP337kR10bSC908331zf-yiX0jzsvts2W5h_1nsAm6ym8hso_YiToltmARCzpLbLEsy8Mv-HEwCh2vu_U2tD7Er-z2NBTnDAoIAoGdRSC8/s400/120120121363.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzcKKmDL1lCPVg0-NZ_wY03vQBpQbigroBYG8d0ryPlTBmxqEPpfyUJTegYxdRtnPjgKTyIO_42mthVlh_AqFm-BuMiI9WN6_mF57kiaqz6kPG4FPXQGPJQ8BJSXZAs2UOUlC68iy6yMQ/s1600/130120121364.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzcKKmDL1lCPVg0-NZ_wY03vQBpQbigroBYG8d0ryPlTBmxqEPpfyUJTegYxdRtnPjgKTyIO_42mthVlh_AqFm-BuMiI9WN6_mF57kiaqz6kPG4FPXQGPJQ8BJSXZAs2UOUlC68iy6yMQ/s400/130120121364.jpg" width="400" /></a></div>
<br />
it's now more stable as the legs are tougher and lighter, more importantly it looks cooler!<br />
<div>
<br /></div>
<div>
<br /></div>
<br />
====================================================<br />
12/01/2012<br />
<br />
Wrote a few more commands files today, works quite well ; )<br />
<br />
See 2nd video from the top.<br />
<br />
That's it! no more 2DOF hexpad, I will modify it into 3DOF per leg, and start to think about IK and trigonometry!<br />
<br />
Sayonara!<br />
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-29049508270033598182011-12-27T03:16:00.000+00:002011-12-27T14:31:36.704+00:00How to use Ultra Sonic sensor (HC-SR04), demonstration with LCD.<br />
<div style="margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-family: Arial;">Result:</span></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/DBvPIfl9gTQ?feature=player_embedded' frameborder='0'></iframe></div>
<div style="margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div style="margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-family: Arial;"></span></div>
<div style="font-family: 'Times New Roman'; font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">the HC-SR04 is different from most of those commonly seen on the market, which have 4 pins compared to 3 pins. But the operation principle is the same, transmit signal, and depends on when the signal is received to estimate the distance.</span></span></div>
<div style="font-family: 'Times New Roman'; font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></span></div>
<div style="font-family: 'Times New Roman'; font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span></span></div>
<a name='more'></a><br />
<span class="Apple-style-span" style="font-family: Arial;">HC-SR04 not only inexpensive but also practical, use a sample AVR development boar –Arduino , with a LCD screen , you can make a easy rangefinder device , which can ranging 2cm to 400cm . (although i couldn't get it work more than 2 meters :-( </span><br />
<div style="font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Please don't ask me how to use LCD, as it's been explained really well on the Arduino official site, please check here:</span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><a href="http://arduino.cc/en/Tutorial/LiquidCrystal">http://arduino.cc/en/Tutorial/LiquidCrystal</a></span></div>
<br />
<div style="margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div style="font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Now first connect the circuit as below :</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwGseHEBRjYfRJe5Nl3ph90mne1kvcKEu1Ulk8-zC7Pjfdq5Z1Ytus6f4ICl_B7nvCCYT5CJmNLuiKV4WaO3sBzcOuVyuan3iVIGjkpMEmdqZxiB2i41iZRLf0uE9sIb9fPsEM2aLpiPk/s1600/Image.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwGseHEBRjYfRJe5Nl3ph90mne1kvcKEu1Ulk8-zC7Pjfdq5Z1Ytus6f4ICl_B7nvCCYT5CJmNLuiKV4WaO3sBzcOuVyuan3iVIGjkpMEmdqZxiB2i41iZRLf0uE9sIb9fPsEM2aLpiPk/s320/Image.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span></div>
<div class="separator" style="clear: both; text-align: left;">
Physical wiring: </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ1DAXAOz1kIIkj6c8nB_mpISvjKJTNF_03SEp0bUW66tcvd0AtSuduqgm3YCYacz-13rw7AgR5bf_0s3RT-e1jUJtkQwLJECiZ6eq4Cph1XatA1_VgaxGm3iTSLBlXLjnlXW5kG1dKnc/s1600/271220111333.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ1DAXAOz1kIIkj6c8nB_mpISvjKJTNF_03SEp0bUW66tcvd0AtSuduqgm3YCYacz-13rw7AgR5bf_0s3RT-e1jUJtkQwLJECiZ6eq4Cph1XatA1_VgaxGm3iTSLBlXLjnlXW5kG1dKnc/s320/271220111333.jpg" width="320" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJLxz3YZkBQG1mLDzPNtEGJ3WHZPLklJ_2tdVTemBM6LNt0qTSn0Eg0bKZPVL5Q4plU03exZHHaoF3WmRh5z0Hs2PT_kVzkI_bptSBkARWpmvw7mnAdZUKZfVrZ_0kolpXq5bHVxjKT7U/s1600/271220111334.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJLxz3YZkBQG1mLDzPNtEGJ3WHZPLklJ_2tdVTemBM6LNt0qTSn0Eg0bKZPVL5Q4plU03exZHHaoF3WmRh5z0Hs2PT_kVzkI_bptSBkARWpmvw7mnAdZUKZfVrZ_0kolpXq5bHVxjKT7U/s320/271220111334.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Download the code below :</span></div>
<div style="background-color: #f9f9f9; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 738px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;">
<pre style="clear: none; float: none; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: auto;"><span class="Apple-style-span" style="color: #339933;"><span class="Apple-style-span" style="font-size: 12px; line-height: 15px;">#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 7, 6, 5, 4, 3, 2);
int pingPin = 13;
int inPin = 12;
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}
void loop(){
// establish variables for duration of the ping,
// and the distance result in inches and centimeters:
long duration, inches, cm;
// The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);
// The same pin is used to read the signal from the PING))): a HIGH
// pulse whose duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(inPin, INPUT);
duration = pulseIn(inPin, HIGH);
// convert the time into a human readable distance
cm = microsecondsToCentimeters(duration);
// if distance is too large (probably not being measured properly)
// will discard the result.
if (cm > 400){
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Nothing detected");
}
else {
// clear lcd content
lcd.clear();
// set the cursor to column 0, line 0
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 0);
lcd.print("Object detected ");
lcd.setCursor(0, 1);
lcd.print(cm);
lcd.print("cm away!");
}
delay(500);
}
long microsecondsToInches(long microseconds){
// According to Parallax's datasheet for the PING))), there are
// 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
// second). This gives the distance travelled by the ping, outbound
// and return, so we divide by 2 to get the distance of the obstacle.
return microseconds / 74 / 2;}
long microsecondsToCentimeters(long microseconds){
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;}</span><span class="Apple-style-span" style="font-size: 12px; line-height: 1.333;">
</span></span></pre>
<div>
<span class="Apple-style-span" style="color: #339933;"><br /></span></div>
</div>
</div>
<div style="font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Reset the Arduino , then you can see the distance of object in front on the LCD.</div>
<div style="font-size: 12px; margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<br /></div>
<div style="margin-bottom: 10px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJQy3r6ZxnBZIIU0dRSa4KvLRrCXrJup8knq5kfovcK5wVH9UtmFc8QDI4cPUDxyBB3XNXWuLy1uJy9WqJ7fY7VzLInYh0iI6lLMb6XBc3SxApD22YwG9c2dCz8PSrAGlMKAkGnm8CTlU/s1600/271220111329.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJQy3r6ZxnBZIIU0dRSa4KvLRrCXrJup8knq5kfovcK5wVH9UtmFc8QDI4cPUDxyBB3XNXWuLy1uJy9WqJ7fY7VzLInYh0iI6lLMb6XBc3SxApD22YwG9c2dCz8PSrAGlMKAkGnm8CTlU/s320/271220111329.jpg" width="320" /></a></div>
<div style="display: block; height: 52px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<div style="clear: both; display: block; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<ul style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: none; background-origin: initial; background-position: initial initial; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; clear: both; float: left; list-style-image: initial; list-style-position: outside; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 738px;">
<li style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: url(http://iteadstudio.com/wp-content/uploads/shareaholic/spritegen/sprite.png); background-origin: initial; background-position: -51px -204px; background-repeat: no-repeat no-repeat; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; clear: none; cursor: pointer; display: inline; float: left; height: 29px; list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 3px; outline-color: initial; outline-style: none; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-indent: 1.2em; width: 60px;"><a href="http://www.shareaholic.com/api/share/?title=Arduino+Ultrasonic+Ranging+With+HC-SR04&link=http%3A%2F%2Fiteadstudio.com%2Fapplication-note%2Farduino-ultrasonic-ranging-with-hc-sr04%2F&notes=HC-SR04%2520not%2520only%2520inexpensive%2520but%2520also%2520practical%252C%2520use%2520a%2520sample%2520AVR%2520development%2520boar%2520--Arduino%2520%252C%2520with%2520a%2520LCD%2520screen%2520%252C%2520you%2520can%2520make%2520a%2520easy%2520rangefinder%2520device%2520%252C%2520which%2520can%2520ranging%25202cm%2520to%2520500cm%2520.%250D%250A%250D%250ANow%2520first%2520connect%2520the%2520circuit%2520as%2520below%2520%253A%250D%250A%250D%250AWith%2520module%2520%253A%2520pin13%2520to%2520Trig%2520%253B%2520pin%252012%2520to%2520Echo%2520%253B%2520VCC%2520to%2520VCC%253B%2520GND%2520t&short_link=&shortener=google&shortener_key=&v=1&apitype=1&apikey=8afa39428933be41f8afdb8ea21a495c&source=Shareaholic-Publishers&template=&service=40&ctype=" rel="nofollow" shape="rect" style="background-color: transparent; border-bottom-left-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-top-style: none; border-top-width: 0px; color: #0fade5; display: block; font-size: 12px; height: 29px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1px; padding-left: 3px; padding-right: 3px; padding-top: 1px; text-decoration: none; text-indent: -9999px; width: 60px;" target="_blank">Add to Reddit</a></li>
</ul>
</div>
</div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-75440738484253645332011-12-21T14:07:00.000+00:002013-04-04T19:11:48.566+01:00"Stalker" -- Quadruped Robot Project<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpKA1qqysSBUFWgYyWX1_WdSm_NZDTqYUIblSnUn-9P1JzH7Xpp8oL4Jcy9C4A8qjd0v0b0OthkE6WHFVtwQPips94xzoFMYcBXYVhX9HOoqs_6wYc2TaES2goENvyZC4LSY7570EKvlU/s1600/stalkers.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpKA1qqysSBUFWgYyWX1_WdSm_NZDTqYUIblSnUn-9P1JzH7Xpp8oL4Jcy9C4A8qjd0v0b0OthkE6WHFVtwQPips94xzoFMYcBXYVhX9HOoqs_6wYc2TaES2goENvyZC4LSY7570EKvlU/s640/stalkers.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Quadruped Robot Project -- The Stalker</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Inspired by the fighting unit "Stalker" in Starcraft.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Project has been re-created and being maintained on this page:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://blog.oscarliang.net/arduino-quadruped-robot-stalker/">http://blog.oscarliang.net/arduino-quadruped-robot-stalker/</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a><br />
What I need:<br />
<br />
1. Arduino Mega<br />
2. 12 - 14 Servos<br />
3. Wii Nunchuck controller<br />
4. IR sensor or Ultra sonic sensor<br />
5. a few styrene sheet (skeleton)<br />
6. 4xAA batteries<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">Plan:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">1. design the skeleton of the robot, build with styrene plastic sheet.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">2. Build a single leg with 3 servos, and write a class for single-leg motion.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">3. figure out a way to control the leg (probably using buttons) without reprogramming it every time.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">4. Assembly the whole thing.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">-------------</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">5. learn how to use a Wii Nunchuck.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">6. use it on the Stalker.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">-------------</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">7. learn how to use wireless module, and use it on Wii Nunchuck controller. (probably need a extra Arduino to be the transmitter)</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">8. use it on the Stalker.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">-------------</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma; text-align: -webkit-auto;">9. IR/ Ultra-Sonic automation</span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
========================================================================</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<b>1. Design of the Skeleton</b></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Body</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_JtEEZ_5Ngkgjlxr4nftdOtgPYw-kIMBO3fmwp3JZNJVo_2BMWXHaHuGBVdqkebd1KZ2TS0PlNvDKZXFqWm6AXMdqhlF_rIyTjvK4UzgVyUoErwMaFv0mQW9_mXylp_gNFLgF0Cr0cZ4/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_JtEEZ_5Ngkgjlxr4nftdOtgPYw-kIMBO3fmwp3JZNJVo_2BMWXHaHuGBVdqkebd1KZ2TS0PlNvDKZXFqWm6AXMdqhlF_rIyTjvK4UzgVyUoErwMaFv0mQW9_mXylp_gNFLgF0Cr0cZ4/s320/1.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Legs</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbveFkxJVe0l9AV4A51bqyG9gEdnkrrba5UeRF1gp1UXUU7YVW1vfOJPWYrGSRDf5Y26W3upLZvL9KA-aI-oKaNVzsE7yeeOFtQ1idwIr4E7B3eAZ6J6ECeTQfftOSnAFJyLexUq57x5M/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbveFkxJVe0l9AV4A51bqyG9gEdnkrrba5UeRF1gp1UXUU7YVW1vfOJPWYrGSRDf5Y26W3upLZvL9KA-aI-oKaNVzsE7yeeOFtQ1idwIr4E7B3eAZ6J6ECeTQfftOSnAFJyLexUq57x5M/s400/3.png" width="305" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Hips</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXfRzWTvjsR-vmfudFJ_VkjEbVWeYMIcmhp_94iOTYBidFxgYaKzRf_RWqhI6HOoInlNH7aqshmHEv1EVunyE4OK-IijablVA4I0_hdCEUf7x0v1GoJJliBHNvJorevxlf26umUfkKcZU/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXfRzWTvjsR-vmfudFJ_VkjEbVWeYMIcmhp_94iOTYBidFxgYaKzRf_RWqhI6HOoInlNH7aqshmHEv1EVunyE4OK-IijablVA4I0_hdCEUf7x0v1GoJJliBHNvJorevxlf26umUfkKcZU/s400/2.png" width="313" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCrPanhuXNP2fRj5wkfoqDcu_58xNCCUXtF2qOI167eYsrtDHADV2I7erQsJY2RnmOGhw5TCk3Y29ZgnygNmBFDWEYb66PXgA0cfwqzivD9bAUJT_wqXGCKSrffk0Yr_rj6ytehBVCy_8/s1600/211220111312.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCrPanhuXNP2fRj5wkfoqDcu_58xNCCUXtF2qOI167eYsrtDHADV2I7erQsJY2RnmOGhw5TCk3Y29ZgnygNmBFDWEYb66PXgA0cfwqzivD9bAUJT_wqXGCKSrffk0Yr_rj6ytehBVCy_8/s320/211220111312.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqANdK1StFlhy7AItdJ0ZqNWkojMwOO_-iKdK2tEmXbVLHeb_AiVfsLDZL2e4Z3blNEE5siqetP9FO4jQYwtM9BU5ZrPVPBdKt7oKhBVUP7E-rhNT8QfLlqw4Gkjq5JR6N0tau3pHOrlE/s1600/221220111313.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqANdK1StFlhy7AItdJ0ZqNWkojMwOO_-iKdK2tEmXbVLHeb_AiVfsLDZL2e4Z3blNEE5siqetP9FO4jQYwtM9BU5ZrPVPBdKt7oKhBVUP7E-rhNT8QfLlqw4Gkjq5JR6N0tau3pHOrlE/s320/221220111313.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb55jl88XUxOnsgcbl2O_YsgR4vXrz-vOxoXk_9AFwPd8QR2uR7ehrxX8FiVk2NOIQgJhZeKmOdCCZ1Gn-GmCPJtrZ-TAGTljwB2jB9R3M_0JRlP16RmMXmNgh2YIxP4CPREOEZxl73Zs/s1600/221220111314.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb55jl88XUxOnsgcbl2O_YsgR4vXrz-vOxoXk_9AFwPd8QR2uR7ehrxX8FiVk2NOIQgJhZeKmOdCCZ1Gn-GmCPJtrZ-TAGTljwB2jB9R3M_0JRlP16RmMXmNgh2YIxP4CPREOEZxl73Zs/s320/221220111314.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Single leg Test:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/xwiyaKrDxvU?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span class="Apple-style-span" style="font-family: Tahoma;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span class="Apple-style-span" style="font-family: Tahoma;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span class="Apple-style-span" style="font-family: Tahoma;">===================================================</span></div>
<div class="separator" style="clear: both; text-align: left;">
24/12/2011</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And here we have all the legs and the base:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFVlOSK4GbCaiLgLhzGYsx9ie5hWO3-pyfaWbBpuzh91SkaKf4sKD1wviiQYj9IzoumKFqqcygmaA2-OHguggrvLNRTkGpFGi_ABDFjdf8zVx_HA-AmTG4K3AMMk1o0CsBpRw6k8_tgpQ/s1600/221220111315.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFVlOSK4GbCaiLgLhzGYsx9ie5hWO3-pyfaWbBpuzh91SkaKf4sKD1wviiQYj9IzoumKFqqcygmaA2-OHguggrvLNRTkGpFGi_ABDFjdf8zVx_HA-AmTG4K3AMMk1o0CsBpRw6k8_tgpQ/s320/221220111315.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUrX4eqQUNwl059PM35tIb7I1CRryBBaIrgkXZRJfQ5We_7Ha1CQUmweoUqL3rt4pe3euAPGNndH7Uq9J6uvXwzMQoQVjAVqLqV5PW-DS9mjtPCLYNeUyvhp93zncCW1sFs-_6P1RvxgI/s1600/241220111318.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUrX4eqQUNwl059PM35tIb7I1CRryBBaIrgkXZRJfQ5We_7Ha1CQUmweoUqL3rt4pe3euAPGNndH7Uq9J6uvXwzMQoQVjAVqLqV5PW-DS9mjtPCLYNeUyvhp93zncCW1sFs-_6P1RvxgI/s320/241220111318.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNmPBDyi8MlfEMlJM-_VT3QQloJnqi3NnOtKtUGNla2vL48TGC10CpdbP2rHGrfBPTcnCGfVtNvB7suElp8U3eVLXHlx9Pc5APWjD74blLQrctProXXFhwyb5yyjCPzn-3rkshRUwD0ts/s1600/241220111321.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNmPBDyi8MlfEMlJM-_VT3QQloJnqi3NnOtKtUGNla2vL48TGC10CpdbP2rHGrfBPTcnCGfVtNvB7suElp8U3eVLXHlx9Pc5APWjD74blLQrctProXXFhwyb5yyjCPzn-3rkshRUwD0ts/s320/241220111321.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA98J6GPw7vibQjrrjhsMtaJB2s4ET6hn055FJzjLQPuT6C8-vDJZgeh91oVeHj_IRV3Hku_Q7qZ5oGfRa24FKH5nCUyY8vP_QKa2nbjv7nAOQ-YDTHE2cPNsk9ur6PdIGXBAGY6-2LME/s1600/241220111320.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA98J6GPw7vibQjrrjhsMtaJB2s4ET6hn055FJzjLQPuT6C8-vDJZgeh91oVeHj_IRV3Hku_Q7qZ5oGfRa24FKH5nCUyY8vP_QKa2nbjv7nAOQ-YDTHE2cPNsk9ur6PdIGXBAGY6-2LME/s320/241220111320.jpg" width="320" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj721XxlXHorSYTLJONL8CMvdbascW8133eMHoEaUGiaG9SAQhTUOAr_NsHDkZqUE_DsopFzYI_ai8euCXutOIjTDdR1Wzx-TqrOuvqCcXiMF_MwFuOKMBfhXlPw-Gzj6s1vd1K3fDlLeY/s1600/251220111322.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj721XxlXHorSYTLJONL8CMvdbascW8133eMHoEaUGiaG9SAQhTUOAr_NsHDkZqUE_DsopFzYI_ai8euCXutOIjTDdR1Wzx-TqrOuvqCcXiMF_MwFuOKMBfhXlPw-Gzj6s1vd1K3fDlLeY/s320/251220111322.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now everything is ready, but the 'brain' of the stalker to arrive from China.</div>
<div class="separator" style="clear: both; text-align: left;">
I will use UNO for testing and write some code in order to save time.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This one demonstrate the simplest thing it can do, "breathing":</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/3G4jC_pp9J0/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/3G4jC_pp9J0?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" />
<param name="bgcolor" value="#FFFFFF" />
<embed width="320" height="266" src="http://www.youtube.com/v/3G4jC_pp9J0?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash"></embed></object></div>
<br />
<br />
This uses sine wave multiplying factors:<br />
<b><br /></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzfbqwjzdusUrQwUXnNH-Qojq7hoyJeTWI7T2tZKQsfH7Cw91fMXE3ZafVsw4adQQqERRNaDgZWUPtLEs0d07uw4G2-VCi8sDQGvscJGWR5Dxiq7OKMzEYO5WchtUCYNqGBG4s6xxVlC8/s1600/271220111325.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzfbqwjzdusUrQwUXnNH-Qojq7hoyJeTWI7T2tZKQsfH7Cw91fMXE3ZafVsw4adQQqERRNaDgZWUPtLEs0d07uw4G2-VCi8sDQGvscJGWR5Dxiq7OKMzEYO5WchtUCYNqGBG4s6xxVlC8/s640/271220111325.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjskb52H4EO_BSlmwDazAgmjeNyEIGFa2JEFaD70X5FlnkYaFX7uVytzFq1ggtghHiw7tkDImEeG8S5M24CsvUGw_G90WbFLFVSLTkxKPN9skx5Z7lSRcIGX6IrFcxKdF0k8kcegKJ8eZI/s1600/271220111326.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjskb52H4EO_BSlmwDazAgmjeNyEIGFa2JEFaD70X5FlnkYaFX7uVytzFq1ggtghHiw7tkDImEeG8S5M24CsvUGw_G90WbFLFVSLTkxKPN9skx5Z7lSRcIGX6IrFcxKdF0k8kcegKJ8eZI/s640/271220111326.jpg" width="640" /></a></div>
<b><br /></b>
<br />
realise the increase of the leg angles has to be proportional to the hip position. (first order derivative?)<br />
To calculate the angles that the servo needs to turn, we can do calculation shown below, and it's got a fancy name "inverse kinematics" (that's only the basic of the theory, need to dig deeper when developing the gaits)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQbZBD3-dqFafw-0G0GlEBoWyxmTbAkIdSERUekCjxZlNmeVTAT6Oo0ozGqCJD7C3Xm61FWVgilwvKOYji57dRjGQQp9K06vhAMDAMoCJGVdjI-txCTERdinkeKKUNBUgfZ7lsJa0RkJc/s1600/271220111328.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQbZBD3-dqFafw-0G0GlEBoWyxmTbAkIdSERUekCjxZlNmeVTAT6Oo0ozGqCJD7C3Xm61FWVgilwvKOYji57dRjGQQp9K06vhAMDAMoCJGVdjI-txCTERdinkeKKUNBUgfZ7lsJa0RkJc/s400/271220111328.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitCBJ0ADrxady4449TQstokXKXwIYFgBeXrOKp5riwzG7Oe8fCp_rvY209SO5fBaDQB7wrT9GzQvA5tYoCj2rHVf6bgm-v69TM8Tr1NfACbWeLHUio7IAe0uwDTbzoQUqJF-t1oQQ5Pkc/s1600/271220111327.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitCBJ0ADrxady4449TQstokXKXwIYFgBeXrOKp5riwzG7Oe8fCp_rvY209SO5fBaDQB7wrT9GzQvA5tYoCj2rHVf6bgm-v69TM8Tr1NfACbWeLHUio7IAe0uwDTbzoQUqJF-t1oQQ5Pkc/s640/271220111327.jpg" width="480" /></a></div>
<br />
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="font-family: Tahoma;">Code template so far:</span></span></span></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="font-family: Tahoma;"><br /></span></span></span></span>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
void setup(){<br />
<br />
calculate parameters;<br />
attach servos;<br />
<br />
}<br />
<br />
void loop(){<br />
<br />
calculate position;<br />
update position;<br />
delay;<br />
<br />
}</td></tr>
</tbody></table>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">===================================================</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">26/12/2011</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">So the stalker are currently being controlled by UNO, only the legs and hips servos are used (8 in total). </span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">It works with the "Breathing" coding. But it has a very very obvious disadvantage: The servos are not powerful enough (as they are only $3 each). Well, that's a great lesson to learn. Also, the plastic legs and base isn't strong enough as it kind of bends and shakes a bit when it's moving. One thing I can do is to weld some more plastic pieces to back it up.</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">However, occasionally when I send out varying PWM signals (trying to change the positions), the legs just folder up, and stopped moving.</span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">When I disconnected at least 4 servos, and re-uploading the code, everything seems to be normal again. I am wondering if that's something to do with the timers. Let's have a look at how to control multiple servos with timers: </span></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">h</span><span style="font-family: Arial;"><a href="http://arduino.cc/forum/index.php/topic,10666.0.html">ttp://arduino.cc/forum/index.php/topic,10666.0.html</a></span></span></div>
<div>
<span style="font-family: Tahoma;"><br /></span></div>
<div>
<span style="font-family: Tahoma;">Maybe I should write my own servo lib to make them more effiicient, and workable.</span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">Also, to move servo position, i should probably compute all the values (positions) and store in an array, and drive the servos from data.</span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></div>
<div style="font-family: 'Times New Roman';">
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">Some tips about updating the positions of servo: don't use delay as it is a block execution, but milli(), to keep track of past time, so loop can still continue and do other stuff.</span></div>
<div>
<span style="font-family: Tahoma;"><br /></span>
<span style="font-family: Tahoma;"><br /></span>
<span style="font-family: Tahoma;"><br /></span>
<span style="font-family: Tahoma;">===================================================</span><br />
<span style="font-family: Tahoma;">27/12/2011</span></div>
<div>
<span style="font-family: Tahoma;"></span><br />
<div>
<span style="font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="font-family: Tahoma;"><br /></span></span></span></div>
<div>
<span style="font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: x-small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="font-family: Tahoma;">This is the updated code template:</span></span></span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
parameters declaration;<br />
<br />
<br />
void setup(){<br />
<br />
calculate parameters;<br />
calculate positions and store in array;<br />
attach servos;<br />
<br />
}<br />
<br />
void loop(){<br />
<br />
int curTime = millis()<br />
<br />
if (curTime >= servoTime + servoDelay){<br />
servoTime = curTime;<br />
update positions from array;<br />
}<br />
<br />
if (curTime >= otherTime + otherDelay){<br />
<br />
do other things;<br />
...<br />
<br />
}<br />
<br />
}</td></tr>
</tbody></table>
<span style="font-family: Tahoma;"><br /></span></div>
</div>
<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br />
26/12/2011</span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">So the stalker are currently being controlled by UNO, only the legs and hips servos are used (8 in total). </span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">It works with the "Breathing" coding. But it has a very very obvious disadvantage: The servos are not powerful enough. Well, that's a great lesson to learn. Also, the plastic legs and base isn't strong enough as it kind of bends and shakes a bit when it's moving. One thing I can do is to weld some more plastic pieces to back it up.</span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">However, occasionally when I send out varying PWM signals (trying to change the positions), the legs just folder up, and stopped moving.</span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">When I disconnected at least 4 servos, and re-uploading the code, everything seems to be normal again. I am wondering if that's something to do with the timers. Let's have a look at how to control multiple servos with timers: </span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">h</span><span style="font-family: Arial;"><a href="http://arduino.cc/forum/index.php/topic,10666.0.html">ttp://arduino.cc/forum/index.php/topic,10666.0.html</a></span></span></div>
<div>
<span style="font-family: Tahoma;"><br /></span></div>
<div>
<span style="font-family: Tahoma;">Maybe I should write my own servo lib to make them more effiicient, and workable.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">Also, to move servo position, i should probably compute all the values (positions) and store in an array, and drive the servos from data.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;">Some tips about updating the positions of servo: don't use delay as it is a block execution, but milli(), to keep track of past time, so loop can still continue and do other stuff.</span></div>
<div>
<span style="font-family: Tahoma;"><br /></span></div>
<div>
<span style="font-family: Tahoma;"><br /></span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
parameters declaration;<br />
<br />
<br />
void setup(){<br />
<br />
calculate parameters;<br />
calculate positions and store in array;<br />
attach servos;<br />
<br />
}<br />
<br />
void loop(){<br />
<br />
int curTime = millis()<br />
<br />
if (curTime >= servoTime + servoDelay){<br />
servoTime = curTime;<br />
update position from array;<br />
}<br />
<br />
if (curTime >= otherTime + otherDelay){<br />
<br />
do other things;<br />
...<br />
<br />
}<br />
<br />
}</td></tr>
</tbody></table>
<div>
<span style="font-family: Tahoma;"><br /></span></div>
</div>
<div>
<br /></div>
<div>
So, realized that the servo is definitely not strong enough. To do a gait smoothly, I will have to let the robot balance on only 3 legs. I have been thinking to get some more powerful servos, but they seem to be so expensive. If I was going to get some better ones, I will definitely need some with torque of 7kg/cm or above, but that would cost me £15 each at least!!! oh my gosh.</div>
<div>
<br /></div>
<div>
As it's turn out to be a cash burning project, I will first try to reduce the moment (physics) by reducing the distance of the force from the mass center, see if that would help balancing the body better. If not, I will get some new servos, and at the meantime look around for aluminum legs and body. ; )</div>
<div>
<br /></div>
<div>
done a bit of servo research:</div>
<div>
</div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
Hitec HS-5645 MG (£30)<br />
<br />
Dimensions (mm): 20.0 x 41.0 x 38.0<br />
Weight (grams): 60.0<br />
Speed (sec): 0.23<br />
Torque (Kg.cm): 10.30<br />
Ball Raced: Yes</td></tr>
<tr><td valign="top"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br />
TowerPro Servo MG-995 (£10)<br /><br />
Size: 40.6mm x 19.8mm x 37.8mm<br />
Weight: 62g<br />
Operating Speed: 0.13sec/60degree (6.0V) 0.17sec/60degree (4.8V)<br />
Stall torque:15.0kg/cm (6.0V) 13.kg/cm (4.8V)<br /><br />
(But not a very good, accurate servo, in most cases, it overshoots, and not centering properly.<br /><br />
see reviews for details:<br /><a href="http://www.rcgroups.com/forums/showthread.php?t=442171">http://www.rcgroups.com/forums/showthread.php?t=442171</a><br />
also this<br /><a href="http://www.rcuniverse.com/forum/m_8500712/anchors_8500712/mpage_1/key_/anchor/tm.htm#8500712">http://www.rcuniverse.com/forum/m_8500712/anchors_8500712/mpage_1/key_/anchor/tm.htm#8500712</a></span></td></tr>
<tr><td valign="top"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><br />
Hitec - HS-645MG (£23)<br /><br />
BearingSpeed (4.8V/6.0V):0.24 / 0.20Torque oz./in. (4.8V/6.0V):107 / 133<br />
Torque kg./cm. (4.8V/6.0V):8.0 / 10.0<br />
Size in Inches:1.59 x 0.77 x 1.48S<br />
ize in Millimeters:40.39 x 19.56 x 37.59<br />
Weight ounces:1.94Weight grams:55</span></td></tr>
</tbody></table>
<div>
<br /></div>
<div>
These three seem to be the reasonable ones. MG995 has good torque compared to the price, but with the reviews on the Internet, as what people say "I would rather spend some more money on realiability now than saving a few quits, which will pay off in the long run".</div>
<div>
<br /></div>
<div>
So I will probably go for the HS 645MG... asked one of the buyers on eBay, see if I can get a deal if I order a dozen.<br />
<br />
<br />
===================================================<br />
30/12/2011<br />
<br />
So this is what i did to try to reduce the force on the servos when it's standing:<br />
1. shortened the legs, enhance strength of the legs.<br />
2. re-built body and brings legs closer to the center.<br />
3. made body with double layer plastic (was only single)<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzZrRSVEdsJeqavFGjJYZqeG_-0feAloawRJHbT1QQuCQUBhQK0eG1q9GVZ8Nc34l0eWQ6jAgR5s03RDHdEfhspNH12WH30VL1ZFQtMimRzlDooD73JC7iox_UoMrjyGoBoQfAO-u4Krw/s1600/271220111335.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzZrRSVEdsJeqavFGjJYZqeG_-0feAloawRJHbT1QQuCQUBhQK0eG1q9GVZ8Nc34l0eWQ6jAgR5s03RDHdEfhspNH12WH30VL1ZFQtMimRzlDooD73JC7iox_UoMrjyGoBoQfAO-u4Krw/s320/271220111335.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirfclXiawtU8U0z6mzhr3U_0UExNZDsSzOl-_r-edcmqgP6W_Nj7ny9wkB0Nq0YAP9OqDYH0xQxzC5I4DvfI0OqMFDQVlzsFIEZvH-I3F-QtOFcw6CvooYWsYJyOYKQhIQxFFLRWWufRA/s1600/281220111336.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirfclXiawtU8U0z6mzhr3U_0UExNZDsSzOl-_r-edcmqgP6W_Nj7ny9wkB0Nq0YAP9OqDYH0xQxzC5I4DvfI0OqMFDQVlzsFIEZvH-I3F-QtOFcw6CvooYWsYJyOYKQhIQxFFLRWWufRA/s320/281220111336.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAARnLTlWke1ruTC78kyBjec1ze0K1mwqjrVHgclh1pFnkLVC9CEzCaV00sly53_OKgzeHtdfHPGqsD83pFbgdb3_pMgmvl3Ni6cAyXXiv8pty66xeydCC4xzdRsOXZ9-YpoW0wsBy5RA/s1600/281220111340.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAARnLTlWke1ruTC78kyBjec1ze0K1mwqjrVHgclh1pFnkLVC9CEzCaV00sly53_OKgzeHtdfHPGqsD83pFbgdb3_pMgmvl3Ni6cAyXXiv8pty66xeydCC4xzdRsOXZ9-YpoW0wsBy5RA/s320/281220111340.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLkxOFzdeE_kudWOoAX640zlU1b1-K50L8bR4Aa8zfKd8PiKLuu9wqbsMhq_-H_KWPNGSLMxMtvpkCC4rPmG5JW1WxdAHAKEHNgeb4F8UEs_C_6-UuYHsY4pf213auM90iX6xsVPE0SEA/s1600/281220111341.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLkxOFzdeE_kudWOoAX640zlU1b1-K50L8bR4Aa8zfKd8PiKLuu9wqbsMhq_-H_KWPNGSLMxMtvpkCC4rPmG5JW1WxdAHAKEHNgeb4F8UEs_C_6-UuYHsY4pf213auM90iX6xsVPE0SEA/s320/281220111341.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXNrcqs8siln6LaoNmnSTmvjGtD0GwRbUGZGziGX-6XZnoe-xgfTNREMmZlzzIfGs5KGgfMLkPWr0kmceDEwxlIzB8OtgJy_Pwy6tJ5D5x1cBHo_lYjw7OuGMCVD4UbCePRHtDs1qjanY/s1600/281220111342.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXNrcqs8siln6LaoNmnSTmvjGtD0GwRbUGZGziGX-6XZnoe-xgfTNREMmZlzzIfGs5KGgfMLkPWr0kmceDEwxlIzB8OtgJy_Pwy6tJ5D5x1cBHo_lYjw7OuGMCVD4UbCePRHtDs1qjanY/s320/281220111342.jpg" width="320" /></a></div>
<br />
I think it actually looks better personally, and the robot can do more moves without falling down and twitching as often. But still, the servos are just too weak and can't do the walking. It's so frustrating and I have decided to only focus on the coding and look for new servos and parts (possibly aluminium rather than plastic).<br />
<br />
This video is probably the last one I will upload showing the 9g Servos.... .v.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/eFHujFKcztI?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
====================================================<br />
31/12/2011<br />
<br />
Update: decided to delay the purchase of new servos and the quadruped robot. will use 12 9g servos to build a hexapod first, and write a VB program to control arduino from the PC through serial port.<br />
<br />
I will write a new post about the lastest work soon.<br />
<br />
<br /></div>
Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-70648321223567896922011-12-20T02:32:00.000+00:002011-12-23T19:10:06.777+00:00"Wally" -- IR Detection Robot enhanced version V2<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Result:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span id="goog_246937252"></span><span id="goog_246937253"></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/6w3N7RUM3C0?feature=player_embedded' frameborder='0'></iframe></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Summary:</span><br />
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">1. rebuild Tracking Head with Styrene plastic, to replace the cardboard one.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">2. introduced libraries for motor control, and IR sensor, to increase user-friendliness</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">3. improved object-following algorithm,</span><span class="Apple-style-span" style="font-family: Arial;"> introduced "object-avoiding" as well.</span><br />
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span><br />
<a name='more'></a></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span><br />
<span style="font-family: Arial;">First Version of this robot:</span><br />
<a href="http://arduin0.blogspot.com/2011/12/i-will-update-functionality-of-this.html">http://arduin0.blogspot.com/2011/12/i-will-update-functionality-of-this.html</a>
<br />
<br />
Let's get rocking.<br />
<span class="Apple-style-span" style="font-family: Arial;"><br /></span><br />
<span class="Apple-style-span" style="font-family: Arial;">1. My styrene plastic sheets finally arrived. So I re-built my tracking head!</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj069ccZ0r4vLZ8-32cTxOJJzOu6nqABSZcvdBcYzlB4ROhEu3AjdqTjmNEGsKCAqGoa2MSZL_fj1yyVpIpuaa2QhIAHnc6QcoGCN5ZUmTlK_v94nzC93BAMnnOpUSw0JRcNMx03XFEY_Q/s1600/201220111307.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj069ccZ0r4vLZ8-32cTxOJJzOu6nqABSZcvdBcYzlB4ROhEu3AjdqTjmNEGsKCAqGoa2MSZL_fj1yyVpIpuaa2QhIAHnc6QcoGCN5ZUmTlK_v94nzC93BAMnnOpUSw0JRcNMx03XFEY_Q/s320/201220111307.jpg" width="320" /></a></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkWDVTRX60pD5rADbfKt9UUsv-kS-MQIjoD0Gz1jB29JiIwH9AikYsRaRyCxPaC8QZLbbH1XukOHWx4OFJHnZBwFEL_DkPpY5FwRJoIKctKcH6WKWQIvF5rvDJt4B9mnipv7lc9RSNMlo/s1600/201220111306.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkWDVTRX60pD5rADbfKt9UUsv-kS-MQIjoD0Gz1jB29JiIwH9AikYsRaRyCxPaC8QZLbbH1XukOHWx4OFJHnZBwFEL_DkPpY5FwRJoIKctKcH6WKWQIvF5rvDJt4B9mnipv7lc9RSNMlo/s320/201220111306.jpg" width="320" /></a></span></span></div>
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';">
<br />
</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><br /></span></span></div>
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';">
<br />
</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKA5HqPjxXAkiUpK7aopVEtt8JPIve4PxD7dGdKszlH1iZNupwHSV8-uQfBuI1qmUMuh3U_Vcbzq8yaQ1S6_sUVsPE8C07ip82J0_R76cLqV_xwVmAS2mHhTJMo60S_iu4nGrXqoE9jdE/s1600/201220111308.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKA5HqPjxXAkiUpK7aopVEtt8JPIve4PxD7dGdKszlH1iZNupwHSV8-uQfBuI1qmUMuh3U_Vcbzq8yaQ1S6_sUVsPE8C07ip82J0_R76cLqV_xwVmAS2mHhTJMo60S_iu4nGrXqoE9jdE/s320/201220111308.jpg" width="320" /></a></span></span></div>
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';">
<br />
</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi39pLPyc6igL9FN-Fm7R00T8ya6quL0G3cFT8_IU6dYpBz398lo1LfLbSuy9zY1AqBzFxlXvnP7-x3oIYEqGX6XusjV7odzxO-hyjM5H1Mfvn3rDkHFoNjdvR2BupZpN56kqNVQ94M718/s1600/201220111309.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi39pLPyc6igL9FN-Fm7R00T8ya6quL0G3cFT8_IU6dYpBz398lo1LfLbSuy9zY1AqBzFxlXvnP7-x3oIYEqGX6XusjV7odzxO-hyjM5H1Mfvn3rDkHFoNjdvR2BupZpN56kqNVQ94M718/s320/201220111309.jpg" width="320" /></a></span></span></div>
<span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-family: 'Times New Roman';">
<div>
<br /></div>
</span></span></div>
<div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"></span><br />
<div>
<div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
</div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">2. introduced libraries for motor control, and IR sensor, to increase user-friendliness</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">Basically, the IR class simply the process of measuring the reflected IR when IR LEDs are turned on and off.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">The Motor driver class provide user friendly interface for user, so instruction of 'go forward', 'turn left' etc can be used directly instead of changing states of the inputs.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">3. improved object-following code, introduced "object-avoiding" as well.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><b><u>Principles:</u></b></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>object-following</b></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">switch on and off the IR very rapidly, to compare the difference. If the difference is larger than a minimum reading, means object is near the sensor, and it will compare the reading between up and down, left and right sensors, to adjust the position of the head until the readings are balanced. If the object is getting further, the car will move forward until the reading is within the stable range, and the same when it's getting too close.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">When the head turns to a certain angle horizontally, the body turns to that direction to help tracking the object. You might ask what happen if the object moves away when the body is turning? will it keep turning forever? The answer is yes, and i used a small trick here: the head recovers to a default position when object is not detected.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>object-avoiding</b></span></span></div>
</div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">In this function, only the left and right sensors are used. When nothing is detected, the car keeps going forward. if obstacle appears and only affecting one sensor, it will turn. If the obstacle is affecting both sensor (right at the front), the head will wave around and take readings at right and left side, then decide which way to turn. If still, readings are high, it will turn around and go back.</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">// =============================================</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">// ============== Source Code ====================</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">// =============================================</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br />
IR Sensor h file</span></span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
<span style="color: red; font-style: normal;">/*<br /><br />
Oscar's project<br /><br />
IR 4 position sensor<br /><br />
12/12/2011<br />
decided add in servo control (from attach to actual control)<br /><br />
11/12/2011<br />
this library is used to control a 4 position (up down left right) IR sensor,<br />
which contains both emitters and detectors.<br /><br />
*/</span><br />
<br />
<span style="color: #339900;">#ifndef WPROGRAM_H</span><br />
<span style="color: #339900;">#define WPROGRAM_H</span><br />
<span style="color: #339900;">#include "WProgram.h" //standard types and constants of the Arduino language</span><br />
<span style="color: #339900;">#endif</span><br />
<br />
<span style="color: blue;">class</span> IRSensor <span style="color: green;">{</span><br />
<br />
<span style="color: blue;">private</span><span style="color: teal;">:</span><br />
<br />
<span style="color: #666666; font-style: normal;">// Pins</span><br />
byte irLEDPin<span style="color: teal;">;</span><br />
byte calON_LEDPin<span style="color: teal;">;</span><br />
byte calOFF_LEDPin<span style="color: teal;">;</span><br />
<br />
byte leftIRPin<span style="color: teal;">;</span><br />
byte rightIRPin<span style="color: teal;">;</span><br />
byte upIRPin<span style="color: teal;">;</span><br />
byte downIRPin<span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// IR values</span><br />
<span style="color: blue;">int</span> leftValueBG<span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> rightValueBG<span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> upValueBG<span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> downValueBG<span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">public</span><span style="color: teal;">:</span><br />
<br />
<span style="color: blue;">int</span> leftValue<span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> rightValue<span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> upValue<span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> downValue<span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">int</span> distance<span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// from 0 - 1000, the larger the closer</span><br />
<br />
<span style="color: blue;">public</span><span style="color: teal;">:</span><br />
<br />
IRSensor<span style="color: green;">(</span>byte _irLEDPin, byte _leftIRPin, byte _rightIRPin, byte _upIRPin, byte _downIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">void</span> ReadIR<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><span style="color: teal;">;</span></td></tr>
</tbody></table>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
</div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">IR Sensor cpp file:</span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><div>
<br /></div>
/*<br />
<br />
Oscar's project<br />
<br />
IR 4 position sensor<br />
<br />
this library is used to control a 4 position (up down left right) IR sensor,<br />
which contains both emitters and detectors.<br />
<br />
*/<br />
<br />
<span style="color: #339900;">#include "IRSensor.h"</span><br />
<br />
IRSensor<span style="color: teal;">::</span><span style="color: #007788;">IRSensor</span><span style="color: green;">(</span>byte _irLEDPin, byte _leftIRPin, byte _rightIRPin, byte _upIRPin, byte _downIRPin<span style="color: green;">)</span> <span style="color: green;">{</span><br />
<br />
<span style="color: #666666; font-style: normal;">// setup all parameters</span><br />
<br />
irLEDPin <span style="color: navy;">=</span> _irLEDPin<span style="color: teal;">;</span><br />
leftIRPin <span style="color: navy;">=</span> _leftIRPin<span style="color: teal;">;</span><br />
rightIRPin <span style="color: navy;">=</span> _rightIRPin<span style="color: teal;">;</span><br />
upIRPin <span style="color: navy;">=</span> _upIRPin<span style="color: teal;">;</span><br />
downIRPin <span style="color: navy;">=</span> _downIRPin<span style="color: teal;">;</span><br />
<br />
calON_LEDPin <span style="color: navy;">=</span> <span style="color: #0000dd;">13</span><span style="color: teal;">;</span><br />
calOFF_LEDPin <span style="color: navy;">=</span> <span style="color: #0000dd;">12</span><span style="color: teal;">;</span><br />
<br />
pinMode<span style="color: green;">(</span>irLEDPin, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>calON_LEDPin, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>calOFF_LEDPin, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> IRSensor<span style="color: teal;">::</span><span style="color: #007788;">ReadIR</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
digitalWrite<span style="color: green;">(</span>irLEDPin, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">10</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// total values</span><br />
leftValue <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>leftIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
rightValue <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>rightIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
upValue <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>upIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
downValue <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>downIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
digitalWrite<span style="color: green;">(</span>irLEDPin, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">10</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
leftValueBG <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>leftIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
rightValueBG <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>rightIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
upValueBG <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>upIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
downValueBG <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>downIRPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
leftValue <span style="color: navy;">=</span> leftValue <span style="color: #000040;">-</span> leftValueBG<span style="color: teal;">;</span><br />
rightValue <span style="color: navy;">=</span> rightValue <span style="color: #000040;">-</span> rightValueBG<span style="color: teal;">;</span><br />
upValue <span style="color: navy;">=</span> upValue <span style="color: #000040;">-</span> upValueBG<span style="color: teal;">;</span><br />
downValue <span style="color: navy;">=</span> downValue <span style="color: #000040;">-</span> downValueBG<span style="color: teal;">;</span><br />
<br />
distance <span style="color: navy;">=</span> <span style="color: green;">(</span>leftValue <span style="color: #000040;">+</span> rightValue <span style="color: #000040;">+</span> upValue <span style="color: #000040;">+</span>downValue<span style="color: green;">)</span><span style="color: #000040;">/</span><span style="color: #0000dd;">4</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span></td></tr>
</tbody></table>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">Motor Control h file : </span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><span style="color: red; font-style: normal;"><br />
/*<br /><br />
Oscar's project<br /><br />
Motor Driver control Library<br /><br />
This is used to simply motor operation,<br />
so easy commands such as 'forward, turn right' etc<br />
can be used to instruct robot what to do<br /><br />
12/12/2011<br />
added basic instructions (directions), with duration as inputs<br /><br />
*/</span><br />
<br />
<span style="color: #339900;">#ifndef WPROGRAM_H</span><br />
<span style="color: #339900;">#define WPROGRAM_H</span><br />
<span style="color: #339900;">#include "WProgram.h" //standard types and constants of the Arduino language</span><br />
<span style="color: #339900;">#endif</span><br />
<br />
<span style="color: blue;">class</span> MotorControl <span style="color: green;">{</span><br />
<br />
<span style="color: blue;">private</span><span style="color: teal;">:</span><br />
byte lcPin1<span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// 1A</span><br />
byte lcPin2<span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// 2A</span><br />
byte rcPin1<span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// 4A</span><br />
byte rcPin2<span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// 3A</span><br />
<br />
<span style="color: blue;">public</span><span style="color: teal;">:</span><br />
MotorControl<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
MotorControl<span style="color: green;">(</span>byte _lcPin1, byte _lcPin2, byte _rcPin1, byte _rcPin2<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">void</span> Forward<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">void</span> Forward<span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">void</span> Backward<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">void</span> Backward<span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">void</span> TurnLeft<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">void</span> TurnLeft<span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">void</span> TurnRight<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">void</span> TurnRight<span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">void</span> TurnLeftDish<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">void</span> TurnLeftDish<span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">void</span> TurnRightDish<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">void</span> TurnRightDish<span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">void</span> Stop<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">void</span> Brake<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<br />
<span style="color: green;">}</span><span style="color: teal;">;</span></td></tr>
</tbody></table>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
</div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Motor Control cpp file : </span></span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
<span style="color: #339900;">#include "MotorControl.h"</span><br />
<br />
MotorControl<span style="color: teal;">::</span><span style="color: #007788;">MotorControl</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
lcPin1 <span style="color: navy;">=</span> <span style="color: #0000dd;">2</span><span style="color: teal;">;</span><br />
lcPin2 <span style="color: navy;">=</span> <span style="color: #0000dd;">3</span><span style="color: teal;">;</span><br />
rcPin1 <span style="color: navy;">=</span> <span style="color: #0000dd;">4</span><span style="color: teal;">;</span><br />
rcPin2 <span style="color: navy;">=</span> <span style="color: #0000dd;">5</span><span style="color: teal;">;</span><br />
<br />
pinMode<span style="color: green;">(</span>lcPin1, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>lcPin2, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>rcPin1, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>rcPin2, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
MotorControl<span style="color: teal;">::</span><span style="color: #007788;">MotorControl</span><span style="color: green;">(</span>byte _lcPin1, byte _lcPin2, byte _rcPin1, byte _rcPin2<span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
lcPin1 <span style="color: navy;">=</span> _lcPin1<span style="color: teal;">;</span><br />
lcPin2 <span style="color: navy;">=</span> _lcPin2<span style="color: teal;">;</span> <br />
rcPin1 <span style="color: navy;">=</span> _rcPin1<span style="color: teal;">;</span><br />
rcPin2 <span style="color: navy;">=</span> _rcPin2<span style="color: teal;">;</span><br />
<br />
pinMode<span style="color: green;">(</span>lcPin1, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>lcPin2, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>rcPin1, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>rcPin2, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">Forward</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">Forward</span><span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span>duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
Stop<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">Backward</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">Backward</span><span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span>duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
Stop<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">TurnLeft</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">TurnLeft</span><span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span>duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
Stop<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">TurnRight</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">TurnRight</span><span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span>duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
Stop<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">TurnLeftDish</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">TurnLeftDish</span><span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span>duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
Stop<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">TurnRightDish</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">TurnRightDish</span><span style="color: green;">(</span><span style="color: blue;">int</span> duration<span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span>duration<span style="color: green;">)</span><span style="color: teal;">;</span><br />
Stop<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">Stop</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> MotorControl<span style="color: teal;">::</span><span style="color: #007788;">Brake</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
digitalWrite<span style="color: green;">(</span>lcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>lcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>rcPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">100</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
Stop<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
</td></tr>
</tbody></table>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
</div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;">Main Program: </span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><br />
<br />
<span style="color: red; font-style: normal;">/*<br /><br />
Oscar's IR Robot V2<br />
18 Dec 2011<br /><br />
This is an open source project<br />
feel free to modify and distribute<br /><br />
*/</span><br />
<br />
<span style="color: #339900;">#ifndef SERVO_H</span><br />
<span style="color: #339900;">#define SERVO_H</span><br />
<span style="color: #339900;">#include <Servo.h> </span><br />
<span style="color: #339900;">#endif</span><br />
<br />
<span style="color: #339900;">#include "IRSensor.h"</span><br />
<span style="color: #339900;">#include "MotorControl.h"</span><br />
<br />
IRSensor sensor<span style="color: green;">(</span><span style="color: #0000dd;">8</span>,A0,A1,A2,A3<span style="color: green;">)</span><span style="color: teal;">;</span><br />
MotorControl motors<span style="color: green;">(</span><span style="color: #0000dd;">4</span>,<span style="color: #0000dd;">5</span>,<span style="color: #0000dd;">6</span>,<span style="color: #0000dd;">7</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// modes</span><br />
<span style="color: blue;">enum</span> ModeType <span style="color: green;">{</span> FOLLOWOBJECT, AVOIDOBJECT <span style="color: green;">}</span><span style="color: teal;">;</span><br />
<span style="color: blue;">enum</span> ModeType mode <span style="color: navy;">=</span> FOLLOWOBJECT<span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// Servos</span><br />
Servo lrServo<span style="color: teal;">;</span><br />
Servo udServo<span style="color: teal;">;</span><br />
<br />
byte lrServirLEDPin <span style="color: navy;">=</span> <span style="color: #0000dd;">2</span><span style="color: teal;">;</span><br />
byte udServirLEDPin <span style="color: navy;">=</span> <span style="color: #0000dd;">3</span><span style="color: teal;">;</span><br />
<br />
byte followLEDPin <span style="color: navy;">=</span> <span style="color: #0000dd;">13</span><span style="color: teal;">;</span><br />
byte avoidLEDPin <span style="color: navy;">=</span> <span style="color: #0000dd;">12</span><span style="color: teal;">;</span><br />
byte modePin <span style="color: navy;">=</span> <span style="color: #0000dd;">11</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">int</span> lrServoPos <span style="color: navy;">=</span> <span style="color: #0000dd;">1500</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> udServoPos <span style="color: navy;">=</span> <span style="color: #0000dd;">1200</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">int</span> lrServoPosMin <span style="color: navy;">=</span> <span style="color: #0000dd;">600</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> udServoPosMin <span style="color: navy;">=</span> <span style="color: #0000dd;">600</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">int</span> lrServoPosMax <span style="color: navy;">=</span> <span style="color: #0000dd;">2400</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> udServoPosMax <span style="color: navy;">=</span> <span style="color: #0000dd;">1800</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">int</span> lrServoPosMid <span style="color: navy;">=</span> <span style="color: green;">(</span>lrServoPosMin <span style="color: #000040;">+</span> lrServoPosMax<span style="color: green;">)</span> <span style="color: #000040;">/</span> <span style="color: #0000dd;">2</span><span style="color: teal;">;</span><br />
<span style="color: blue;">int</span> udServoPosMid <span style="color: navy;">=</span> <span style="color: green;">(</span>udServoPosMin <span style="color: #000040;">+</span> udServoPosMax<span style="color: green;">)</span> <span style="color: #000040;">/</span> <span style="color: #0000dd;">2</span><span style="color: teal;">;</span><br />
<br />
boolean assending <span style="color: navy;">=</span> <span style="color: blue;">true</span><span style="color: teal;">;</span><br />
<br />
<br />
<span style="color: #666666; font-style: normal;">// ============ Performance Parameters ============</span><br />
<br />
<span style="color: blue;">const</span> <span style="color: blue;">int</span> distanceMin <span style="color: navy;">=</span> <span style="color: #0000dd;">230</span><span style="color: teal;">;</span><br />
<span style="color: blue;">const</span> <span style="color: blue;">int</span> servoAdjust <span style="color: navy;">=</span> <span style="color: #0000dd;">25</span><span style="color: teal;">;</span><br />
<span style="color: blue;">const</span> <span style="color: blue;">int</span> minDif <span style="color: navy;">=</span> <span style="color: #0000dd;">30</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">const</span> <span style="color: blue;">int</span> distanceClosest <span style="color: navy;">=</span> <span style="color: #0000dd;">650</span><span style="color: teal;">;</span><br />
<span style="color: blue;">const</span> <span style="color: blue;">int</span> distanceFurthest <span style="color: navy;">=</span> <span style="color: #0000dd;">450</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// ============= End Of Parameters ============</span><br />
<br />
<span style="color: blue;">void</span> setup<span style="color: green;">(</span><span style="color: green;">)</span><br />
<span style="color: green;">{</span><br />
<br />
pinMode<span style="color: green;">(</span>followLEDPin, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>avoidLEDPin,OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
pinMode<span style="color: green;">(</span>modePin, INPUT<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
lrServo.<span style="color: #007788;">attach</span><span style="color: green;">(</span>lrServirLEDPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
udServo.<span style="color: #007788;">attach</span><span style="color: green;">(</span>udServirLEDPin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
lrServo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>lrServoPosMid<span style="color: green;">)</span><span style="color: teal;">;</span><br />
udServo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>udServoPosMid<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">1000</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">//Serial.begin(9600);</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> loop<span style="color: green;">(</span><span style="color: green;">)</span><br />
<span style="color: green;">{</span><br />
<span style="color: blue;">int</span> modeTemp <span style="color: navy;">=</span> digitalRead<span style="color: green;">(</span>modePin<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>modeTemp <span style="color: navy;">==</span> HIGH<span style="color: green;">)</span><span style="color: green;">{</span><br />
mode <span style="color: navy;">=</span> AVOIDOBJECT<span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>avoidLEDPin, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>followLEDPin, LOW<span style="color: green;">)</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// indicate operation</span><br />
<span style="color: green;">}</span><br />
<span style="color: blue;">else</span> <span style="color: green;">{</span><br />
mode <span style="color: navy;">=</span> FOLLOWOBJECT<span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>avoidLEDPin, LOW<span style="color: green;">)</span><span style="color: teal;">;</span><br />
digitalWrite<span style="color: green;">(</span>followLEDPin, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// indicate operation</span><br />
<span style="color: green;">}</span><br />
<br />
<br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>mode <span style="color: navy;">==</span> FOLLOWOBJECT<span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
FollowObject<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: #666666; font-style: normal;">//Serial.print(sensor.distance,DEC);</span><br />
<span style="color: #666666; font-style: normal;">//Serial.print(lrServoPos,DEC);</span><br />
<span style="color: #666666; font-style: normal;">//Serial.println(udServoPos, DEC);</span><br />
<br />
<span style="color: #666666; font-style: normal;">// ========= turn body if head turns too much =====</span><br />
<br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>lrServoPos <span style="color: navy;"><</span> <span style="color: #0000dd;">1100</span><span style="color: green;">)</span> motors.<span style="color: #007788;">TurnLeftDish</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span>lrServoPos <span style="color: navy;">></span> <span style="color: #0000dd;">1900</span><span style="color: green;">)</span> motors.<span style="color: #007788;">TurnRightDish</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// ========= go forward or backward depends on =====</span><br />
<br />
<span style="color: blue;">else</span> <span style="color: green;">{</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>sensor.<span style="color: #007788;">distance</span> <span style="color: navy;">></span> distanceClosest<span style="color: green;">)</span><br />
motors.<span style="color: #007788;">Backward</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>sensor.<span style="color: #007788;">distance</span> <span style="color: navy;"><</span> distanceFurthest<span style="color: green;">)</span> <span style="color: #000040;">&&</span> <span style="color: green;">(</span>sensor.<span style="color: #007788;">distance</span> <span style="color: navy;">></span> distanceFurthest<span style="color: #000040;">*</span><span style="color: purple;">0.6</span><span style="color: green;">)</span><span style="color: green;">)</span><br />
motors.<span style="color: #007788;">Forward</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">else</span><br />
motors.<span style="color: #007788;">Stop</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span>mode <span style="color: navy;">==</span> AVOIDOBJECT<span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
AvoidObject<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: #666666; font-style: normal;">// =============== Object tracking ==============</span><br />
<span style="color: #666666; font-style: normal;">// ==============================================</span><br />
<br />
<span style="color: blue;">void</span> FollowObject<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
sensor.<span style="color: #007788;">ReadIR</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// when Object is detected</span><br />
<br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>sensor.<span style="color: #007788;">distance</span> <span style="color: navy;">></span> distanceMin<span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
<span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>sensor.<span style="color: #007788;">rightValue</span> <span style="color: #000040;">-</span> sensor.<span style="color: #007788;">leftValue</span><span style="color: green;">)</span> <span style="color: navy;">></span> minDif<span style="color: green;">)</span><br />
lrServoPos <span style="color: navy;">=</span> lrServoPos <span style="color: #000040;">-</span> servoAdjust <span style="color: teal;">;</span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>sensor.<span style="color: #007788;">leftValue</span> <span style="color: #000040;">-</span> sensor.<span style="color: #007788;">rightValue</span><span style="color: green;">)</span> <span style="color: navy;">></span> minDif<span style="color: green;">)</span><br />
lrServoPos <span style="color: navy;">=</span> lrServoPos <span style="color: #000040;">+</span> servoAdjust <span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>sensor.<span style="color: #007788;">upValue</span> <span style="color: #000040;">-</span> sensor.<span style="color: #007788;">downValue</span><span style="color: green;">)</span> <span style="color: navy;">></span> minDif<span style="color: green;">)</span><br />
udServoPos <span style="color: navy;">=</span> udServoPos <span style="color: #000040;">+</span> servoAdjust <span style="color: teal;">;</span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>sensor.<span style="color: #007788;">downValue</span> <span style="color: #000040;">-</span> sensor.<span style="color: #007788;">upValue</span><span style="color: green;">)</span> <span style="color: navy;">></span> minDif<span style="color: green;">)</span><br />
udServoPos <span style="color: navy;">=</span> udServoPos <span style="color: #000040;">-</span> servoAdjust <span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: #666666; font-style: normal;">// when Object is NOT detected</span><br />
<br />
<span style="color: blue;">else</span> <span style="color: green;">{</span><br />
<br />
<span style="color: #666666; font-style: normal;">// horizontal servo move toward centre</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>lrServoPos <span style="color: navy;"><</span> lrServoPosMid <span style="color: #000040;">-</span> <span style="color: #0000dd;">100</span><span style="color: green;">)</span> lrServoPos <span style="color: #000040;">+</span><span style="color: navy;">=</span> servoAdjust<span style="color: teal;">;</span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span>lrServoPos <span style="color: navy;">></span> lrServoPosMid<span style="color: #000040;">+</span><span style="color: #0000dd;">100</span><span style="color: green;">)</span> lrServoPos <span style="color: #000040;">-</span><span style="color: navy;">=</span> servoAdjust<span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// vertical servo move toward centre</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>udServoPos <span style="color: navy;"><</span> udServoPosMid <span style="color: #000040;">-</span> <span style="color: #0000dd;">100</span><span style="color: green;">)</span> udServoPos <span style="color: #000040;">+</span><span style="color: navy;">=</span> servoAdjust<span style="color: teal;">;</span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span> udServoPos <span style="color: navy;">></span> udServoPosMid<span style="color: #000040;">+</span><span style="color: #0000dd;">100</span><span style="color: green;">)</span> udServoPos <span style="color: #000040;">-</span><span style="color: navy;">=</span> servoAdjust<span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
lrServoPos <span style="color: navy;">=</span> constrain<span style="color: green;">(</span>lrServoPos,<span style="color: #0000dd;">600</span>,<span style="color: #0000dd;">2300</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
udServoPos <span style="color: navy;">=</span> constrain<span style="color: green;">(</span>udServoPos,<span style="color: #0000dd;">600</span>,<span style="color: #0000dd;">2300</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
lrServo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>lrServoPos<span style="color: green;">)</span><span style="color: teal;">;</span><br />
udServo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>udServoPos<span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">20</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: #666666; font-style: normal;">// =============== Object Avoiding ==============</span><br />
<span style="color: #666666; font-style: normal;">// ==============================================</span><br />
<br />
<span style="color: blue;">void</span> AvoidObject<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
boolean detectedLeft <span style="color: navy;">=</span> <span style="color: blue;">false</span><span style="color: teal;">;</span><br />
boolean detectedRight <span style="color: navy;">=</span> <span style="color: blue;">false</span><span style="color: teal;">;</span><br />
<br />
sensor.<span style="color: #007788;">ReadIR</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// object not detected</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>sensor.<span style="color: #007788;">distance</span> <span style="color: navy;"><</span> distanceMin<span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
motors.<span style="color: #007788;">Forward</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: #666666; font-style: normal;">// object detected</span><br />
<span style="color: blue;">else</span> <span style="color: green;">{</span><br />
<br />
<span style="color: #666666; font-style: normal;">// check where the obstacle is</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>sensor.<span style="color: #007788;">leftValue</span> <span style="color: #000040;">-</span> sensor.<span style="color: #007788;">rightValue</span> <span style="color: navy;">></span> <span style="color: #0000dd;">50</span><span style="color: green;">)</span><br />
motors.<span style="color: #007788;">TurnLeftDish</span><span style="color: green;">(</span><span style="color: #0000dd;">700</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span>sensor.<span style="color: #007788;">leftValue</span> <span style="color: #000040;">-</span> sensor.<span style="color: #007788;">rightValue</span> <span style="color: navy;"><</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">50</span><span style="color: green;">)</span><br />
motors.<span style="color: #007788;">TurnRightDish</span><span style="color: green;">(</span><span style="color: #0000dd;">700</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// if it's too large</span><br />
<span style="color: blue;">else</span> <span style="color: green;">{</span><br />
<br />
motors.<span style="color: #007788;">Stop</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// stop movement to allow analysis</span><br />
<br />
<span style="color: #666666; font-style: normal;">// look around, analyse location of obstacles</span><br />
<br />
<span style="color: #666666; font-style: normal;">// check right side</span><br />
TurnHead<span style="color: green;">(</span>lrServo, <span style="color: #0000dd;">1000</span>, <span style="color: #0000dd;">0</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
sensor.<span style="color: #007788;">ReadIR</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>sensor.<span style="color: #007788;">distance</span> <span style="color: navy;">></span> distanceMin<span style="color: green;">)</span> detectedRight <span style="color: navy;">=</span> <span style="color: blue;">true</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// check left side</span><br />
TurnHead<span style="color: green;">(</span>lrServo, <span style="color: #0000dd;">2000</span>, <span style="color: #0000dd;">0</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
sensor.<span style="color: #007788;">ReadIR</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>sensor.<span style="color: #007788;">distance</span> <span style="color: navy;">></span> distanceMin<span style="color: green;">)</span> detectedLeft <span style="color: navy;">=</span> <span style="color: blue;">true</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// reset head position</span><br />
TurnHead<span style="color: green;">(</span>lrServo, <span style="color: #0000dd;">1500</span>, <span style="color: #0000dd;">0</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: #666666; font-style: normal;">// if obstacle is too big, back off and turn around</span><br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>detectedLeft <span style="color: #000040;">&&</span> detectedRight<span style="color: green;">)</span><span style="color: green;">{</span><br />
motors.<span style="color: #007788;">Backward</span><span style="color: green;">(</span><span style="color: #0000dd;">500</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
motors.<span style="color: #007788;">TurnRightDish</span><span style="color: green;">(</span><span style="color: #0000dd;">3000</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: #666666; font-style: normal;">// if obstacle is mainly on the left, turn a big right </span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span>detectedLeft <span style="color: navy;">==</span> <span style="color: blue;">true</span> <span style="color: #000040;">&&</span> detectedRight <span style="color: navy;">==</span> <span style="color: blue;">false</span><span style="color: green;">)</span><br />
motors.<span style="color: #007788;">TurnLeftDish</span><span style="color: green;">(</span><span style="color: #0000dd;">1400</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: #666666; font-style: normal;">// if it's mainly on the right, turn a big left</span><br />
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span>detectedLeft <span style="color: navy;">==</span> <span style="color: blue;">false</span> <span style="color: #000040;">&&</span> detectedRight <span style="color: navy;">==</span> <span style="color: blue;">true</span><span style="color: green;">)</span><br />
motors.<span style="color: #007788;">TurnRightDish</span><span style="color: green;">(</span><span style="color: #0000dd;">1400</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: #666666; font-style: normal;">// if it's not at either side, will just turn left a little</span><br />
<span style="color: blue;">else</span><br />
motors.<span style="color: #007788;">TurnLeftDish</span><span style="color: green;">(</span><span style="color: #0000dd;">500</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<span style="color: green;">}</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: blue;">void</span> TurnHead<span style="color: green;">(</span>Servo <span style="color: #000040;">&</span>servo, <span style="color: blue;">int</span> X, <span style="color: blue;">int</span> Y<span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
<span style="color: blue;">int</span> temp <span style="color: navy;">=</span> servo.<span style="color: #007788;">read</span><span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
temp <span style="color: navy;">=</span> map<span style="color: green;">(</span>temp, <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">180</span>, <span style="color: #0000dd;">600</span>, <span style="color: #0000dd;">2400</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<br />
<span style="color: blue;">if</span> <span style="color: green;">(</span>temp <span style="color: navy;">></span> X<span style="color: green;">)</span><span style="color: green;">{</span><br />
<br />
<span style="color: blue;">for</span> <span style="color: green;">(</span>temp<span style="color: teal;">;</span> temp<span style="color: navy;">></span>X<span style="color: teal;">;</span> temp<span style="color: navy;">=</span>temp<span style="color: #000040;">-</span><span style="color: #0000dd;">30</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
servo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>temp<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">30</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: green;">}</span><br />
<span style="color: blue;">else</span> <span style="color: green;">{</span><br />
<br />
<span style="color: blue;">for</span> <span style="color: green;">(</span>temp<span style="color: teal;">;</span> temp<span style="color: navy;"><</span>X<span style="color: teal;">;</span> temp<span style="color: navy;">=</span>temp<span style="color: #000040;">+</span><span style="color: #0000dd;">30</span><span style="color: green;">)</span><span style="color: green;">{</span><br />
servo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>temp<span style="color: green;">)</span><span style="color: teal;">;</span><br />
delay<span style="color: green;">(</span><span style="color: #0000dd;">20</span><span style="color: green;">)</span><span style="color: teal;">;</span><br />
<span style="color: green;">}</span><br />
<br />
<span style="color: green;">}</span><br />
<br />
<span style="color: green;">}</span></td></tr>
</tbody></table>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
</div>
</div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
</div>
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-76799676617822675592011-12-16T02:06:00.000+00:002012-10-02T12:37:36.719+01:00"Wally" -- IR Detection Robot V1<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">I will update the functionality of this robot, and upload some videos.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">16/12/2011</span><br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Object following:</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">bad points:</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">1. head needs to be rebuild with better material for more smooth performance.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">2. coding needs improvement.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/zGvquJCmijM?feature=player_embedded' frameborder='0'></iframe></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"></span><br />
<a name='more'></a></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">update: </span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">18/12/2011 </span><br />
<span style="font-family: Arial;">I have improved this robot and details are here: </span><br />
<a href="http://arduin0.blogspot.com/2011/12/ir-detection-robot-enhanced-version-v2.html">http://arduin0.blogspot.com/2011/12/ir-detection-robot-enhanced-version-v2.html</a>
<br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">today I simply assembled all the parts I built previously. the Main thing I did was on the coding.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">the Parts can be found here:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><a href="http://arduin0.blogspot.com/2011/12/what-does-it-do-it-will-take-external.html">Motor Driver</a></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><a href="http://arduin0.blogspot.com/2011/12/building-2-dimensional-moving-servo-for.html">Servo Head</a></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><a href="http://arduin0.blogspot.com/2011/12/lets-have-look-at-result-check-our-my.html">IR detector</a></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Before I put them together, I first made a base with a recycled CD.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9PKqc2JzvuNfZkChYli8dPTkButcw1O7Rt_3k0h970LthBAUIeIUoQmtwfED3I5o_fbqKUsQIgyejjiCZCXsHuo4GI9dI9ztgSbmSeUdxLOhuK1XUgd2Hyk1xkUmagS5LrrwkDuhl7TM/s1600/151220111297.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9PKqc2JzvuNfZkChYli8dPTkButcw1O7Rt_3k0h970LthBAUIeIUoQmtwfED3I5o_fbqKUsQIgyejjiCZCXsHuo4GI9dI9ztgSbmSeUdxLOhuK1XUgd2Hyk1xkUmagS5LrrwkDuhl7TM/s320/151220111297.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpaj2jKdby7HRXYRqz6VK0FwZ7hvJ4aE_5yTRfa2_NSFE1Jd4V_C_2gf-AGZGePIVKUgfoeOjdY9sZYHmlm1Y8hvMo82nqyp2ZeVVgOx4snj5n8Kt3V3excyYIe0Ma430bnxs4obJzwD4/s1600/151220111298.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpaj2jKdby7HRXYRqz6VK0FwZ7hvJ4aE_5yTRfa2_NSFE1Jd4V_C_2gf-AGZGePIVKUgfoeOjdY9sZYHmlm1Y8hvMo82nqyp2ZeVVgOx4snj5n8Kt3V3excyYIe0Ma430bnxs4obJzwD4/s320/151220111298.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilqbUcoqpRehJU2OT-o8p0h457jLobp1uSj5P9AzrR-Karu0MzlprFqOoMwUJYHHaOBKYku3WVY3pAF_8WlXnJ7uH4IyfPmd0XehqdrAC7sbXbWm8DJlaujM0JmY3BeA0kxOnMGR4A8FA/s1600/151220111300.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilqbUcoqpRehJU2OT-o8p0h457jLobp1uSj5P9AzrR-Karu0MzlprFqOoMwUJYHHaOBKYku3WVY3pAF_8WlXnJ7uH4IyfPmd0XehqdrAC7sbXbWm8DJlaujM0JmY3BeA0kxOnMGR4A8FA/s320/151220111300.jpg" width="320" /></a></div>
<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj16qfdofU_gjjO3YVgcFVJZnJB2c2l7fhlSDkUdH-yZtDqD8iQGqpaLM7WbZbXnSYCgug80dN14hgoEUq28E4scA_A9N1dV6FW1LlwyKJQzLtPWYMfxvUNS7aAVSUl-_a2FOHV13jdq08/s1600/IMAG0282.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj16qfdofU_gjjO3YVgcFVJZnJB2c2l7fhlSDkUdH-yZtDqD8iQGqpaLM7WbZbXnSYCgug80dN14hgoEUq28E4scA_A9N1dV6FW1LlwyKJQzLtPWYMfxvUNS7aAVSUl-_a2FOHV13jdq08/s640/IMAG0282.jpg" width="379" /></a></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">So this is the final result:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyu83rh9q53MOMB9CH3cEI0MNIntvk_98w5yxUIXlBdUjGdoNQrIHKk7_qmMMOUCtJHF2_eYqLRVWpZ_RJpidEVXFe-l4KXhtirVf0XEyUMyvcmUFPMSG9UVQTzVv1K1NKkjae4Gfi8lw/s1600/161220111301.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyu83rh9q53MOMB9CH3cEI0MNIntvk_98w5yxUIXlBdUjGdoNQrIHKk7_qmMMOUCtJHF2_eYqLRVWpZ_RJpidEVXFe-l4KXhtirVf0XEyUMyvcmUFPMSG9UVQTzVv1K1NKkjae4Gfi8lw/s320/161220111301.jpg" width="320" /></a></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjspU2Z4vLhMP1epRK2OiFie0jntlttUZOoj8lVD04IPHgIczU8MY05toKeMacd9CTwA1H6GZL10b3oWV9yKtC4cCyXbMK2zNkFkyql87I7Sfv8fYmdJyrNMc25eVS7ycafu52vm0geTpE/s1600/161220111303.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjspU2Z4vLhMP1epRK2OiFie0jntlttUZOoj8lVD04IPHgIczU8MY05toKeMacd9CTwA1H6GZL10b3oWV9yKtC4cCyXbMK2zNkFkyql87I7Sfv8fYmdJyrNMc25eVS7ycafu52vm0geTpE/s320/161220111303.jpg" width="320" /></a></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Here is my code:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><ol>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: #339900;">#include <Servo.h></span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: #666666; font-style: normal;">// Pins</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
byte leftIRPin <span style="color: navy;">=</span> A0<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
byte rightIRPin <span style="color: navy;">=</span> A1<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
byte upIRPin <span style="color: navy;">=</span> A2<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
byte downIRPin <span style="color: navy;">=</span> A3<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
byte lrServoPin <span style="color: navy;">=</span> <span style="color: #0000dd;">2</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
byte udServoPin <span style="color: navy;">=</span> <span style="color: #0000dd;">3</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
byte motorPin1 <span style="color: navy;">=</span> <span style="color: #0000dd;">4</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
byte motorPin2 <span style="color: navy;">=</span> <span style="color: #0000dd;">5</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
byte motorPin3 <span style="color: navy;">=</span> <span style="color: #0000dd;">6</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
byte motorPin4 <span style="color: navy;">=</span> <span style="color: #0000dd;">7</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
byte irLEDPin <span style="color: navy;">=</span> <span style="color: #0000dd;">8</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: #666666; font-style: normal;">// Servos</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
Servo lrServo<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
Servo udServo<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> lrServoPos <span style="color: navy;">=</span> <span style="color: #0000dd;">1500</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> udServoPos <span style="color: navy;">=</span> <span style="color: #0000dd;">1500</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: #666666; font-style: normal;">//IR values</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> leftValue_amb<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> rightValue_amb<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> upValue_amb<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> downValue_amb<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> leftValue<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> rightValue<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> upValue<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> downValue<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> distance<span style="color: teal;">;</span> <span style="color: #666666; font-style: normal;">// from 0 - 1000, the larger the closer</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> minDistance <span style="color: navy;">=</span> <span style="color: #0000dd;">165</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> servoAdjust <span style="color: navy;">=</span> <span style="color: #0000dd;">25</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">int</span> minDif <span style="color: navy;">=</span> <span style="color: #0000dd;">30</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">void</span> ReadIR<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: green;">{</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>irLEDPin, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
delay<span style="color: green;">(</span><span style="color: #0000dd;">15</span><span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: #666666; font-style: normal;">// total values</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
leftValue <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>leftIRPin<span style="color: green;">)</span><span style="color: teal;">;</span> </div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
rightValue <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>rightIRPin<span style="color: green;">)</span><span style="color: teal;">;</span> </div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
upValue <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>upIRPin<span style="color: green;">)</span><span style="color: teal;">;</span> </div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
downValue <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>downIRPin<span style="color: green;">)</span><span style="color: teal;">;</span> </div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>irLEDPin, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
delay<span style="color: green;">(</span><span style="color: #0000dd;">15</span><span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
leftValue_amb <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>leftIRPin<span style="color: green;">)</span><span style="color: teal;">;</span> </div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
rightValue_amb <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>rightIRPin<span style="color: green;">)</span><span style="color: teal;">;</span> </div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
upValue_amb <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>upIRPin<span style="color: green;">)</span><span style="color: teal;">;</span> </div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
downValue_amb <span style="color: navy;">=</span> analogRead<span style="color: green;">(</span>downIRPin<span style="color: green;">)</span><span style="color: teal;">;</span> </div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
leftValue <span style="color: navy;">=</span> leftValue <span style="color: #000040;">-</span> leftValue_amb<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
rightValue <span style="color: navy;">=</span> rightValue <span style="color: #000040;">-</span> rightValue_amb<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
upValue <span style="color: navy;">=</span> upValue <span style="color: #000040;">-</span> upValue_amb<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
downValue <span style="color: navy;">=</span> downValue <span style="color: #000040;">-</span> downValue_amb<span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
distance <span style="color: navy;">=</span> <span style="color: green;">(</span>leftValue <span style="color: #000040;">+</span> rightValue <span style="color: #000040;">+</span> upValue <span style="color: #000040;">+</span>downValue<span style="color: green;">)</span><span style="color: #000040;">/</span><span style="color: #0000dd;">4</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: green;">}</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">void</span> setup<span style="color: green;">(</span><span style="color: green;">)</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: green;">{</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
pinMode<span style="color: green;">(</span>irLEDPin, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
pinMode<span style="color: green;">(</span>motorPin1, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
pinMode<span style="color: green;">(</span>motorPin2, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
pinMode<span style="color: green;">(</span>motorPin3, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
pinMode<span style="color: green;">(</span>motorPin4, OUTPUT<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
lrServo.<span style="color: #007788;">attach</span><span style="color: green;">(</span>lrServoPin<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
udServo.<span style="color: #007788;">attach</span><span style="color: green;">(</span>udServoPin<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
lrServo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>lrServoPos<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
udServo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>udServoPos<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: green;">}</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">void</span> loop<span style="color: green;">(</span><span style="color: green;">)</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: green;">{</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
ReadIR<span style="color: green;">(</span><span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: #666666; font-style: normal;">// =============== Track Object =================</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">if</span> <span style="color: green;">(</span>distance <span style="color: navy;">></span> minDistance<span style="color: green;">)</span><span style="color: green;">{</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>rightValue <span style="color: #000040;">-</span> leftValue<span style="color: green;">)</span> <span style="color: navy;">></span> minDif<span style="color: green;">)</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
lrServoPos <span style="color: navy;">=</span> lrServoPos <span style="color: #000040;">-</span> servoAdjust <span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>leftValue <span style="color: #000040;">-</span> rightValue<span style="color: green;">)</span> <span style="color: navy;">></span> minDif<span style="color: green;">)</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
lrServoPos <span style="color: navy;">=</span> lrServoPos <span style="color: #000040;">+</span> servoAdjust <span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>upValue <span style="color: #000040;">-</span> downValue<span style="color: green;">)</span> <span style="color: navy;">></span> minDif<span style="color: green;">)</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
udServoPos <span style="color: navy;">=</span> udServoPos <span style="color: #000040;">+</span> servoAdjust <span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span><span style="color: green;">(</span>downValue <span style="color: #000040;">-</span> upValue<span style="color: green;">)</span> <span style="color: navy;">></span> minDif<span style="color: green;">)</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
udServoPos <span style="color: navy;">=</span> udServoPos <span style="color: #000040;">-</span> servoAdjust <span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: green;">}</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;">/*</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> // =============== Track Object =================</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> int temp = leftValue - rightValue;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> if (distance > 70){</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> if (rightValue > leftValue)</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> lrServoPos = lrServoPos - (rightValue - leftValue)/5 ;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> else</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> lrServoPos = lrServoPos + (leftValue - rightValue)/5 ;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> if (upValue > downValue)</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> udServoPos = udServoPos + (upValue - downValue)/5 ;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> else</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> udServoPos = udServoPos - (downValue - upValue)/5 ;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;"> }</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: red; font-style: normal;">*/</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
lrServoPos <span style="color: navy;">=</span> constrain<span style="color: green;">(</span>lrServoPos,<span style="color: #0000dd;">600</span>,<span style="color: #0000dd;">2300</span><span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
udServoPos <span style="color: navy;">=</span> constrain<span style="color: green;">(</span>udServoPos,<span style="color: #0000dd;">600</span>,<span style="color: #0000dd;">2300</span><span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
lrServo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>lrServoPos<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
udServo.<span style="color: #007788;">writeMicroseconds</span><span style="color: green;">(</span>udServoPos<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: #666666; font-style: normal;">// =============== turn body =================</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">if</span> <span style="color: green;">(</span>lrServoPos <span style="color: navy;"><</span> <span style="color: #0000dd;">1100</span><span style="color: green;">)</span><span style="color: green;">{</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin2, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin3, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin4, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: green;">}</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">else</span> <span style="color: blue;">if</span> <span style="color: green;">(</span>lrServoPos <span style="color: navy;">></span> <span style="color: #0000dd;">1900</span><span style="color: green;">)</span><span style="color: green;">{</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin1, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin3, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin4, HIGH<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: green;">}</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: blue;">else</span><span style="color: green;">{</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin1, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin2, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin3, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
digitalWrite<span style="color: green;">(</span>motorPin4, LOW<span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000090; font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 11px; padding-bottom: 2px;"><div style="color: #000060;">
<span style="color: green;">}</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
delay<span style="color: green;">(</span><span style="color: #0000dd;">10</span><span style="color: green;">)</span><span style="color: teal;">;</span></div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
</div>
</li>
<li style="background-color: #e0e0e0; color: #000060; font-family: 'Courier New', Courier, monospace; padding-bottom: 2px;"><div style="color: #000060;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="color: green;">}</span></div>
</li>
</ol>
</td></tr>
</tbody></table>
</div>
Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-72691529601532321812011-12-15T01:58:00.000+00:002011-12-15T01:58:30.574+00:00Build your own IR detector<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Let's have a look at the result!</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/s27XALGnA34?feature=player_embedded' frameborder='0'></iframe></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span><br />
<a name='more'></a><br />
<span class="Apple-style-span" style="font-family: Arial;">Check our my last tutorial to see how it works (theory and example).</span><br />
<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">first of all, test all the components make sure they work!</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghh2fvu2WSurSgxWRAtM2Nkiehgi4TeTlcIGob2_kAP4oJ54Uk13mBuXVWE_C1OONd1wlZrOF1ycVNTwjsTHXzAjPLbakFSxXs3fkl_mfjkY08ZXAzTiqEqeSzbReVi10Ta3wGfYJqiFw/s1600/141220111290.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghh2fvu2WSurSgxWRAtM2Nkiehgi4TeTlcIGob2_kAP4oJ54Uk13mBuXVWE_C1OONd1wlZrOF1ycVNTwjsTHXzAjPLbakFSxXs3fkl_mfjkY08ZXAzTiqEqeSzbReVi10Ta3wGfYJqiFw/s320/141220111290.jpg" width="320" /></a></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Let's do some calculations, and design the circuit, Here is my Schematic:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwAS_2CKTWHHAYYy3tbPN_FfXCFixP-Ns8cxTGPS8vnlqH5oe0FqMw2BC13dFKMErrVgdaPdfSThRCaQDcWz6Y_Hy9DrJioGRsRgEQo8IQv5vYv8Fb-Y4iunl2KrEmbBw_Gd_mo22vVm4/s1600/071220111270.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwAS_2CKTWHHAYYy3tbPN_FfXCFixP-Ns8cxTGPS8vnlqH5oe0FqMw2BC13dFKMErrVgdaPdfSThRCaQDcWz6Y_Hy9DrJioGRsRgEQo8IQv5vYv8Fb-Y4iunl2KrEmbBw_Gd_mo22vVm4/s640/071220111270.jpg" width="640" /></a></div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span><br />
<span class="Apple-style-span" style="font-family: Arial;">build it on the strip board... This took me 3 hours!! but I am getting better at it ; ) i can tell.</span><br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">The whole thing costs me:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">8 x tcrt5000 = £3.4</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">1 x strip board = £1</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Terminals = £0.5</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">1 x BJT = £0.5</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Resistors and wires = £ 1</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>Total about £6.</b></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">When I finished and testing, realised R6 - R9 are too small, (voltage at the collectors of the phototransistors are too small), I decided to take the 4.7k resistors off and replaced with 22k. but it doesn't seem to improve a lot...</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">This is what I got at the end.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMfKyuZCZW0QsimEMQHcPi88Pc9UjO5pqWYKedvnqpjTAOpsBhdliRYDW51RGxzFXNY8w4udsC1jhI06xHGKmjb_-rK6BFXHlvQnwn0jELT9eR2lZYRDacNvrj7SY8uXbRGkoibmOyppU/s1600/151220111294.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMfKyuZCZW0QsimEMQHcPi88Pc9UjO5pqWYKedvnqpjTAOpsBhdliRYDW51RGxzFXNY8w4udsC1jhI06xHGKmjb_-rK6BFXHlvQnwn0jELT9eR2lZYRDacNvrj7SY8uXbRGkoibmOyppU/s400/151220111294.jpg" width="400" /></a></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaw1S_v78zvr6tMksibGwPsHW33GDjIEcQXHf9oPcpFQWY8V0B2HcmMae20oRn4MLRb3EPdzor4FXeq-mM05AiZr6Jl3zaE20V6Kux3H0spxHBw3uf5fR1yfLPWZy2WwyPtY7-Ahzn_wQ/s1600/151220111293.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaw1S_v78zvr6tMksibGwPsHW33GDjIEcQXHf9oPcpFQWY8V0B2HcmMae20oRn4MLRb3EPdzor4FXeq-mM05AiZr6Jl3zaE20V6Kux3H0spxHBw3uf5fR1yfLPWZy2WwyPtY7-Ahzn_wQ/s320/151220111293.jpg" width="320" /></a></div>
<div>
</div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">The range isn't as good as I expected, it's probably the size and ratings of the LEDs (3mm), however I have ordered some 5mm, and I will probably use more LEDs to try to improve it, but this is good enough to be used for obstacle avoiding.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-77131226130027731822011-12-14T00:30:00.000+00:002011-12-14T00:30:07.545+00:00IR detection and Photo Transistor Testing<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Example:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/NyUzLcdmnfc?feature=player_embedded' frameborder='0'></iframe></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">IR is invisible to human eyes. </span></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">There are two main frequency IR emitters are used: 850nm and 950nm. however for detector, the detectable range covers both frequencies.</span><br />
<span class="Apple-style-span" style="font-family: Arial;"><br /></span><br />
<span class="Apple-style-span" style="font-family: Arial;"></span><br />
<a name='more'></a><span class="Apple-style-span" style="font-family: Arial;"><br /></span><br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">As we can't see IR, one way to determine whether the IR LED is working is to digitalize the IR light, which means to look through a camera, you will be able to see blue light which you can't see without the camera.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuyckwLVCZArismQSykWqOlrXRFeTNGbUj7OSuOC26ZyiY8zTxRbnNx8ExXzl8i8B8DuffqRv0D6qHj59P4KZD_xIVu5nOUNudveuZpDu28vvTa86xLCraeK8kCbP1Hq7f8DChr7IhR0s/s1600/DSC00090.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuyckwLVCZArismQSykWqOlrXRFeTNGbUj7OSuOC26ZyiY8zTxRbnNx8ExXzl8i8B8DuffqRv0D6qHj59P4KZD_xIVu5nOUNudveuZpDu28vvTa86xLCraeK8kCbP1Hq7f8DChr7IhR0s/s320/DSC00090.jpg" width="320" /></a></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><u>Principle of IR detection:</u></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><u><br /></u></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">IR could be detected when a object is close to the detector, as the emitted IR are reflected back.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">But it depends strongly on the angle of the object to the detector. Also the strength of the light decays exponentially with distance, which imply IR detection could only be used in short range detection.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH6XaTPvXmPLX-C227kdnMRey7mAqO_yJLTA-3l8wXh9HaxkOWxQVUbLL621sX5YMCVR9Ci9bgp589iIcYfLD4sh03CcYIRFBlrjdaAW1ExR1KP81gO3N24dSyy5nnZvws_uOd095U2WU/s1600/121220111283.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH6XaTPvXmPLX-C227kdnMRey7mAqO_yJLTA-3l8wXh9HaxkOWxQVUbLL621sX5YMCVR9Ci9bgp589iIcYfLD4sh03CcYIRFBlrjdaAW1ExR1KP81gO3N24dSyy5nnZvws_uOd095U2WU/s320/121220111283.jpg" width="320" /></a></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisTM0A92IG6aNGvduXz2BNJudJvr6l2nwg-NRQbf9dY2vyRlsar5W7YtCTDLJJFAUseAw0WaDGiJ1TT7Mvr1JGIhSJ9iA8u-vrKNqZzsJdqZEdlHLKUDU_fsd3ymJcl0J_hmBEeiKfq_M/s1600/121220111284.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisTM0A92IG6aNGvduXz2BNJudJvr6l2nwg-NRQbf9dY2vyRlsar5W7YtCTDLJJFAUseAw0WaDGiJ1TT7Mvr1JGIhSJ9iA8u-vrKNqZzsJdqZEdlHLKUDU_fsd3ymJcl0J_hmBEeiKfq_M/s320/121220111284.jpg" width="320" /></a></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Another thing we need to take into account would be the ambient IR. in case of IR detection, we can consider it as noise, and we need to subtract it from our IR detection value to get the actual reflected IR value. (because the ambient IR varies as the robot moves)</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9bB4cC5yswIpQzOlAvwIcdfgQwiSkbVNuTkYJQKlbkrfR-bv2flCICmqKZiNcIc6-p8gF_qn1pRtuA_tju8O98ivqzY4c2tOAm_L1AT_xU5_scmskj0_Yk-vUOVwaCyE66PxAbtfjGWk/s1600/Phototransistor_amplifiers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9bB4cC5yswIpQzOlAvwIcdfgQwiSkbVNuTkYJQKlbkrfR-bv2flCICmqKZiNcIc6-p8gF_qn1pRtuA_tju8O98ivqzY4c2tOAm_L1AT_xU5_scmskj0_Yk-vUOVwaCyE66PxAbtfjGWk/s1600/Phototransistor_amplifiers.png" /></a></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><img src="file:///C:/Users/Oscar/AppData/Local/Temp/enhtmlclip/Phototransistor_amplifiers.png" style="cursor: default;" /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyyTHU7GRYxgq5WFOybN3w-6ezGSclnZxlx_7Ea513K0ss7K86jJ3f3OXkzXsmsLCPr8rupEKtPgc8YLTR7JkOYwkaxmyBmdDJiQL92Hic_9UIvT1P9EtxqgRKatP5KNZ5t-mQeLq9mXc/s1600/131220111287.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyyTHU7GRYxgq5WFOybN3w-6ezGSclnZxlx_7Ea513K0ss7K86jJ3f3OXkzXsmsLCPr8rupEKtPgc8YLTR7JkOYwkaxmyBmdDJiQL92Hic_9UIvT1P9EtxqgRKatP5KNZ5t-mQeLq9mXc/s320/131220111287.jpg" width="320" /></a></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3LToNcYbY_D062zMopKJjOuX7lCwZ2_3Xb6z2gQQjQyHqBhn3d9kfmzGuRqQ5t_7PI7zdVuwze6fGi0sqkTYD9qD-0SbggKJ9wmMXMkNXec-mP92m_vqrBM67X6Qj-KLtnHZrLNbVZO0/s1600/131220111288.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3LToNcYbY_D062zMopKJjOuX7lCwZ2_3Xb6z2gQQjQyHqBhn3d9kfmzGuRqQ5t_7PI7zdVuwze6fGi0sqkTYD9qD-0SbggKJ9wmMXMkNXec-mP92m_vqrBM67X6Qj-KLtnHZrLNbVZO0/s320/131220111288.jpg" width="320" /></a></span></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Times New Roman';"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfgqgtin3YrCJwCBs_HiVmhYTdduXinx2uvXsknkxOLOez801XqKLDZoLTPxHnNtaroArFtlBl1k40bWwh_pVfL_VAJFtk0rX7wk80rElVszmPhvcOu9yaFR_XXORL6NSAEzZyaX57VAQ/s1600/131220111286.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfgqgtin3YrCJwCBs_HiVmhYTdduXinx2uvXsknkxOLOez801XqKLDZoLTPxHnNtaroArFtlBl1k40bWwh_pVfL_VAJFtk0rX7wk80rElVszmPhvcOu9yaFR_XXORL6NSAEzZyaX57VAQ/s640/131220111286.jpg" width="640" /></a></span></span></div>
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-59684411709362417262011-12-09T23:30:00.001+00:002011-12-09T23:39:33.010+00:00Building a 2 dimensional moving Servo (for mounting Sensors on)Result:<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/XtLklGMlUyg?feature=player_embedded' frameborder='0'></iframe></div>
<div>
<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
This one hasn't got too much technical stuff involved, all the operations are from previous tutorials. The main things would be the turning head that I made purely from cardboard, and a couple of screws.</div>
<div>
<br /></div>
<div>
<a name='more'></a></div>
<div>
<br /></div>
<div>
I am such a environmentalist! i think it would be a better idea to use something more professional, as cardboard bring bigger frictions when it's turning, and that adds extra burden on the servo and thus less durable battery. But I am happy with what I have got here! ; )</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXQaka9ohsyxXQaLO89UNO4xjqt9Z2ambUF9QEiNqlSXvh1f28zCwgYil0OCp48I2l42f83thfzr8BvtAagL6ufpI1vUvjDERsgkvmZEu8D6krOqfjyFLwoSqTy0RsHz981YvqikvG1QA/s1600/091220111280.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXQaka9ohsyxXQaLO89UNO4xjqt9Z2ambUF9QEiNqlSXvh1f28zCwgYil0OCp48I2l42f83thfzr8BvtAagL6ufpI1vUvjDERsgkvmZEu8D6krOqfjyFLwoSqTy0RsHz981YvqikvG1QA/s400/091220111280.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
One server on X-axis (left right),the other on Yaxis (up down)</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYEYjTzLW1re1uqBy4y28bsEoRN6Wt-bblyVgVjhoQM_LGBeLpCc1bxMQIxYZDeBbIEjLtSOWECT-iRPcX7Jh6iXiGC-pn5sOkinFl4tJwWdGN-q6zppluYc8Lycvu4Jms0OZp5rOJEwE/s1600/091220111281.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYEYjTzLW1re1uqBy4y28bsEoRN6Wt-bblyVgVjhoQM_LGBeLpCc1bxMQIxYZDeBbIEjLtSOWECT-iRPcX7Jh6iXiGC-pn5sOkinFl4tJwWdGN-q6zppluYc8Lycvu4Jms0OZp5rOJEwE/s400/091220111281.jpg" width="400" /></a></div>
<br />
I used super clue to stick the round gear on the cardboard.. there is no way the screw that comes with the servo could be fixed on the cardboard... =.=<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS-RiTG1su3lYtxR6uxIpmSWVg7ys0dH4Pd5kB3dhebwGP8_OKXdVATE6Vi15UBVD1EjNJzIm7pqc5fC9uYjWfiL1RZ7Nj6JuA2kxP-thIYgZmbqE0edwdrSzIum2JRY2QJAG9qKeMecE/s1600/091220111282.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS-RiTG1su3lYtxR6uxIpmSWVg7ys0dH4Pd5kB3dhebwGP8_OKXdVATE6Vi15UBVD1EjNJzIm7pqc5fC9uYjWfiL1RZ7Nj6JuA2kxP-thIYgZmbqE0edwdrSzIum2JRY2QJAG9qKeMecE/s400/091220111282.jpg" width="300" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
it works fine! i think i will just stick with it for now until I move on to the plastic or even metal version!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Ciao</div>
<div>
<br /></div>
</div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-64369921269245318012011-12-07T20:39:00.001+00:002011-12-10T12:50:28.550+00:00DIY: build your own motor driver!<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>What does it do:</b></span><br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">it will take an external power supply and drive up to two 5V DC motors (suitable for most of the homemade robots). Each motor can be controlled by 2 input signals to run clockwise and/or counter clockwise.</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">result:</span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/KPVK5LmNiPg?feature=player_embedded' frameborder='0'></iframe></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span><br />
<a name='more'></a><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>What components involved:</b></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">1. L293D (16 pin chip - H bridge motor driver)</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">2. 10uF, 0.1uF capacitors</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">3. screw terminals</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">4. strip board</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>So, I first came up with the schematic:</b></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">for simplicity, I connected Vcc1 (motor power supply), Vcc2 (chip power supply), Enable 1 and Enable 2 all to 5V DC. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Vcc1 should be connected to whatever the motor requires upto 36V, but in this project or in the near future, i will be just using 3V motors anyway, so that would be good enough. </span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">To enable PWM ( controlling speed), we will need to have individual input for ENABLE 1 and ENABLE 2. But I won't be controlling speed, so just merge them with power supply.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">The capacitors are optional, the circuit works without them. But to protect the chip, it is considered good practice to connect them to the power supply.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial;"><br /></span></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9UUosXjMzs2WH59yPQcck9nVr-lWW6U7coxByXGsQgtN4nQ60xj5jtyDA8QBYhfbzIfyV5zoCkIEfEQ_fr7t0KtPFGoEPwbysOehfS4gcGJCrczm05O7v-MTgK4l4a96VSFrEjDHiqiQ/s1600/071220111271.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9UUosXjMzs2WH59yPQcck9nVr-lWW6U7coxByXGsQgtN4nQ60xj5jtyDA8QBYhfbzIfyV5zoCkIEfEQ_fr7t0KtPFGoEPwbysOehfS4gcGJCrczm05O7v-MTgK4l4a96VSFrEjDHiqiQ/s400/071220111271.jpg" width="400" /></a></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">I then build it on a vero board and test the result:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJg9s1nE60MUWNKsz83sEbJYVaemFKUo05vq-cIeKId-kBzbho7MQorc3HM1VjcIJTjVG-335vXCb6voTbFJgmifp9RMN0aeTOx7S_fvbJn6SNRNVoHzKgV_HvO19J9P8ImL1V72yyWU/s1600/031220111259.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJg9s1nE60MUWNKsz83sEbJYVaemFKUo05vq-cIeKId-kBzbho7MQorc3HM1VjcIJTjVG-335vXCb6voTbFJgmifp9RMN0aeTOx7S_fvbJn6SNRNVoHzKgV_HvO19J9P8ImL1V72yyWU/s400/031220111259.jpg" width="400" /></a></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Seems working! so i designed and tried to solder it on the stripboard. It was very difficult because the board is so small and there are so many components i need to fit in. Also I haven't been doing any soldering since second year in Uni... ah... what a pain.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">This is what I got:</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHsAoUa0fh3qvSEj_bdf8I4mLHXGrJdXC3RWfY0Kh-ndEdtG_RcT4glxPo82vfS2trgwx7DquWbkmHhpcpEfbAU6fYX3X8NKEeSHPDfsc5W4PPpssfqgu11xY5cjsfyvRD31N8zCS7g3A/s1600/041220111260.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHsAoUa0fh3qvSEj_bdf8I4mLHXGrJdXC3RWfY0Kh-ndEdtG_RcT4glxPo82vfS2trgwx7DquWbkmHhpcpEfbAU6fYX3X8NKEeSHPDfsc5W4PPpssfqgu11xY5cjsfyvRD31N8zCS7g3A/s400/041220111260.jpg" width="400" /></a></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">:`( it's very messy, no wonder it won't work!!</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZi4K59AW0gcT0-tF9WKipHy8OZStKrXSb_Zln3mltHYJKm_sVgrvUp7YKxWdqAXJIz3DWD6EKCEO-C1u69n_lI6rBq9NANuryQ5oD0Zpy-uQeG0DMw7Hg8O_hsxXtDhIUaZ-9D81Bdu4/s1600/041220111261.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZi4K59AW0gcT0-tF9WKipHy8OZStKrXSb_Zln3mltHYJKm_sVgrvUp7YKxWdqAXJIz3DWD6EKCEO-C1u69n_lI6rBq9NANuryQ5oD0Zpy-uQeG0DMw7Hg8O_hsxXtDhIUaZ-9D81Bdu4/s400/041220111261.jpg" width="400" /></a></div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">I was trying so hard, to place all the cables on the back, but it doesn't seem to be working!! morning wasted!! I later realized it's the connection problem with the solderings.. so I spent the whole afternoon redesigned it and did another one. But this time I leave all the cables on the front instead to make sure the best connection although it looks messier.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Finally it works! both Channel are working properly!</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td style="font-size: 16px;" valign="top"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>input1/input3</b></span></td><td style="font-size: 16px;" valign="top"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><b>input2/input4</b></span></td><td style="font-size: 16px;" valign="top"><b>action</b></td></tr>
<tr><td valign="top">LOW</td><td valign="top">LOW</td><td valign="top">STOP</td></tr>
<tr><td valign="top">LOW</td><td valign="top">HIGH</td><td valign="top">CLOCKWISE</td></tr>
<tr><td valign="top">HIGH</td><td valign="top">LOW</td><td valign="top">COUNTER-CLOCKWISE</td></tr>
<tr><td valign="top">HIGH</td><td valign="top">HIGH</td><td valign="top">STOP</td></tr>
</tbody></table>
<div>
<br /></div>
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_1RwMIQFLbGFci2NqK4szLKYMZE1VXMHSMIegcPaW7keSCKKmnLmbrChgJm4a10u9BnT00ogKtmdD4F-fTAkAZDW_N6srWbJP8xSWbh2boFcdAoz3sQx1M0gx9Stuw8iYWPZSIVEyziQ/s1600/071220111273.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_1RwMIQFLbGFci2NqK4szLKYMZE1VXMHSMIegcPaW7keSCKKmnLmbrChgJm4a10u9BnT00ogKtmdD4F-fTAkAZDW_N6srWbJP8xSWbh2boFcdAoz3sQx1M0gx9Stuw8iYWPZSIVEyziQ/s400/071220111273.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now, let's test it with some motors and wheels (notice I use the 5V supply from Arduino, this is actually not a good practice as it could harm your arduino board. it's better to use external power supply. But as my AA batteries are still on delivery, i will just use it for testing today.)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Guf5sM7J1BjrQ5UoMK4dzTITJpaP0i1hBCWw7qtkJduad_8HMCpT0NMsI0rWjI8FGxrJOF1VGnJZGjg4elMZYQaQKylCLAmSY6T02PwOGtPJp8YOX5XJsptDiik003Hy5SQcFuimZDA/s1600/081220111274.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Guf5sM7J1BjrQ5UoMK4dzTITJpaP0i1hBCWw7qtkJduad_8HMCpT0NMsI0rWjI8FGxrJOF1VGnJZGjg4elMZYQaQKylCLAmSY6T02PwOGtPJp8YOX5XJsptDiik003Hy5SQcFuimZDA/s400/081220111274.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br /></div>
<div>
</div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-33571056837913892372011-11-28T23:04:00.001+00:002011-11-28T23:44:45.237+00:00How to control a Servo<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Result:</span><br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/MrvcKOTv3Fo?feature=player_embedded' frameborder='0'></iframe></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">In this one, servo is programmed to be controlled by two buttons, one turns servo to the left and the other one turns it to the right. When the servo is turning, corresponding LED will be switched on to indicate the operation.</span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><a name='more'></a></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></span></div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Because Arduino has built-in library for controlling servo, which makes servo a really easy kit to use. In this<span> </span><a href="http://arduin0.blogspot.com/2011/11/ir-obstacle-detection-robot.html">project</a>, I will be using a servo to turn the IR sensor around constantly.</span></div>
<div>
<br /></div>
<div>
This is the circuit Diagram:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkRfgE7CVtlD5NigEXAS9LuzthStp-HyYYW0j40fY55o2Dq4S27qewFuGHvxRy3armC4epF3NBRWvcGLvvaU0FJRIf5UEG5ur9PVzVhf7xDG4iK_YxS5Q7KRNS7SVZK4F6vUVsguIxsMo/s1600/%25E5%259B%25BE%25E5%2583%258F+5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="359" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkRfgE7CVtlD5NigEXAS9LuzthStp-HyYYW0j40fY55o2Dq4S27qewFuGHvxRy3armC4epF3NBRWvcGLvvaU0FJRIf5UEG5ur9PVzVhf7xDG4iK_YxS5Q7KRNS7SVZK4F6vUVsguIxsMo/s640/%25E5%259B%25BE%25E5%2583%258F+5.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<img src="file:///C:/Users/Oscar/AppData/Local/Temp/enhtmlclip/%E5%9B%BE%E5%83%8F%205.png" style="cursor: default;" /></div>
<div>
<br /></div>
<div>
This is the code:</div>
<div>
<br /></div>
<div>
<table border="1" cellpadding="2" cellspacing="0"><tbody>
<tr><td valign="top"><span style="color: #666666; font-style: normal;"><br />
// Oscar's Project</span><br /><span style="color: #666666; font-style: normal;">//<span> </span></span><br /><span style="color: #666666; font-style: normal;">// There are 2 input buttons (turn left and right), when button is pressed, the servo turns and corresponding LED is lit up.</span><br /><br /><br /><br /><span style="color: #339933;">#include <Servo.h><span> </span></span><br />
<br />
Servo myservo<span style="color: #339933;">;</span><span> </span> <span style="color: #666666; font-style: normal;">// create servo object to control a servo<span> </span></span><br />
<span> </span><span style="color: #666666; font-style: normal;">// a maximum of eight servo objects can be created<span> </span></span><br />
<br /><span style="color: #993333;">int</span><span> </span>pos<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">90</span><span style="color: #339933;">;</span><span> </span> <span style="color: #666666; font-style: normal;">// variable to store the servo position<span> </span></span><br /><span style="color: #993333;">const</span><span> </span><span style="color: #993333;">int</span><span> </span>maxDeg<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">160</span><span style="color: #339933;">;</span><br /><span style="color: #993333;">const</span><span> </span><span style="color: #993333;">int</span><span> </span>minDeg<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">5</span><span style="color: #339933;">;</span><br /><br /><br /><span style="color: #993333;">const</span><span> </span><span style="color: #993333;">int</span><span> </span>leftPin<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">3</span><span style="color: #339933;">;</span><br /><span style="color: #993333;">const</span><span> </span><span style="color: #993333;">int</span><span> </span>rightPin<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">2</span><span style="color: #339933;">;</span><br /><br /><span style="color: #993333;">const</span><span> </span><span style="color: #993333;">int</span><span> </span>led1Pin<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">6</span><span style="color: #339933;">;</span><span> </span><span style="color: #666666; font-style: normal;">// indicator</span><br /><span style="color: #993333;">const</span><span> </span><span style="color: #993333;">int</span><span> </span>led2Pin<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">5</span><span style="color: #339933;">;</span><span> </span><span style="color: #666666; font-style: normal;">// indicator</span><br /><br /><span style="color: #993333;">const</span><span> </span><span style="color: #993333;">int</span><span> </span>outputPin<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">9</span><span style="color: #339933;">;</span><span> </span><span style="color: #666666; font-style: normal;">// pwm function will be disabled on pin 9 and 10 if using servo</span><br /><br /><span style="color: #993333;">int</span><span> </span>leftPressed<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br /><span style="color: #993333;">int</span><span> </span>rightPressed<span> </span><span style="color: #339933;">=</span><span> </span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br /><br /><br /><span style="color: #993333;">void</span><span> </span>setup<span style="color: #009900;">(</span><span style="color: #009900;">)</span><span> </span><br /><span style="color: #009900;">{</span><span> </span><br />
myservo.<span style="color: #202020;">attach</span><span style="color: #009900;">(</span>outputPin<span style="color: #009900;">)</span><span style="color: #339933;">;</span><span> </span> <span style="color: #666666; font-style: normal;">// attaches the servo on pin 9 to the servo object<span> </span></span><br />
pinMode<span style="color: #009900;">(</span>leftPin<span style="color: #339933;">,</span><span> </span>INPUT<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
pinMode<span style="color: #009900;">(</span>rightPin<span style="color: #339933;">,</span><span> </span>INPUT<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
pinMode<span style="color: #009900;">(</span>led1Pin<span style="color: #339933;">,</span><span> </span>OUTPUT<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
pinMode<span style="color: #009900;">(</span>led2Pin<span style="color: #339933;">,</span><span> </span>OUTPUT<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br /><span style="color: #009900;">}</span><span> </span><br />
<br />
<br /><span style="color: #993333;">void</span><span> </span>loop<span style="color: #009900;">(</span><span style="color: #009900;">)</span><span> </span><br /><span style="color: #009900;">{</span><span> </span><br />
leftPressed<span> </span><span style="color: #339933;">=</span><span> </span>digitalRead<span style="color: #009900;">(</span>leftPin<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
rightPressed<span> </span><span style="color: #339933;">=</span><span> </span>digitalRead<span style="color: #009900;">(</span>rightPin<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
<span> </span><br />
<span> </span><span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>leftPressed<span style="color: #009900;">)</span><span style="color: #009900;">{</span><br />
<span> </span><span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>pos<span> </span><span style="color: #339933;"><</span><span> </span>maxDeg<span style="color: #009900;">)</span><span> </span>pos<span> </span><span style="color: #339933;">+=</span><span> </span><span style="color: #0000dd;">3</span><span style="color: #339933;">;</span><br />
myservo.<span style="color: #202020;">write</span><span style="color: #009900;">(</span>pos<span style="color: #009900;">)</span><span style="color: #339933;">;</span><span> </span> <span style="color: #666666; font-style: normal;">// tell servo to go to position in variable 'pos'<span> </span></span><br />
digitalWrite<span style="color: #009900;">(</span>led1Pin<span style="color: #339933;">,</span>HIGH<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
<span> </span><span style="color: #009900;">}</span><br />
<span> </span><span style="color: #b1b100;">else</span><br />
digitalWrite<span style="color: #009900;">(</span>led1Pin<span style="color: #339933;">,</span>LOW<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
<span> </span><br />
<span> </span><span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>rightPressed<span style="color: #009900;">)</span><span style="color: #009900;">{</span><br />
<span> </span><span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>pos<span> </span><span style="color: #339933;">></span><span> </span>minDeg<span style="color: #009900;">)</span><span> </span>pos<span> </span><span style="color: #339933;">-=</span><span> </span><span style="color: #0000dd;">3</span><span style="color: #339933;">;</span><br />
myservo.<span style="color: #202020;">write</span><span style="color: #009900;">(</span>pos<span style="color: #009900;">)</span><span style="color: #339933;">;</span><span> </span> <span style="color: #666666; font-style: normal;">// tell servo to go to position in variable 'pos'<span> </span></span><br />
digitalWrite<span style="color: #009900;">(</span>led2Pin<span style="color: #339933;">,</span>HIGH<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
<span> </span><span style="color: #009900;">}</span><br />
<span> </span><span style="color: #b1b100;">else</span><br />
digitalWrite<span style="color: #009900;">(</span>led2Pin<span style="color: #339933;">,</span>LOW<span style="color: #009900;">)</span><span style="color: #339933;">;</span><br />
<span> </span><br />
delay<span style="color: #009900;">(</span><span style="color: #0000dd;">15</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span><span> </span> <span> </span><span style="color: #666666; font-style: normal;">// waits 15ms for the servo to reach the position<span> </span></span><br /><br /><span style="color: #009900;">}<br /></span></td></tr>
</tbody></table>
</div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2073270612133201407.post-53553293032700562052011-11-28T22:13:00.001+00:002011-11-28T23:04:13.999+00:00IR obstacle detection Robot<br />
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Today, I happened to come across this<span> </span><a href="http://letsmakerobots.com/start">website</a>, describing how to build a very simple robot without any electronics knowledge. It's very interesting and easy. But it suggests a budget of over $110 which is very high for such a simple robot.</span><br />
<br />
<div>
Therefore I decided to design and build one with the same functionality but lower cost.</div>
</div>
<div>
<br /></div>
<div>
Let's see how much it would cost approximately (I got all the prices from ebay):</div>
<div>
<br /></div>
<div>
Arduino UNO - £15</div>
<div>
Servo - £3 (usually sold in bulk)</div>
<div>
IR distance detector - £2 (will only need 2 or 3 units, I bought 10 from China for £3 ;-p )</div>
<div>
Motor Driver (L293D) - £2 (cheaper than building one yourself!)</div>
<div>
Gear Motor - £13 (better than using the motor directly as we need higher ratio, slower movement)</div>
<div>
9V PP3 battary - £3 (I use rechargeable so more expensive)</div>
<div>
resistor/capacitor/wire - £2</div>
<div>
<br /></div>
<div>
Optional: </div>
<div>
other accessories - £5 (varies really)</div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Wheels - £7 (or £0 if you could make some yourself)</span></div>
<div>
<br /></div>
<div>
Total ----- £40 to £52 (which is $62 to $80 on today's exchange rate!)</div>
<div>
<br /></div>
<div>
I have divided the robot into several parts, and we will be building and testing each part before we put them together. The green arrow indicates the interactions between these parts.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg42grISNj_78UuwYhh0XYKG0stdEJR9ua_0YCKQSjSRBRiqHGqF55O9CCEofq45eDY1lnCfwQ13oJrhx_eRFVGJKyQwq0I-N4bVGwud4xHX6f5lMrI7VmUC_7IAGkIsUInS_1YUNS65n8/s1600/Image.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg42grISNj_78UuwYhh0XYKG0stdEJR9ua_0YCKQSjSRBRiqHGqF55O9CCEofq45eDY1lnCfwQ13oJrhx_eRFVGJKyQwq0I-N4bVGwud4xHX6f5lMrI7VmUC_7IAGkIsUInS_1YUNS65n8/s400/Image.png" width="400" /></a></div>
<div>
<br /></div>Unknownnoreply@blogger.com