tag:blogger.com,1999:blog-85179012133714771592024-03-13T20:45:50.647+05:30Electronics FAQThe Hows and Whys of ElectronicsAnurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.comBlogger170125tag:blogger.com,1999:blog-8517901213371477159.post-15675522263190075402023-11-27T13:46:00.007+05:302023-11-27T13:46:50.668+05:30Switching over to GitHub Pages<p>I have setup Github Pages. Will be posting stuff there from now on</p><p><a href="https://diy.lithiumhead.com/">https://diy.lithiumhead.com/</a><br /></p>Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-23194311593593131802020-07-25T00:33:00.002+05:302020-07-25T00:37:30.868+05:30Enabling an Industrial I/O Driver on Raspberry Pi 3 running Arch Linux ARM<a href="https://invensense.tdk.com/products/motion-tracking/9-axis/mpu-9250/" target="_blank">MPU9250 from TDK</a> is a three in one Gyro + Accelerometer + Compass sensor with an I<sup>2</sup>C interface. Mainline Linux kernel has the source code for it's driver which reads values from the sensor via I<sup>2</sup>C and exposes it via the filesystem using the <a href="https://www.kernel.org/doc/html/v4.14/driver-api/iio/index.html" target="_blank">Industrial I/O subsystem</a>. Arch Linux ARM for Raspberry Pi does not come with the driver for this pre-compiled and enabled. Here is how to compile and enable the driver on Raspberry Pi 3 Model B.<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRr8mX_QECWGpZW68O-PuW_vmoJabb88TJHuWdoDSYhmK4WPm0VjcEjjpbAJus4BcJfOr-nbfC5Qz9Pn3ocgWco6wF5ZvCEwYjwCXs7Su6L6XNuYUpR6P1-Z9grxIBWTXuWbeM824K59E/s1628/Raspberry+Pi3B+MPU9250.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1241" data-original-width="1628" height="381" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRr8mX_QECWGpZW68O-PuW_vmoJabb88TJHuWdoDSYhmK4WPm0VjcEjjpbAJus4BcJfOr-nbfC5Qz9Pn3ocgWco6wF5ZvCEwYjwCXs7Su6L6XNuYUpR6P1-Z9grxIBWTXuWbeM824K59E/w500-h381/Raspberry+Pi3B+MPU9250.jpg" width="500" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Raspberry Pi 3 Model B with MPU9250 connected to it's I2C interface<br />and a USB-Serial widget to access console over serial</td></tr></tbody></table><br /><h3 style="text-align: left;">Connections</h3><div>Buy the <a href="https://www.amazon.in/Super-Debug-MPU-9250-GY-9250-Communication/dp/B0827FGRXJ" target="_blank">MPU9250 Widget from Amazon</a> and hook it up to your Raspberry Pi as per the table</div><div><span><br /></span></div><div><span id="docs-internal-guid-e90cb9ca-7fff-6e7f-6078-d1a2bf3263a9"><br /><div align="left" dir="ltr" style="margin-left: 0pt;"><table style="border-collapse: collapse; border: none;"><colgroup><col width="171"></col><col width="173"></col></colgroup><tbody><tr style="height: 38pt;"><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RPi3 (2.54mm)</span></p></td><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">MPU9250 Module</span><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(2.54mm)</span></p></td></tr><tr style="height: 26pt;"><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">3.3V PWR Pin 1</span></p></td><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">VCC</span></p></td></tr><tr style="height: 26pt;"><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">GND Pin 9</span></p></td><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">GND</span></p></td></tr><tr style="height: 26pt;"><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">I2C1_SCL GPIO 3 Pin 5</span></p></td><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">SCL</span></p></td></tr><tr style="height: 26pt;"><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">I2C1_SDA GPIO 2 Pin 3</span></p></td><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">SDA</span></p></td></tr><tr style="height: 26pt;"><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">GPIO4 Pin 7</span></p></td><td style="border-color: rgb(158, 158, 158); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 7pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">INT</span></p></td></tr></tbody></table></div></span></div><div><br /></div><div><h3>Preparations</h3></div><div><span id="docs-internal-guid-9ca53bbe-7fff-197a-431c-811d8782ad09"><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Prepare and boot Arch Linux ARM from SD Card: <a href="https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3" target="_blank">instructions are here</a>.</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span style="font-size: 11pt; white-space: pre;"><font face="inherit">Connect the Raspberry Pi to your home network using an ethernet cable.</font></span></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span style="font-size: 11pt; white-space: pre;"><font face="inherit">Look up the DHCP assigned IP address from your router’s configuration web interface,
it will show as a new device named "alarmpi".</font></span></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Gain access to the console over SSH using <a href="https://www.putty.org/" target="_blank">PuTTY</a> or <a href="https://mobaxterm.mobatek.net/download.html" target="_blank">MobaXterm</a> or physically using keyboard/mouse/monitor.
Login: alarm and Password: </font><font face="courier">alarm</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">While following the instructions below, switch to root user whenever required using:</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">su root</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Password:</span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit"> </font><font face="courier">root</font></span></p></li></ol></ol><div><font face=""><span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span></font></div></span><h3 style="text-align: left;"><span>Enable Console over USB-Serial [Optional]</span></h3><span>Follow instructions over at <a href="https://gist.github.com/yeokm1/d6c3ca927919c61257cd">https://gist.github.com/yeokm1/d6c3ca927919c61257cd</a></span></div><div><span><br /></span></div><div><span><h3 style="text-align: left;">Install required packages on Arch Linux ARM running on RPi3B</h3><div><ul style="text-align: left;"><li><span><div><font face="courier">pacman-key --init</font></div></span></li><li><span><div><font face="courier">pacman-key --populate archlinuxarm</font></div></span></li><li><span><div><font face="courier">pacman -Syu</font></div></span></li><li><span><div><font face="courier">pacman -S curl bash ca-certificates nano i2c-tools jq iio-utils</font></div></span></li><li><span><div><font face="courier">pacman -S base-devel</font></div></span></li><li><span><div><font face="courier">pacman -S dtc git</font></div></span></li><li><span><div><font face="courier">pacman -S linux-raspberrypi-headers</font></div></span></li><li><span><div><font face="courier">pacman -S python python-pip</font></div></span></li></ul></div><div><h3 style="text-align: left;">Enable I<sup>2</sup>C on Raspberry Pi 3 Model B running Arch Linux ARM</h3></div><div><span id="docs-internal-guid-61c32cd6-7fff-58dd-4fba-ea9412b4c336"><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">su root</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">nano /etc/modules-load.d/raspberrypi.conf</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Append:</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">i2c-dev</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Save and Reboot</font></span></p></li></ol><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">nano /boot/config.txt</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Append:</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">dtparam=i2c=on</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Save and Reboot</font></span></p></li></ol><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Test (0x68 is MPU9250):
</font></span></p></li></ol><div align="left" dir="ltr" style="margin-left: 36pt;"><table style="border-collapse: collapse; border: none;"><colgroup><col width="443"></col></colgroup><tbody><tr style="height: 0pt;"><td style="border-color: rgb(0, 0, 0); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 5pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[root@alarmpi alarm]# i2cdetect -y 1</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> 0 1 2 3 4 5 6 7 8 9 a b c d e f</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">00: -- -- -- -- -- -- -- -- -- -- -- -- --</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">70: -- -- -- -- -- -- -- --</span></p></td></tr></tbody></table></div><br /></span></div><h3 style="text-align: left;"><span>Python Library for reading from MPU9250 over </span>I<sup>2</sup>C</h3></span><span><div><span id="docs-internal-guid-3a021f7c-7fff-19a9-d7a3-445df156fc56"><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Install python packages (Latest version from its git repository, replace the version numbers with latest one)</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">python -m pip install git+https://github.com/FaBoPlatform/FaBo9AXIS-MPU9250-Python.git@78e4da28e176a07cc1c22c2f61a5be7ffe6c2c28</font></span><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /><br /></span></p></li></ol><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Clone the git repository to fetch the example code</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><font face="courier"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">git clone </span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">https://github.com/FaBoPlatform/FaBo9AXIS-MPU9250-Python.git</span></font></p></li></ol></ol><font face="inherit"><br /></font><ol start="3" style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">First test in text mode using example from FaBo9AXIS-MPU9250-Python repo (This uses raw <span style="font-size: medium; white-space: normal;">I</span><sup style="white-space: normal;">2</sup><span style="font-size: medium; white-space: normal;">C</span> bus without the need for MPU9250 Industrial I/O Driver):</font></span></p></li></ol><div align="left" dir="ltr" style="margin-left: 36pt;"><table style="border-collapse: collapse; border: none;"><colgroup><col width="490"></col></colgroup><tbody><tr style="height: 0pt;"><td style="border-color: rgb(0, 0, 0); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 5pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[root@alarmpi ~]# python FaBo9AXIS-MPU9250-Python/example/read9axis.py</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> ax = -0.871</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> ay = 0.39</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> az = 0.31</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gx = -0.793</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gy = 0.725</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gz = -0.099</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> mx = 30.289</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> my = 44.197</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> mz = -24.791</span></p><br /><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> ax = -0.872</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> ay = 0.392</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> az = 0.312</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gx = -0.801</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gy = 0.71</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gz = -0.069</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> mx = 30.647</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> my = 43.475</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> mz = -25.832</span></p></td></tr></tbody></table></div></span></div><div><span><br /></span></div><div><span id="docs-internal-guid-fcd8342a-7fff-7825-2547-4983096cdec6"><div><font face="Arial"><span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span></font></div><h3 style="text-align: left;"><span style="font-size: 14.6667px; white-space: pre-wrap;"><font face="Arial">Enabling MPU9250 Industrial I/O interface on ArchLinux running on Raspberry Pi 3</font></span></h3><div><span style="font-size: 14.6667px; white-space: pre-wrap;"><font face="Arial"><br /></font></span></div><div><span style="font-size: 14.6667px; white-space: pre-wrap;"><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Fetch (from mainline kernel repository) the latest sources of inv-mpu6050 which has support for MPU9250 through shallow clone/sparse checkout, execute the following commands while in /root:</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">su root</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mkdir linux_main_src</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">cd linux_main_src</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">git init</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">git remote add origin https://github.com/torvalds/linux.git</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">git config core.sparsecheckout true</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">echo "drivers/iio/*" >> .git/info/sparse-checkout</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">git pull --depth=3 origin master</span></p></li></ol><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Create the Makefile for compiling the driver:</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Get into </span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">/root/linux_main_src/drivers/iio/imu/inv_mpu6050</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><font face="inherit"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">And modify the Makefile present there for the inv_mpu6080 driver to compile on and for Raspberry Pi 3 platform (lines in blue will be present already, lines in red are the ones that need to be appended, make sure to use a single tab and not spaces at the beginning of the lines below “all:’ and “clean:”) :</span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Makefile</span></font></p></li></ol></ol><div align="left" dir="ltr" style="margin-left: 72pt;"><table style="border-collapse: collapse; border: none;"><colgroup><col width="480"></col></colgroup><tbody><tr style="height: 0pt;"><td style="border-color: rgb(0, 0, 0); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 5pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"># SPDX-License-Identifier: GPL-2.0</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">#</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"># Makefile for Invensense MPU6050 device.</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">#</span></p><br /><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">obj-$(CONFIG_INV_MPU6050_IIO) += inv-mpu6050.o</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">inv-mpu6050-y := inv_mpu_core.o inv_mpu_ring.o inv_mpu_trigger.o \</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> inv_mpu_aux.o inv_mpu_magn.o</span></p><br /><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">obj-$(CONFIG_INV_MPU6050_I2C) += inv-mpu6050-i2c.o</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">inv-mpu6050-i2c-y := inv_mpu_i2c.o inv_mpu_acpi.o</span></p><br /><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">obj-$(CONFIG_INV_MPU6050_SPI) += inv-mpu6050-spi.o</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: blue; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">inv-mpu6050-spi-y := inv_mpu_spi.o</span></p><br /><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">all:</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gzip -f inv-mpu6050-i2c.ko</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gzip -f inv-mpu6050-spi.ko</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> gzip -f inv-mpu6050.ko</span></p><br /><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">clean:</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> rm inv-mpu6050-i2c.ko.gz</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> rm inv-mpu6050-spi.ko.gz</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="color: red; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> rm inv-mpu6050.ko.gz</span></p></td></tr></tbody></table></div><br /><ol start="3" style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Change to /root</span><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">cd /root</font></span><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /><br /></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Create an device tree overlay source file for MPU9250:</span><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">nano /root/mpu9250.dts</font></span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier"><br /></font><font face="inherit"><br /></font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Add the contents and save:</font></span><span style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /><br /></span></p></li></ol><div align="left" dir="ltr" style="margin-left: 0pt;"><table style="border-collapse: collapse; border: none;"><colgroup><col width="591"></col></colgroup><tbody><tr style="height: 0pt;"><td style="background-color: black; border-color: rgb(0, 0, 0); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 5pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.32955; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// Definitions for MPU9250</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// Combination of:</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/overlays/mpu6050-overlay.dts</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// and https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// Driver codes:</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// https://github.com/torvalds/linux/blob/master/drivers/iio/imu/inv_mpu6050/</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// and</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// https://github.com/torvalds/linux/tree/master/drivers/iio/magnetometer</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">dts</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">v1</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">plugin</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">compatible</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"brcm,bcm2708"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">fragment</span><span style="background-color: #1e0010; color: #960050; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">@</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">target</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><&</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">i2c1</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">__overlay__</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: #1e0010; color: #960050; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">#</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">address</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">cells</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: #1e0010; color: #960050; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">#</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">size</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">cells</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">status</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"okay"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">clock</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">frequency</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">400000</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mpu9250:</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mpu9250</span><span style="background-color: #1e0010; color: #960050; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">@</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">68</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">compatible</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"invensense,mpu9250"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">reg</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0x68</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">interrupt</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">parent</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><&</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gpio</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">interrupts</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mount</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">matrix</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"1"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* x0 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"0"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* y0 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"0"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* z0 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"0"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* x1 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"1"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* y1 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"0"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* z1 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"0"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* x2 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"0"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* y2 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"1"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #75715e; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/* z2 */</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">i2c</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gate</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: #1e0010; color: #960050; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">#</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">address</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">cells</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: #1e0010; color: #960050; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">#</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">size</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">cells</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ak8963</span><span style="background-color: #1e0010; color: #960050; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">@</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">c</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">compatible</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"asahi-kasei,ak8963"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">reg</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #ae81ff; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0x0c</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">__overrides__</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">interrupt</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><&</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mpu9250</span><span style="background-color: transparent; color: #f92672; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #e6db74; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"interrupts:0"</span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: transparent; color: #333333; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="background-color: transparent; color: #f8f8f2; font-family: inconsolata, monospace; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">};</span></p><br /><br /></td></tr></tbody></table></div><br /><ol start="6" style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Compile the device tree source and place it in overlays folder:</span><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">dtc -I dts -O dtb -o /boot/overlays/mpu9250.dtbo -b 0 -@ /root/mpu9250.dts
</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Update /boot/config.txt and add the following lines to it, save it and reboot:</span><span style="font-family: inherit; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">dtoverlay=mpu9250
</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Read the Accelerometer and Magnetometer values like so:</font></span><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /><br /></span></p></li></ol><div align="left" dir="ltr" style="margin-left: 36pt;"><table style="border-collapse: collapse; border: none; table-layout: fixed; width: 523.276pt;"><colgroup><col></col></colgroup><tbody><tr style="height: 0pt;"><td style="border-color: rgb(0, 0, 0); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 5pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[alarm@alarmpi ~]$ cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-794</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[alarm@alarmpi ~]$ cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">271</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[alarm@alarmpi ~]$ cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">16950</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[alarm@alarmpi ~]$ cat /sys/bus/iio/devices/iio\:device1/in_magn_x_raw</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">42</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[alarm@alarmpi ~]$ cat /sys/bus/iio/devices/iio\:device1/in_magn_y_raw</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-14</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[alarm@alarmpi ~]$ cat /sys/bus/iio/devices/iio\:device1/in_magn_z_raw</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">43</span></p><br /></td></tr></tbody></table></div></span></div><div><font face="Arial"><span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span></font></div><div><span id="docs-internal-guid-8e548b3c-7fff-0bbe-28e3-7d1c14a838e4"><h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;"><span style="font-family: arial; font-size: 16pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;">Python Bar Graph with Industrial I/O Driver</span></h2><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Install python packages (Latest versions from its git repository, replace the version number with latest one)</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">pacman -S libjpeg</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">python -m pip install git+https://github.com/peterbrittain/asciimatics.git@476159c95c5b6e34a782ea97503785ad95683805</span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /><br /></span></p></li></ol><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Clone the git repository to fetch the example code</font></span></p></li><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><font face="courier"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">git clone</span> https://github.com/peterbrittain/asciimatics.git </font></p></li></ol></ol><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span></p><ol start="3" style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Then run following code using python for live bar graph:</font><font face="Arial">
</font></span></p></li></ol><div align="left" dir="ltr" style="margin-left: 36pt;"><table style="border-collapse: collapse; border: none;"><colgroup><col width="650"></col></colgroup><tbody><tr style="height: 0pt;"><td style="background-color: black; border-color: rgb(0, 0, 0); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 5pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">asciimatics.effects</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Print</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">asciimatics.renderers</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">BarChart,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">FigletText,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">SpeechBubble,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Box</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">asciimatics.scene</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Scene</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">asciimatics.screen</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Screen</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">asciimatics.exceptions</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ResizeScreenError</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">os</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">sys</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">math</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">time</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel_x</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device0/in_accel_x_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel_y</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device0/in_accel_y_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel_z</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device0/in_accel_z_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro_x</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device0/in_anglvel_x_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro_y</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device0/in_anglvel_y_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro_z</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device0/in_anglvel_z_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag_x</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device1/in_magn_x_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag_y</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device1/in_magn_y_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag_z</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">open(</span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'/sys/bus/iio/devices/iio:device1/in_magn_z_raw'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">'r'</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">_speak</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">(screen,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">text,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">pos,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">start):</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Print(</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">screen,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">SpeechBubble(text,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">None,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">uni</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">screen</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">unicode_aware),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">pos[</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">]</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">pos[</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">]</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">colour</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Screen</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">COLOUR_WHITE,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">clear</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">True,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">start_frame</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">start,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">stop_frame</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">start</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">50</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accelx</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel_x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(accel_x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">16000</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accely</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel_y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(accel_y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">16000</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accelz</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel_z</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(accel_z</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">16000</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accel</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyrox</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro_x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(gyro_x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">300</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyroy</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro_y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(gyro_y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">300</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyroz</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro_z</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(gyro_z</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">300</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyro</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">magx</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag_x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(mag_x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">100</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">magy</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag_y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(mag_y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">100</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">magz</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">():</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag_z</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">seek(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">int(mag_z</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">readline())</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">100</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">mag</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">else</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span></p><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">def</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #a6e22e; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">demo</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">(screen):</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">scenes</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[]</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">effects</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Print(screen,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">BarChart(</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">40</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[accelx,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accely,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">accelz],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">colour</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">range(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">bg</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">range(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">scale</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2.0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">axes</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">BarChart</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">X_AXIS,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">intervals</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0.5</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">labels</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">True,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">border</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">False),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">transparent</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">False,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">speed</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">_speak(screen,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"Accelerometer"</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">14</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Print(screen,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">BarChart(</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">40</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[gyrox,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyroy,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">gyroz],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">colour</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">range(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">bg</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">range(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">scale</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2.0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">axes</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">BarChart</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">X_AXIS,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">intervals</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0.5</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">labels</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">True,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">border</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">False),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">15</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">transparent</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">False,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">speed</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">_speak(screen,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"Gyroscope"</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">29</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Print(screen,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">BarChart(</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">40</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[magx,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">magy,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">magz],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">colour</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">range(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">bg</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">[c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">c</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">range(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)],</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">scale</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2.0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">axes</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">BarChart</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">X_AXIS,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">intervals</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0.5</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">labels</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">True,</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">border</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">False),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">x</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">44</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">y</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">transparent</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">False,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">speed</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">_speak(screen,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #e6db74; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"Magnetometer"</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">50</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">14</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">),</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">]</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">scenes</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">append(Scene(effects,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">))</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">screen</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">play(scenes,</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">stop_on_resize</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">True)</span></p><br /><br /><br /><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">while</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">True:</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">try</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">:</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Screen</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">wrapper(demo)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">sys</span><span style="background-color: transparent; color: #f92672; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">exit(</span><span style="background-color: transparent; color: #ae81ff; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></p><p dir="ltr" style="line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">except</span><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #f8f8f2; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ResizeScreenError:</span></p><p dir="ltr" style="line-height: 1.32955; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: #333333; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; color: #66d9ef; font-family: "courier new"; font-size: 8pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">pass</span></p><br /><br /></td></tr></tbody></table></div></span></div></span></div></span></div><div><br /></div><div><br /></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpbhody5-xtwAl3UfwzNyqYPfMretMUDC52uZNrqyyDJUViQFuqXd7xXYHydLWIk0lE1FmWrg1BJSKPY4XC60Y4DYrd8N6M26EIf4MhfuKNKcELBs9M9KLNYD59LNUn2bje7JXt0tZyng/s1530/MPU9250+Python+Script.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="980" data-original-width="1530" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpbhody5-xtwAl3UfwzNyqYPfMretMUDC52uZNrqyyDJUViQFuqXd7xXYHydLWIk0lE1FmWrg1BJSKPY4XC60Y4DYrd8N6M26EIf4MhfuKNKcELBs9M9KLNYD59LNUn2bje7JXt0tZyng/w625-h400/MPU9250+Python+Script.jpg" width="625" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><span style="text-align: left;">Try rotating the MPU9250 widget and watch the bars change.</span></td></tr></tbody></table><div><br /></div><div><br /></div><div><span id="docs-internal-guid-bd2eeed8-7fff-438b-5ad7-e2d98a339b59"><h3 style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt; text-align: left;"><span style="font-family: arial; font-size: 16pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;">Enable WiFi on your Raspberry Pi 3 Running Arch Linux ARM [Optional]</span></h3><ol style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">su root</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">sudo pacman -S netctl</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="courier">nano /etc/netctl/wireless-home</font></span></p></li><li dir="ltr" style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><font face="inherit">Copy and paste the following contents and modify the SSID and passphrase to match your WiFi network</font></span></p></li></ol><div align="left" dir="ltr" style="margin-left: 36pt;"><table style="border-collapse: collapse; border: none; table-layout: fixed; width: 523.276pt;"><colgroup><col></col></colgroup><tbody><tr style="height: 0pt;"><td style="border-color: rgb(0, 0, 0); border-style: solid; border-width: 1pt; overflow-wrap: break-word; overflow: hidden; padding: 5pt; vertical-align: top;"><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Description='A simple WPA encrypted wireless connection'</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Interface=wlan0</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Connection=wireless</span></p><br /><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Security=wpa</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">IP=dhcp</span></p><br /><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ESSID='MyNetwork'</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"># Prepend hexadecimal keys with \"</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"># If your key starts with ", write it as '""<key>"'</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"># See also: the section on special quoting rules in netctl.profile(5)</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Key='WirelessKey'</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"># Uncomment this if your ssid is hidden</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">#Hidden=yes</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"># Set a priority for automatic profile selection</span></p><p dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">#Priority=10</span></p><br /></td></tr></tbody></table></div><ol start="5" style="margin-bottom: 0px; margin-top: 0px;"><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">netctl enable /etc/netctl/wireless-home</span></p></li><li dir="ltr" style="font-family: inconsolata, monospace; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: decimal; vertical-align: baseline; white-space: pre;"><p dir="ltr" role="presentation" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">reboot</span></p></li></ol></span></div>Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-46441654596265368082018-10-08T10:08:00.001+05:302018-10-11T14:24:35.509+05:30A Short Course on OpenWrt<div dir="ltr" style="text-align: left;" trbidi="on">
<iframe allowfullscreen="true" frameborder="0" height="299" mozallowfullscreen="true" src="https://docs.google.com/presentation/d/e/2PACX-1vTlhqditrgDdV34B7aEwd3Bq-swyUlw5HvkHaOMq2eMRrRkrqRG7S9t-7-z_8_A0HELL8bDvGnwXmVR/embed?start=false&loop=false&delayms=10000" webkitallowfullscreen="true" width="480"></iframe><br />
<br /></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-29930302069010843082018-07-13T00:52:00.003+05:302018-11-08T17:21:36.813+05:30Hacking "ESP8266 Black Board T5" Part 2 - Blinky and Hello World on SDCC<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Previous Part:<br />
<a href="http://www.electronicsfaq.com/2018/02/hacking-esp8266-black-cloud-features.html" target="_blank">Hacking "ESP8266 Black Board T5" Part 1 - Blinky on Keil</a><br />
<br />
Lets now move to SDCC, because SDCC is free and the free version of Keil has limitations. We will also move away from Windows to Ubuntu 64 bit<br />
<div>
<h4 style="text-align: left;">
Installing SDCC on your Ubuntu PC</h4>
Download 64 bit snapshot from: <a href="http://sdcc.sourceforge.net/snap.php#Linux">http://sdcc.sourceforge.net/snap.php#Linux</a><br />
The archive file would be named something like:<br />
<span style="font-family: "courier new" , "courier" , monospace;">sdcc-snapshot-amd64-unknown-linux2.5-20180712-10467.tar.bz2</span><br />
<br />
Download it to your ~/Documents directory<br />
<br /></div>
<div>
Then execute the following commands from the same directory (~/Documents) where you have placed the downloaded archive:<br />
<ol style="text-align: left;">
<li><span style="font-family: "courier new" , "courier" , monospace;">tar xjf ../sdcc-snapshot-amd64-unknown-linux2.5-20180712-10467.tar.bz2 </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">cd sdcc </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">sudo cp -r * /usr/local</span></li>
</ol>
This will install sdcc binaries into: /usr/local/bin/<br />
<span style="font-family: "courier new" , "courier" , monospace;">header files into: /usr/local/share/sdcc/include/<br />non-free header files into: /usr/local/share/sdcc/non-free/include/<br />library files into: /usr/local/share/sdcc/lib/<br />non-free library files into: /usr/local/share/sdcc/non-free/lib/<br />and documentation into: /usr/local/share/sdcc/doc/</span><br />
<br /></div>
<div>
You can test the install by entering:<br />
<span style="font-family: "courier new" , "courier" , monospace;">/usr/local/bin/sdcc -v</span></div>
<div>
This should return sdcc's version number, something like:<br />
<span style="font-family: "courier new" , "courier" , monospace;">SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.7.1 #10467 (Linux)<br /><br />published under GNU General Public License (GPL)</span></div>
<div>
<br /></div>
<div>
<h4>
Get the blinky source code and compile it</h4>
</div>
<div>
<ol style="text-align: left;">
<li>Install git if you don't have it installed:<br /><span style="font-family: "courier new" , "courier" , monospace;">sudo apt-get install git</span> </li>
<li>Clone the repo </li>
<ol>
<li><span style="font-family: "courier new" , "courier" , monospace;">cd ~/Documents </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">git clone https://github.com/lithiumhead/Black_Cloud_STC15L2K32S2 </span></li>
</ol>
<li>Compile the code </li>
<ol>
<li><span style="font-family: "courier new" , "courier" , monospace;">cd Black_Cloud_STC15L2K32S2/Blinky</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">sdcc -mmcs51 --verbose main.c</span></li>
</ol>
</ol>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9U3-9Vn11L_0XrWQSxgyW7dCqrxi26i0O6jJEc9EATiETWx-yodJFpuo9TqgKL5-LDrQaJQ01J9KWyWtj8OQum5abZzvcecbQMTq6PZVM7kgtrGdYaZpFtAfYCcQFMrN7IXWV-zebKuk/s1600/SDCC+Compiling+C+program+for+8051.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="344" data-original-width="975" height="140" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9U3-9Vn11L_0XrWQSxgyW7dCqrxi26i0O6jJEc9EATiETWx-yodJFpuo9TqgKL5-LDrQaJQ01J9KWyWtj8OQum5abZzvcecbQMTq6PZVM7kgtrGdYaZpFtAfYCcQFMrN7IXWV-zebKuk/s400/SDCC+Compiling+C+program+for+8051.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">SDCC Compiling C program for 8051</td></tr>
</tbody></table>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">This will generate the Intel Hex file main.ihx</span></div>
</div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
To remove the generated artifacts, you can use the git command to remove the files with extensions listed in .gitignore:<br />
<span style="font-family: "courier new" , "courier" , monospace;">git clean -fX</span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNn2AqDxZqaml0C_EE3QK2pqANJm_O-JxoYjVG5Bmf9J14n8XeOmIPUB1XCaMTbaJdUl8M0URi0OhsR6Wg4r-_1Y_NsKEmk-965O1WCcc0t7QKsTvHZ_AyVQvUD35AmKu_7EG2uQSAu9w/s1600/git+clean+ifnored+files.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="184" data-original-width="764" height="96" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNn2AqDxZqaml0C_EE3QK2pqANJm_O-JxoYjVG5Bmf9J14n8XeOmIPUB1XCaMTbaJdUl8M0URi0OhsR6Wg4r-_1Y_NsKEmk-965O1WCcc0t7QKsTvHZ_AyVQvUD35AmKu_7EG2uQSAu9w/s400/git+clean+ifnored+files.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">git clean -fX helps remove build artifact</td></tr>
</tbody></table>
</div>
<div>
<h4>
Download stcgal command line open source in-system programmer</h4>
</div>
<div>
<br />
<ol style="text-align: left;">
<li>Install python and stcgal dependencies </li>
<ol>
<li><span style="font-family: "courier new" , "courier" , monospace;">sudo apt install python3 python3-pip </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">pip3 install pyserial tqdm </span></li>
</ol>
<li>Clone the git repo and install: </li>
<ol>
<li><span style="font-family: "courier new" , "courier" , monospace;">cd ~/Documents </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">git clone https://github.com/grigorig/stcgal </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">cd stcgal </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">./setup.py build </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">sudo ./setup.py install </span></li>
</ol>
<li>Try downloading the ihx file into Black Board: </li>
<ol>
<li>Connect the CH340 USB-Serial board to your Ubuntu Computer. It will appear as /dev/ttyUSB0. The USB-Serial's pin header should be connected to STC15L2K32S2's UART header. </li>
<li><span style="font-family: "courier new" , "courier" , monospace;">cd ~/Documents/Black_Cloud_STC15L2K32S2/Blinky </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">sudo stcgal -P stc15 -p /dev/ttyUSB0 main.ihx </span></li>
<li>Turn on the power to the BlackBoard, this will cause the bootloader to initially run - stcgal will detect it and download the ihx file into the microcontroller's flash memory. The program will run immediately post downloading.</li>
</ol>
</ol>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbIaxECraVw-vEuug6ddS6et8efeVsYPnIwKtIZOeRtdiUD5R45EbTVzJbOkRtId6S83AMOAUYoOUre2d5g-lwItiQyTy6yQ5IBjeINeBgzKVI828Rg01BuI8eWR-BCTbyFQDLu-wdU30/s1600/8051+Blackboard+Download.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="652" data-original-width="1076" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbIaxECraVw-vEuug6ddS6et8efeVsYPnIwKtIZOeRtdiUD5R45EbTVzJbOkRtId6S83AMOAUYoOUre2d5g-lwItiQyTy6yQ5IBjeINeBgzKVI828Rg01BuI8eWR-BCTbyFQDLu-wdU30/s400/8051+Blackboard+Download.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Success downloading ihx to Black Board STC15L2K32S2</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dzHpWlT3Bpv2aXikJVDVGpFoh68Oj2wZt9fXLy1vuoMDxiSJoJaHJvs_s6O6KQ96bx2jps8WfSuineFIJ-c3w' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<div style="text-align: center;">
Blinky running on the Black Board</div>
</div>
<div>
<br />
Next try compiling and downloading the hello world program <br />
<ol style="text-align: left;">
<li><span style="font-family: "courier new" , "courier" , monospace;">cd ~/Documents/Black_Cloud_STC15L2K32S2/UART_Echo </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">sdcc -mmcs51 --verbose main.c </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">sudo stcgal -P stc15 -p /dev/ttyUSB0 main.ihx </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">sudo apt install minicom </span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">sudo minicom -D /dev/ttyUSB0 </span></li>
<li>Configure minicom </li>
<ol>
<li>Press Ctrl+A followed by Z </li>
<li>Press O </li>
<li>Select "serial port setup" </li>
<li>press F to change "Hardware Flow Control" to No </li>
<li>Press Enter </li>
<li>Select "Save setup as dfl" </li>
<li>Select exit </li>
</ol>
<li>Power cycle the Black Board and you will see the message printed on minicom </li>
<li>Press Ctrl+A X to leave minicom</li>
</ol>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdRltngd-iXAEJt0cwoQO2k4nOPjrhQxf7ClZbT6lg7egvC_f4x5axEHEUx3CwEFghQaaMa0YDgapwNS5n_nJEI7aFZDUSNBnJGefuIpdEDAE7nZ1cXJFsFwjidxb7XCpFBMAAppb4TSw/s1600/minicom+hello+world.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="543" data-original-width="788" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdRltngd-iXAEJt0cwoQO2k4nOPjrhQxf7ClZbT6lg7egvC_f4x5axEHEUx3CwEFghQaaMa0YDgapwNS5n_nJEI7aFZDUSNBnJGefuIpdEDAE7nZ1cXJFsFwjidxb7XCpFBMAAppb4TSw/s400/minicom+hello+world.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Message printed on minicom sent by Black Cloud's STC15L2K32S2</td></tr>
</tbody></table>
</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-72241373018849368802018-02-15T15:13:00.003+05:302018-04-09T16:50:09.089+05:30Linux Internals<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
What happens at boot?</h2>
<ol style="text-align: left;">
<li>Kernel Boot Process <a href="https://github.com/0xAX/linux-insides/tree/master/Booting">by 0xAX at Github</a></li>
<li>Analyzing the Linux boot process <a href="https://opensource.com/article/18/1/analyzing-linux-boot-process">by Alison Chaiken</a></li>
</ol>
<br />
<h2 style="text-align: left;">
What happens when a device is plugged in?</h2>
<ol style="text-align: left;">
<li>What actually happens when you plug in a USB device? <a href="https://www.technovelty.org/linux/what-actually-happens-when-you-plug-in-a-usb-device.html">by Ian Wienand</a></li>
</ol>
<br />
<h2 style="text-align: left;">
What happens when you execute a userspace programm from the command line?</h2>
<ol style="text-align: left;">
<li>How to show all shared libraries used by executables in Linux? <a href="https://stackoverflow.com/questions/50159/how-to-show-all-shared-libraries-used-by-executables-in-linux#">Stack Overflow</a></li>
<li>Loading of shared libraries and RAM usage <a href="https://unix.stackexchange.com/questions/116327/loading-of-shared-libraries-and-ram-usage">Unix & Linux Stack Exchange</a></li>
</ol>
<br />
<h2 style="text-align: left;">
What happens when you compile userspace applications?</h2>
<ol style="text-align: left;">
<li>How to write shared libraries? <a href="https://www.akkadia.org/drepper/dsohowto.pdf">by Ulrich Drepper</a></li>
<li>Static, Shared Dynamic and Loadable Linux Libraries <a href="http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html">YoLinux.com</a></li>
<li>Load-time relocation of shared libraries <a href="https://eli.thegreenplace.net/2011/08/25/load-time-relocation-of-shared-libraries/">eli.thegreenplace.net</a></li>
<li>Position Independent Code (PIC) in shared libraries <a href="https://eli.thegreenplace.net/2011/11/03/position-independent-code-pic-in-shared-libraries/">eli.thegreenplace.net</a></li>
<li>Where the top of the stack is on x86 <a href="https://eli.thegreenplace.net/2011/02/04/where-the-top-of-the-stack-is-on-x86/">eli.thegreenplace.net</a></li>
</ol>
<br />
<h2 style="text-align: left;">
What happens when you compile the kernel?</h2>
<ol style="text-align: left;">
<li>Shrinking the kernel with link-time garbage collection <a href="https://lwn.net/Articles/741494/">LWN.net</a></li>
<li>Shrinking the kernel with link-time optimization <a href="https://lwn.net/Articles/744507/">LWN.net</a></li>
<li>Shrinking the kernel with an axe <a href="https://lwn.net/Articles/746780/">LWN.net</a></li>
</ol>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-26684316692636202572018-02-01T00:46:00.002+05:302021-05-18T01:56:16.655+05:30Hacking "ESP8266 Black Board T5" Part 1 - Blinky on Keil<div dir="ltr" style="text-align: left;" trbidi="on">
A few months ago, I got my hands on <a href="https://www.amazon.in/ESP8266-Black-cloud-features-Board/dp/B0148HKRPS">ESP8266 Black cloud features Board T5</a> which has an ESP8266, an 8051 microcontroller and a few sensors. The 8051 microcontroller acts as a master to the ESP8266 and comes loaded with a demo program which is supposed to work with some android app. ESP8266 can be directly programmed using Arduino, so it would be better if I would reprogram the 8051 to act as a slave connected to ESP8266. The ESP8266 will run an Arduino sketch (that I would write) and ask the 8051 for the sensor readings (over UART). To do that I would need to program the 8051 with come C program that I have written.<br />
<br />
So the first step was to learn how to compile a simple blinky program for the 8051 and be able to download and run it on it.<br />
<br />
Links:<br />
<br />
<ol style="text-align: left;">
<li>Black Board T5 <a href="https://anxinke.gitbooks.io/balckboard/content/kuai_su_kai_shi.html">User guide</a> (in Chinese) explain how to use the android app (<a href="https://docs.bsfrance.fr/documentation/10532_AI_BLACKBOARD_T5/ESP8266_Black_board_T5.pdf">Translated version</a>)</li>
<li><a href="https://hackaday.io/project/9133-reworking-the-ai-thinker-black-board-t5">Reworking the AI Thinker "Black board T5</a></li>
<li><a href="https://drive.google.com/file/d/1LffU_C63xawxlIfOhkXvn25iKaeuarXN/view?usp=sharing">Schematic of Black Board T5</a> (You will need <a href="http://ttfonts.net/font/3567_Batang.htm">Batang </a>font to view it)</li>
<li><a href="https://drive.google.com/file/d/1Jfb3JOCiaEoz1MOJ_EL6aG3gfJau23BP/view?usp=sharing">Source code</a> (Keil uVision project) of the original code running inside 8051</li>
<li><a href="http://www.stcmicro.com/datasheet/STC15F2K60S2-en.pdf">Datasheet of STC15L2K32S2</a> (The 8051 Microcontroller present on Black board T5)</li>
<li><a href="https://drive.google.com/open?id=1Z5vPeHs3x3qUhAALX2DaB1I2QG0dZNDt">Android app</a> and its <a href="https://drive.google.com/open?id=15S0emis62takigmJ_u6BuYIf9d92rn3N">source code</a></li>
<li><a href="https://www.keil.com/demo/eval/c51.htm">Keil C51 Evaluation Kit ver 9.57</a> - C compiler for 8051</li>
<li><a href="http://www.stcmicro.com/rjxz.html">Windows utility (stc-isp-15xx-v6.86I.exe)</a> to program the flash memory of STC15L2K32S2 over its UART. The utility is in Chinese so you have to feel your way around it.</li>
</ol>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimwAb4jpnLrmSnk5XoTKA5mdsacZ8V2NzJziBQec9Sa6w14t27jkH4YVo8RxTqsMhBElTNY3C8lFIF13_Hhaibjm7ht7tVYKGSmabGpoTHWiZAmOMpkYF7VC7B34jlEIpuB-37nukb0uc/s1600/Black+board+T5+Schematic.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1036" data-original-width="1600" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimwAb4jpnLrmSnk5XoTKA5mdsacZ8V2NzJziBQec9Sa6w14t27jkH4YVo8RxTqsMhBElTNY3C8lFIF13_Hhaibjm7ht7tVYKGSmabGpoTHWiZAmOMpkYF7VC7B34jlEIpuB-37nukb0uc/s400/Black+board+T5+Schematic.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Schematic for Blackboard</td></tr>
</tbody></table>
<div>
STC15L2K32S2 has two UARTs (Serial Ports). One is connected to ESP8266 and the other one is brought out on the 3 pin header. The one brought out on the 3 pin header can be used to reprogram the microcontroller using the STC's ISP utility (In System Programming)</div>
<div>
<br /></div>
<div>
I used a USB-Serial convertor to connect 8051's UART like so:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiZarJecvG1TvTVQ3ii5DjpAuWFUXUmWOoG_fe20DSYr_tOJAVra2hoa4hvSXJF0IQgp689YOEdcLctK7VkGMLh1cYQmaKj-hQ76qtpAzbDwXTtBj4_eXj39fiDmq8C_bXDRNHMai-1DQ/s1600/IMG_20180201_003504595.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1600" data-original-width="1229" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiZarJecvG1TvTVQ3ii5DjpAuWFUXUmWOoG_fe20DSYr_tOJAVra2hoa4hvSXJF0IQgp689YOEdcLctK7VkGMLh1cYQmaKj-hQ76qtpAzbDwXTtBj4_eXj39fiDmq8C_bXDRNHMai-1DQ/s400/IMG_20180201_003504595.jpg" width="306" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">TxD, RxD, GND from CH340 board connected to Blackboad T5's R,T,G Signals respectively</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
To run blinky on 8051, I performed the following steps:</div>
<div>
<ol>
<li>Installed Keil C51 Evaluation Kit on my Windows Laptop</li>
<li>Connect the USB-Serial board to Blackboard</li>
<li>Install drivers for CH340 present on my USB-Serial board</li>
<li>Use the STC utility to install headers for STC microcontrollers to Keil. Keil doesn't come with support for STC microcontrollers built-in.</li>
<li>Use the STC utility to generate demo code for controlling PWM on STC15L2K32S2. Instead of copying the C code, click "Save project" to save a Keil C51 project - that way all the settings are exported as well.</li>
<li>Open the project in keil and build the project by pressing the F7 key. Hex file will be generated. The evaluation version is limited to generating 2kB of code, which is fine if you just want to blink LED using the PWM feature of STC15L2K32S2.</li>
<li>Go back to STC utility, select the MCU type as STC15L2K32S2</li>
<li>Select the appropriate COM Port</li>
<li>Load the hex file onto the STC utility (click Open Code File)</li>
<li>While the Black board T5 is connected to your computer via the CH340 board, keep the batteries installed in Black board T5 but keep it powered off</li>
<li>Click on "Download/Program" in STC utility</li>
<li>Turn on the power via the slide switch on the black board and watch the program download.</li>
<li>Once the program is complete, the code will run and LEDs will fade in and out.</li>
</ol>
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcXTpRKjse5nRUXrtlcJVtH1ZVoxqKVa2-LVOU1FoQxzsio0vgDqFGJeGyiEDWFEweF1rrErrWLskNzqbgkE8Aifn8QkjJ_IHmbOT82mOzFsJIKdl8XBG2ZpoiQd85Bgfwhqc_FVWwaVk/s1600/Install+Keil+Headers.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="581" data-original-width="1149" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcXTpRKjse5nRUXrtlcJVtH1ZVoxqKVa2-LVOU1FoQxzsio0vgDqFGJeGyiEDWFEweF1rrErrWLskNzqbgkE8Aifn8QkjJ_IHmbOT82mOzFsJIKdl8XBG2ZpoiQd85Bgfwhqc_FVWwaVk/s400/Install+Keil+Headers.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: 12.8px;">STC Utility: </span>Install headers for STC microcontrollers to Keil</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnjgr_XXi18R1Pc3Pc9yalhdoaQrV-0hw2asTnWOdWqgc2PCdNGPFdkL4ryMsPSILSZTeVezEunn7G0EZTA9vxdNrsBy2apPhs9DWVdp6sn5gO3p-5TiUcDq4ErAiSvh9SgkAOWBTfYks/s1600/Generate+Code+and+Save+project.png" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="590" data-original-width="817" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnjgr_XXi18R1Pc3Pc9yalhdoaQrV-0hw2asTnWOdWqgc2PCdNGPFdkL4ryMsPSILSZTeVezEunn7G0EZTA9vxdNrsBy2apPhs9DWVdp6sn5gO3p-5TiUcDq4ErAiSvh9SgkAOWBTfYks/s400/Generate+Code+and+Save+project.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">STC Utility: Generate demo code</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuzlRdvui30AKchNSRgWd7wwJP8xUBfX5r3adAXJLjfqDvUl7-b01jPcy-U0Pc-1c75IV33qlKOvGs9BGUwXNdWRMveGjfnqFtUSZpOvRIp6uqM-HGNyiOAlfblEOPqHyQuL5wuDy5W3w/s1600/Keil+Build+project.png" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="870" data-original-width="1600" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuzlRdvui30AKchNSRgWd7wwJP8xUBfX5r3adAXJLjfqDvUl7-b01jPcy-U0Pc-1c75IV33qlKOvGs9BGUwXNdWRMveGjfnqFtUSZpOvRIp6uqM-HGNyiOAlfblEOPqHyQuL5wuDy5W3w/s400/Keil+Build+project.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Keil C51 Evaluation kit: Build the program to generate hex file</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_YTqU9-oy26NLMQY5dmbLlnYiup6Sj5SamHTaDLBuSxb-HQw9moWnCsr2gak_XrDemvhMpdWZUM9jpAjbwr78uD5o2IYifriTxQwK4CWvpXc7papNj9uNrcsi-apHbD_QiQPzd2RXTbc/s1600/Download+program.png" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="946" data-original-width="1163" height="325" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_YTqU9-oy26NLMQY5dmbLlnYiup6Sj5SamHTaDLBuSxb-HQw9moWnCsr2gak_XrDemvhMpdWZUM9jpAjbwr78uD5o2IYifriTxQwK4CWvpXc7papNj9uNrcsi-apHbD_QiQPzd2RXTbc/s400/Download+program.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">STC Utility: select the correct microcontroller, com port,<br />
load the hex file and click Download/Program</td></tr>
</tbody></table>
<br />
<br />
Incase you aren't able to generate code from the STC utility, here is the link to the code (Keil C51 project): <a href="https://drive.google.com/file/d/1F_Y8Qkceez4Yju19VL2usZIXnkq3JBxi/view?usp=sharing" target="_blank">STC15L2K32S2_Hello_LED.rar</a></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-63308658373869820672018-01-31T23:03:00.000+05:302018-02-05T15:10:16.710+05:30googletest on Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Running gtests on your C++ programs using g++ on Ubuntu:<br />
<br />
<h3 style="text-align: left;">
Installation</h3>
<b><br /></b>
<b>Install CMake:</b>
<br />
<ul style="text-align: left;">
<li>sudo apt install cmake</li>
<li>Switch to home directory and:</li>
<li>git clone --depth 1 https://github.com/google/googletest.git</li>
</ul>
<br />
<b>Build it:</b><br />
<div style="text-align: left;">
</div>
<ul>
<li>cd ~/googletest</li>
<li>mkdir build</li>
<li>cd build</li>
<li>cmake -Dgtest_build_samples=ON -Dgtest_build_tests=ON ~/googletest</li>
<li>make</li>
<li>make test</li>
<li>./googlemock/gtest/sample1_unittest</li>
</ul>
<br />
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<b>Install the googletest and googlemock .a and .h files:</b></div>
<div style="text-align: left;">
</div>
<ul>
<li>sudo cp -r -v ~/googletest/googletest/include/gtest /usr/local/include</li>
<li>sudo cp -r -v ~/googletest/googlemock/include/gmock /usr/local/include</li>
<li>sudo cp -v ~/googletest/build/googlemock/lib*.a /usr/local/lib</li>
<li>sudo cp -v ~/googletest/build/googlemock/gtest/lib*.a /usr/local/lib</li>
</ul>
<br />
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
</div>
<h3 style="text-align: left;">
TEST() and code in same file - Test Fail</h3>
<script src="https://gist.github.com/lithiumhead/d821ea9b7632f65384f937a9be7eb0a3.js"></script>
To compile and run:
<br />
<ul style="text-align: left;">
<li>g++ 01sqrt_fail.cpp -lgtest -lpthread -o 01sqrt_fail</li>
<li>./01sqrt_fail</li>
</ul>
<div>
Output:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsOib81eRqmrNKnheJg28PMn4bF_h7IBYiSn-n89qU8ob9BwA9V6s3YsxEFbgjj3uZcMgwIGN7zmxTQtfXPv_K61_Sh0YHryAOAdB02bZfYAAXDGrebP0NQeOa6zzFxBdidHStQEwnQWs/s1600/01sqrt_fail.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="611" data-original-width="901" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsOib81eRqmrNKnheJg28PMn4bF_h7IBYiSn-n89qU8ob9BwA9V6s3YsxEFbgjj3uZcMgwIGN7zmxTQtfXPv_K61_Sh0YHryAOAdB02bZfYAAXDGrebP0NQeOa6zzFxBdidHStQEwnQWs/s400/01sqrt_fail.jpg" width="400" /></a></div>
<div>
<br /></div>
<div>
<hr />
<hr />
<br />
<h3 style="text-align: left;">
TEST() and code in same file - Test Pass</h3>
<script src="https://gist.github.com/lithiumhead/3354fa059f1f51bbbae71f9366915335.js"></script>
To compile and run:<br />
<ul style="text-align: left;">
<li>g++ 01sqrt_pass.cpp -lgtest -lpthread -o 01sqrt_pass</li>
<li>./01sqrt_pass</li>
</ul>
<div>
Output:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSSBpsqu022iviGTqkNEgqrKqRyaHYc4ij3hLXw51d8rQqRPbBE823v4oobSsOP-iPHgjerII4z1uyOvm2RVKfw3HuhZzoR9CTrOEEay3enJF1s0TxI8UNjARFa4XcJqYUvOByOUpTpr8/s1600/01sqrt_pass.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="390" data-original-width="1000" height="155" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSSBpsqu022iviGTqkNEgqrKqRyaHYc4ij3hLXw51d8rQqRPbBE823v4oobSsOP-iPHgjerII4z1uyOvm2RVKfw3HuhZzoR9CTrOEEay3enJF1s0TxI8UNjARFa4XcJqYUvOByOUpTpr8/s400/01sqrt_pass.jpg" width="400" /></a></div>
<div class="separator" style="clear: both;">
</div>
</div>
<div>
<br /></div>
<hr />
<hr />
<br />
<h3 style="text-align: left;">
TEST_F() and code in same file - Test Pass</h3>
<script src="https://gist.github.com/lithiumhead/bb6d522ba13363b74ba4201d1d21a750.js"></script>
To compile and run:<br />
<ul style="text-align: left;">
<li>g++ 02bankacc_pass.cpp -lgtest -lpthread -o 02bankacc_pass</li>
<li>./02bankacc_pass</li>
</ul>
<div>
Output:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0blhH5jX6FVbGMZ9W-0rq2GzzORNTZK9VS0FNpZYCjYCJTsaFyJuf1c7DqcQheHntQCGnPy3zA_ZiPodVSdE-fFMBuv2GOkInetEEkRqNH0bsv9IjCtP5wwqbtJWAmz8RcPomjPVkeKY/s1600/02bank_pass.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="356" data-original-width="1114" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0blhH5jX6FVbGMZ9W-0rq2GzzORNTZK9VS0FNpZYCjYCJTsaFyJuf1c7DqcQheHntQCGnPy3zA_ZiPodVSdE-fFMBuv2GOkInetEEkRqNH0bsv9IjCtP5wwqbtJWAmz8RcPomjPVkeKY/s400/02bank_pass.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both;">
</div>
<div>
<br /></div>
<hr />
<hr />
<br />
<h3 style="text-align: left;">
TEST_P() and code in same file - Test Fail</h3>
<script src="https://gist.github.com/lithiumhead/8aebd2db647b7a58b83d95d8188579f8.js"></script>
To compile and run:<br />
<ul style="text-align: left;">
<li>g++ 03bankacc_fail.cpp -std=c++11 -lgtest -lpthread -o 03bankacc_fail</li>
<li>./03bankacc_fail</li>
</ul>
<div>
Output:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_KIfBGphUN4H36vP3IFiBmb2KO049mcXtAt-YaKjtwO02QcjjV-757jxMTxITKLOyAuduacNlHrVR-1NbwFcJcgjcodLelsqcTUDshjTL94L9pXdmAGaimgfvS-Mlnu00F-7qlznQFYg/s1600/03bankacc_fail.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="598" data-original-width="1234" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_KIfBGphUN4H36vP3IFiBmb2KO049mcXtAt-YaKjtwO02QcjjV-757jxMTxITKLOyAuduacNlHrVR-1NbwFcJcgjcodLelsqcTUDshjTL94L9pXdmAGaimgfvS-Mlnu00F-7qlznQFYg/s400/03bankacc_fail.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both;">
</div>
<div>
<br /></div>
<hr />
<hr />
<br />
<h3 style="text-align: left;">
TEST_P() and code in same file - Test Fail and Formatted Output</h3>
<script src="https://gist.github.com/lithiumhead/d7f35f21a0f5a9af0ae6e5d536214d30.js"></script>
To compile and run:<br />
<ul style="text-align: left;">
<li>g++ 03bankacc_format.cpp -std=c++11 -lgtest -lpthread -o 03bankacc_format</li>
<li>./03bankacc_format</li>
</ul>
<div>
Output:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb44bZX4p0zSew6vVAJfXVEbf2fdxNPl3UasE5Bif1FqeZCrTfmJ5klHJYE_Nxt8lQ4g1pBMdISZU3tvJTAc__c4av9sbLEVb-IozkDOcuqHGp0wI-97RpdN8aTQoVt7sX6QEH39bvTmw/s1600/03bankacc_format.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="529" data-original-width="1385" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb44bZX4p0zSew6vVAJfXVEbf2fdxNPl3UasE5Bif1FqeZCrTfmJ5klHJYE_Nxt8lQ4g1pBMdISZU3tvJTAc__c4av9sbLEVb-IozkDOcuqHGp0wI-97RpdN8aTQoVt7sX6QEH39bvTmw/s400/03bankacc_format.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both;">
</div>
<div>
<br /></div>
<h3 style="text-align: left;">
References</h3>
<ol style="text-align: left;">
<li><b>Repository and Readme.md:</b><br /><a href="https://github.com/google/googletest">https://github.com/google/googletest</a><br /><br /></li>
<li><b>Build and install Google Test:</b><br /><a href="https://gist.github.com/massenz/41bb2c8375294f4d9927">https://gist.github.com/massenz/41bb2c8375294f4d9927</a><br /><br /></li>
<li><b>Primer:</b><br /><a href="https://github.com/google/googletest/blob/master/googletest/docs/Primer.md">https://github.com/google/googletest/blob/master/googletest/docs/Primer.md</a><br /><br /></li>
<li><b>C++ Unit Testing with Google Test Tutorial (Youtube):</b><br /><a href="https://www.youtube.com/watch?v=16FI1-d2P4E">https://www.youtube.com/watch?v=16FI1-d2P4E</a><br /><br /></li>
<li><b>StackOverflow: How to configure and setup google test framework in linux</b>
<a href="https://stackoverflow.com/questions/19810731/how-to-configure-and-setup-google-test-framework-in-linux">https://stackoverflow.com/questions/19810731/how-to-configure-and-setup-google-test-framework-in-linux</a><br /><br /></li>
<li><b>Some more gtest samples:</b><br /><a href="https://github.com/google/googletest/blob/master/googletest/docs/Samples.md">https://github.com/google/googletest/blob/master/googletest/docs/Samples.md</a><br /><br /></li>
</ol>
<a href="https://docs.google.com/document/d/e/2PACX-1vSbtrpzOt5N7hh_WRZOS65bsVQy1nYnHCpkhQ4UNwGkmMvtV7Qr22ePWlIX0nhp7vws1CYpKrhVjeEN/pub">Link to google doc containing above blog post</a></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-64959988196250596602018-01-10T19:25:00.002+05:302018-01-10T19:25:50.215+05:30MNO LAN: Use same MNOs SIM card in your IoT devices like GL-MiFi<div dir="ltr" style="text-align: left;" trbidi="on">
One of the big issues with IoT is somehow enabling two end nodes to communicate with each other in the presence of <a href="https://en.wikipedia.org/wiki/Network_address_translation">Network Address Translation (NAT)</a><br />
Now days most ISPs (and Mobile Network Operators or MNOs) use NAT by default and assign you local IP addresses in 10.*.*.* subnet. You usually have to pay an extra fee to get static global IP addresses assigned to you - this could be a security concern.<br />
If your end nodes run embedded linux, the following solutions can be used:<br />
<br />
<br />
<ol style="text-align: left;">
<li><b>Use <a href="https://en.wikipedia.org/wiki/Dynamic_DNS">DDNS</a> and <a href="https://en.wikipedia.org/wiki/Universal_Plug_and_Play">UPnP</a> together</b><br />DDNS is not usually free, but the manufacturer of your embedded linux device (routers from goodlife of Vstarcam's IP camera) might provide you this service for free as it uses almost nil resources on the server side. Most ISPs have UPnP support disabled on their gateway. In a home environment, if you have your own static global IP for your home router, you can use UPnP and DDNS to your advantage. An end node will use UPnP to request your WiFi Router to open ad forward certain outward facing ports to it and then. It will then detect the global IP address of its parent's gateway (in your case, your own home router) and register it with its DDNS server. You can then use the URL assigned to the device to access it from anywhere in the world.</li>
<li><b>Use Virtual Private Networking</b><br />Pay for a virtual private networking service and use OpenVPN clients on your end devices and bring them all on the same LAN</li>
<li><b>Use yaler.net</b><br />Its a paid reverse SSH relay service. Works well for SSH and HTTPS connections to your device</li>
<li><b>Use a server with a global IP address</b><br />Rent virtual VM from digital ocean or amazon or google and develop software for your devices to send data to or receive data from. this is what most manufacturers do for their IoT appliances.</li>
</ol>
<br />
There is a 5th option if:<br />
<br />
<ol style="text-align: left;">
<li>You are working on a DIY project - handful of embedded linux devices with SSH access.</li>
<li>Your devices are located in the same geographical area (i.e. within the same telecom circle)</li>
<li>Your devices have 3G/4G modem</li>
</ol>
<div>
The trick is to stick the same network operators SIM card in all your devices. All these devices will be assigned IP addresses on the same subnet and would be able to ping each other.</div>
<div>
<br /></div>
<div>
The 10.*.*.* only allows around 16 million unique IP addresses and so I have reason to believe that in India, different MNO circles would be on different logical LANs</div>
<div>
<br /></div>
<div>
Here are the results of my tests - I used two <a href="https://www.gl-inet.com/mifi/">GL-MiFi</a> with 4G modems in them with Reliance Jio 4G SIM cards. Both the devices were located within Maharashtra (one in Pune and other in Talegaon)</div>
<div>
<br /></div>
<div>
I opened the outward facing ports on GL-MiFi and deactivated the firewall on them.</div>
<div>
I then conducted iperf tests and here is what I got. It seems that we can easily transfer data between the devices at around 1-2 Mbps while on the Jio network.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguSI1d7OmdPJALz3hUD50JgnYaGh937tfFZWgxMldwQLfm9bAWKLdhO1TlAEq4tB0I1M7wu5dKAiqop5g-lS9HX4_V6UNSzUGhOK6kb6vgbxez0WHzQMkWJRCjmM65JqrBKpp6xGbEZFM/s1600/Jio+4G+LAN+electronicsfaq.com.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1430" data-original-width="1600" height="571" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguSI1d7OmdPJALz3hUD50JgnYaGh937tfFZWgxMldwQLfm9bAWKLdhO1TlAEq4tB0I1M7wu5dKAiqop5g-lS9HX4_V6UNSzUGhOK6kb6vgbxez0WHzQMkWJRCjmM65JqrBKpp6xGbEZFM/s640/Jio+4G+LAN+electronicsfaq.com.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Results. <a href="https://drive.google.com/open?id=1zixcqP_KyPMapLlgbr9XDDeGHPjGxAAJ">PDF is here</a>.</td></tr>
</tbody></table>
<br /></div>
<div>
<br /></div>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-77647149640516037252018-01-10T18:30:00.000+05:302018-01-10T18:49:59.034+05:30TurboPower<div dir="ltr" style="text-align: left;" trbidi="on">
We all want our smartphone to charge quickly. And different phone manufacturers have either created their own <a href="https://www.androidauthority.com/fast-charging-standards-compared-669624/" target="_blank">propriety </a>method of charging (Oppo VOOC or MediaTek PumpExpress+ or Motorola's TurboPower or OnePlus's Dash) or have opted to comply with a industry wide standard like Qualcomm's <a href="https://www.qualcomm.com/solutions/mobile-computing/features/quick-charge" target="_blank">Quick Charge</a> series of standards).<br />
These technology work my allowing a phone to tell the charger to step up the voltage beyond 5 volts so that the power available to the phone for charging the battery is more than what a good 5 volt / 2 ampere wall/car charger can supply.<br />
<br />
I have a Moto G4 plus and I wanted to make sure that I had access to fast charging at home/office, in car or while travelling. So I went ahead and got the following accessories<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRCTEGU5F3ZoldPrQHipRv8UtWj9-z2Sfq6SMoA042fvahxwg5-uETudQg_wH1RALY1AQXBAgbPC_BpUkDuA7coJvfU6lC3zA5fKeycZhxMx3SKcpNsdQ7ClEHRmg3SX5OQuiBcGGfxVY/s1600/IMG_8375.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1067" data-original-width="1600" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRCTEGU5F3ZoldPrQHipRv8UtWj9-z2Sfq6SMoA042fvahxwg5-uETudQg_wH1RALY1AQXBAgbPC_BpUkDuA7coJvfU6lC3zA5fKeycZhxMx3SKcpNsdQ7ClEHRmg3SX5OQuiBcGGfxVY/s400/IMG_8375.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">My Moto G4 plus along with the various charging accessories</td></tr>
</tbody></table>
<h3 style="text-align: left;">
Voltmeter</h3>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhnaE4C7gA66eaF2QwMtjeDhEX4ZE_OI4IOpbzslzAls2Xp6WG4obHym4ah-dcBCyCJFCcG9zkPSbQzokE8zkU4Y_pz92_obvIR6DEARDTaqCpiyJpSI73IKa9cBoFBupvaoUKtE3CluQ/s1600/USB+Voltmeter+stick.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="450" data-original-width="279" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhnaE4C7gA66eaF2QwMtjeDhEX4ZE_OI4IOpbzslzAls2Xp6WG4obHym4ah-dcBCyCJFCcG9zkPSbQzokE8zkU4Y_pz92_obvIR6DEARDTaqCpiyJpSI73IKa9cBoFBupvaoUKtE3CluQ/s320/USB+Voltmeter+stick.jpg" width="198" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">USB Voltmeter Stick</td></tr>
</tbody></table>
<div>
<br /></div>
<ul style="text-align: left;">
<li>This small device is what allowed me to check at what voltage/current the various chargers were charging my phone or regular devices.</li>
<li>It has a USB male and female receptacle so that it can sit between the charger and the USB cable.</li>
<li>It shows the voltage, current as well total mAh consumed during the past few hours - all these 4 parameters are shown on its OLED display. It ofcourse discounts the current it itself requires.</li>
<li>A reset button will allow you to reset the energy and time counter - The energy and time counters are stored in its non volatile memory and their values are preserved across power cycles so you need to reset them manually.</li>
<li>₹777.00 at <a href="https://www.amazon.in/gp/product/B01N46Y2JZ/" target="_blank">Amazon.in</a></li>
</ul>
<h3 style="text-align: left;">
Original TurboPower Charger that cam with your mobile phone</h3>
<div style="text-align: center;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggBD3mMEGGhJr37y3GK0Xae5cHFKxXbK4pRX_v8uexZCogsXplTPcXeVpDi4lj98_f5tBeMpFnORdzg0C7ll6U7Q2VUWcn9OpmpyShUsealOSdb4qSL0Gh89kFsJIZtRIlxXDePxDoBXs/s1600/Wall+Charger.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="500" data-original-width="500" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggBD3mMEGGhJr37y3GK0Xae5cHFKxXbK4pRX_v8uexZCogsXplTPcXeVpDi4lj98_f5tBeMpFnORdzg0C7ll6U7Q2VUWcn9OpmpyShUsealOSdb4qSL0Gh89kFsJIZtRIlxXDePxDoBXs/s320/Wall+Charger.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Wall Charger</td></tr>
</tbody></table>
</div>
<div>
<ul style="text-align: left;">
<li>Comes in the box when you buy your phone</li>
<li>There re two varieties of these chargers - one has a USB female socket in it and comes with a detachable microUSB cable while others have microUSB cable connected to it permanently. I have both of these but prefer the one with USB female socket</li>
<li>When I used the voltmeter to investigate the charger I discovered the following:</li>
<ul>
<li>It charges regular devices at 5.0 volts</li>
<li>It charges Moto G4 plus and Moto G5s plus at around 9.0 volts</li>
<li>It charges Qualcomm QC 3.0 compatible devices at around 11.5 volts</li>
</ul>
<li>Thankfully, its 2 pin has the correct diameter and distance between them to fit snugly in Indian AC main sockets - unlike those sad chargers which have europlugs which hang loosely when used with Indian sockets.</li>
<li>₹1,364.00 at <a href="https://www.amazon.in/Motorola-TurboPower-15-Charger-SPN5929A-SKN6461A-Charging/dp/B07611F9BY" target="_blank">Amazon.in</a> </li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-xmNTGUACYSv6zzjNTl47IDOXUaJHqTYB603RAQsi-z6eU6_Xrkz4sbNyNUzSGVmOEdN9o6H4kgVXSV3STLIoiZyVYjUdLbYZp3QFt2ql3XbNe39DYH6NtA6jZiwCTSCjL-l70m7tJDw/s1600/IMG_8385.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-xmNTGUACYSv6zzjNTl47IDOXUaJHqTYB603RAQsi-z6eU6_Xrkz4sbNyNUzSGVmOEdN9o6H4kgVXSV3STLIoiZyVYjUdLbYZp3QFt2ql3XbNe39DYH6NtA6jZiwCTSCjL-l70m7tJDw/s320/IMG_8385.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Charging a regular device at 5.0 volts</td></tr>
</tbody></table>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBQABau26wT_N6UHVuTnTF2BMYNqKXKCJUYGtDkwFXLH7evSQwr8zfm2QjlEstMulc3B9SRxSD9pvIcjY0fPKaQuk7ECKwEgeyXDSSoh4gRr1sZ0oRLAR6DnkMugyn4ZwBGH5yYzWrAcg/s1600/IMG_8384.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBQABau26wT_N6UHVuTnTF2BMYNqKXKCJUYGtDkwFXLH7evSQwr8zfm2QjlEstMulc3B9SRxSD9pvIcjY0fPKaQuk7ECKwEgeyXDSSoh4gRr1sZ0oRLAR6DnkMugyn4ZwBGH5yYzWrAcg/s320/IMG_8384.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Charging Moto G4 plus at around 9.0 volts</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
</div>
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsOeADSnwh1R89W_KP8F82XBtzxmFtZXyKbJbERrxeHEjuK6k8WwlICnZyVpRU7UfO9n40WTj7m4h5uie9m4H7WeFbulN5ubosMfX0G7G4cP3CKiMsHxy96hyphenhyphen8QNk37iwwLuh87d6lrb0/s1600/IMG_8383.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsOeADSnwh1R89W_KP8F82XBtzxmFtZXyKbJbERrxeHEjuK6k8WwlICnZyVpRU7UfO9n40WTj7m4h5uie9m4H7WeFbulN5ubosMfX0G7G4cP3CKiMsHxy96hyphenhyphen8QNk37iwwLuh87d6lrb0/s320/IMG_8383.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px;">Charging a QC 3.0 Power Bank at around 11.5 volts</td></tr>
</tbody></table>
<h3 style="text-align: left;">
TurboPower Car Charger</h3>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img alt="Motorola Turbo Power 15W Qualcomm 2.0 Quick Charge Car Charger (Black)" height="320" src="https://images-na.ssl-images-amazon.com/images/I/41kdk7k%2BShL.jpg" style="margin-left: auto; margin-right: auto;" width="320" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Car Charger</td></tr>
</tbody></table>
<ul style="text-align: left;">
<li>This charger is small and compact and is an original Motorola accessory which is bought separately.</li>
<li>Supports QC 2.0 devices (Qualcomm QuickCharge)</li>
<li>When I used the voltmeter to investigate the charger I discovered the following:</li>
<ul>
<li>It charges regular devices at 5.0 volts</li>
<li>It charges Moto G4 plus and Moto G5s plus at around 9.0 volts</li>
<li>It charges Qualcomm QC 3.0 compatible devices at around 11.5 volts</li>
</ul>
<li>₹990.00 at <a href="https://www.amazon.in/gp/product/B00WVV5JQ6" target="_blank">Amazon.in</a> </li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI71ZCg-VdQC5M6C-CQgEAisTViNSVxyruxrOFN5GjtSTAa2jEN7uOc-n6YfIwXGPJfzvaMUtUosb4GHV99NfnLraaIDPvhjq66H0NabPwsQg1ksMwhB0sCnBOP4vJ_jxXia-skGXmIhY/s1600/IMG_20180105_195307225.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI71ZCg-VdQC5M6C-CQgEAisTViNSVxyruxrOFN5GjtSTAa2jEN7uOc-n6YfIwXGPJfzvaMUtUosb4GHV99NfnLraaIDPvhjq66H0NabPwsQg1ksMwhB0sCnBOP4vJ_jxXia-skGXmIhY/s320/IMG_20180105_195307225.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Charging a regular device at 5.0 volts</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjG5bofjUoCFxUv_gkeE09IbiIusvax0HHGTN38IVs_jQmWzMLXsX9pHTYVFbFH1wShzxq5eAwAxbkS3yLv9PTUmIIbawahhlEQE2AMqMRj0REv3_ZouKKbsBBVsg-xGoUXFNsOBSnFpo/s1600/IMG_20180105_195221726.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjG5bofjUoCFxUv_gkeE09IbiIusvax0HHGTN38IVs_jQmWzMLXsX9pHTYVFbFH1wShzxq5eAwAxbkS3yLv9PTUmIIbawahhlEQE2AMqMRj0REv3_ZouKKbsBBVsg-xGoUXFNsOBSnFpo/s320/IMG_20180105_195221726.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Charging Moto G4 plus at around 9.0 volts</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikhCDQbx-N4AZIMOFnpYZea5bOeHOoTZoTW9cWFkQXBRnepeI-BWgSzyaEfcvDmReaacPhmZnLsqHLI0zgcSb8GR4ZcwK1S6vf49yamtVT6K94zMeSxrzcHOX5CB2OKUIB48FhaREEPGQ/s1600/IMG_20180105_195205225.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikhCDQbx-N4AZIMOFnpYZea5bOeHOoTZoTW9cWFkQXBRnepeI-BWgSzyaEfcvDmReaacPhmZnLsqHLI0zgcSb8GR4ZcwK1S6vf49yamtVT6K94zMeSxrzcHOX5CB2OKUIB48FhaREEPGQ/s320/IMG_20180105_195205225.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Charging a QC 3.0 Power Bank at around 11.5 volts</td></tr>
</tbody></table>
<h3 style="text-align: left;">
LCARE Qualcomm QC 3.0 Quick Charge Power Bank</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-QpRUSpBMOrDj4LSVGgECgRdXGJ3XaPlyqmC7aBVOTjqnOIZmYLp4nCWvDb-R-XhFuAl-r7QHS0ZjS5uP_3rSAb5YB9DyD3tCZYeeZ_3LPEkwfn8pJxiuXmBi9ERt-xcnKaWuhUQoptA/s1600/PowerBank.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="723" data-original-width="814" height="283" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-QpRUSpBMOrDj4LSVGgECgRdXGJ3XaPlyqmC7aBVOTjqnOIZmYLp4nCWvDb-R-XhFuAl-r7QHS0ZjS5uP_3rSAb5YB9DyD3tCZYeeZ_3LPEkwfn8pJxiuXmBi9ERt-xcnKaWuhUQoptA/s320/PowerBank.jpg" width="320" /></a></div>
<div>
<br /></div>
<div>
<ul style="text-align: left;">
<li>Now that I had charger for fixed sockets (Car and AC Mains) I wanted a portable power bank with fast charging technology as well. Motorola's TurboPower seemed compatible with QC 2.0/3.0 so I tried this particular powerbank and was pleasantly surprised.</li>
<li>When I used the voltmeter to investigate the charger I discovered the following:</li>
<ul>
<li>It charges regular devices at 5.0 volts</li>
<li>It charges Moto G4 plus and Moto G5s plus at around 9.0 volts</li>
</ul>
<li>The QC 3.0 technology is used in input as well as output sides. i.e. when you try to charge the power bank itself using any of motorola's original accessory - the car charger and the wall charger - you notice that those chargers themselves are able to charge the powerbank at around 11.5 volts - so basically you have a power bank that not only charges other devices quickly, but also itself gets charged quickly.</li>
<li>A backlit LCD display shows the charge level remaining in percentage numbers and also shows the charging technology being used</li>
<li>One downside - the powerbank cannot charge mobile devices when it is itself being charged.</li>
<li>₹1,755.00 at <a href="https://www.amazon.in/gp/product/B073TF58L3">Amazon.in</a></li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ-o92MeOYBXTBOGf6oZpv7NgOfcDnF8Ow3l6LIpqdr8wJvWi94BJw9L_Bjv2twQg1yIxOZIfHR0qJ6dVVpwT4jYbKOSow58ayNl8f3cIc1_rV47U9tjz5ZN563zwan-_V5Jc8n7bqf-8/s1600/IMG_8379.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ-o92MeOYBXTBOGf6oZpv7NgOfcDnF8Ow3l6LIpqdr8wJvWi94BJw9L_Bjv2twQg1yIxOZIfHR0qJ6dVVpwT4jYbKOSow58ayNl8f3cIc1_rV47U9tjz5ZN563zwan-_V5Jc8n7bqf-8/s320/IMG_8379.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Powerbank charging moto G4 plus at around 9.0 volts</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLKtDNmh8bBKBQHadhVM7HIvWYV92wjejZhbUDswSfQQFho6Ol2KvAWfEhQsWVAGy-FCTDnj0a8FWzcmReS_tMVRlVo_CV11mVuOzhfQFbyne78AfK6sqYOL1GIn1hSPnEVs4U3Tnyywg/s1600/IMG_8388.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLKtDNmh8bBKBQHadhVM7HIvWYV92wjejZhbUDswSfQQFho6Ol2KvAWfEhQsWVAGy-FCTDnj0a8FWzcmReS_tMVRlVo_CV11mVuOzhfQFbyne78AfK6sqYOL1GIn1hSPnEVs4U3Tnyywg/s320/IMG_8388.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Powerbank charging a regular bluetooth headset at 5.0 volts</td></tr>
</tbody></table>
<div>
<br /></div>
</div>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-19745767525467730882018-01-07T17:29:00.002+05:302018-01-08T00:51:50.407+05:30Food Silicone food savers + Glass bottles<div dir="ltr" style="text-align: left;" trbidi="on">
Plastics! Cancer! Correlation!<br />
And so we move away from plastic bottles to glass bottles.<br />
But glass bottles pretty but fragile.<br />
So what do we do?<br />
<br />
We get food huggers!!!<br />
Food huggers seemed onle somewhat useful to me all this while until now<br />
The silicone rubber food huggers will protect the bottom of the bottles - I was worried that I might end up banging them on the floor when I have a sip in the middle of the night.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtg7YZWr0NJAemN1EflsRb3eOzjeAF_mMC_PzJLbIiCXwshTS259QEcnYdGOloWEvbflCavImSQRoK5JfhCsxC6StWXftbRPREKN61Ex4voA7-4UN6-qVFKJdEj1R30-VP9ERifLsHW10/s1600/41DYM559v%252BL.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="500" data-original-width="500" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtg7YZWr0NJAemN1EflsRb3eOzjeAF_mMC_PzJLbIiCXwshTS259QEcnYdGOloWEvbflCavImSQRoK5JfhCsxC6StWXftbRPREKN61Ex4voA7-4UN6-qVFKJdEj1R30-VP9ERifLsHW10/s320/41DYM559v%252BL.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Color Glass bottles</td></tr>
</tbody></table>
<div style="text-align: center;">
<span style="color: red; font-size: x-large;"><b> +</b></span></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjICWyHSmStiIOrObq03mLr47kjsrQW76cbh5IyGK2Jz4xPueRCA4VVjJRq2AIe_LGDhZATQPRWS3UHj80Gbgwlkh7ND7SEfEZDOO5ePiRTZcJltNxIgLTxTYGyHyikJW0FIaLmbab833E/s1600/512vZiQwk-L._SL1001_.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1001" data-original-width="1001" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjICWyHSmStiIOrObq03mLr47kjsrQW76cbh5IyGK2Jz4xPueRCA4VVjJRq2AIe_LGDhZATQPRWS3UHj80Gbgwlkh7ND7SEfEZDOO5ePiRTZcJltNxIgLTxTYGyHyikJW0FIaLmbab833E/s320/512vZiQwk-L._SL1001_.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Silicone food hugger</td></tr>
</tbody></table>
<span style="color: red; font-size: x-large; text-align: center;"><br /></span>
<br />
<div style="text-align: center;">
<span style="color: red; font-size: x-large;"><b> =</b></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNujuunFZNUaibnlczhERPOxRjCmKoyZ8Om1EVuljA8lGbgI5o4VBuv1tw5wtoxroRrWPbI8XSTCfhxw56a0nfqlFxCTFftua7X4l2D77gjZbLwhlxt5cvU6o1oNOP97g9vfnLOiWr40A/s1600/IMG_8389.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1244" data-original-width="1600" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNujuunFZNUaibnlczhERPOxRjCmKoyZ8Om1EVuljA8lGbgI5o4VBuv1tw5wtoxroRrWPbI8XSTCfhxw56a0nfqlFxCTFftua7X4l2D77gjZbLwhlxt5cvU6o1oNOP97g9vfnLOiWr40A/s400/IMG_8389.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqzSwQoaMhaesjhwO8nI1m4lZMsxIiBRSYT-pxHkTrX_MOYw70uhsHTfuFk-TZ9wCQoQo4d9Gwzm30qZky3z3G-HqK-FmkQc5EtXq0HJ6Q1RkfOovhriREKsLrnVeVM7EAm0gwZlL9ZvE/s1600/IMG_8399.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1222" data-original-width="1600" height="305" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqzSwQoaMhaesjhwO8nI1m4lZMsxIiBRSYT-pxHkTrX_MOYw70uhsHTfuFk-TZ9wCQoQo4d9Gwzm30qZky3z3G-HqK-FmkQc5EtXq0HJ6Q1RkfOovhriREKsLrnVeVM7EAm0gwZlL9ZvE/s400/IMG_8399.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;">
Amazon.in links:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ol style="text-align: left;">
<li><a href="https://www.amazon.in/gp/product/B071LPWGYS/" target="_blank">Food huggers/savers</a></li>
<li><a href="https://www.amazon.in/gp/product/B01MS9UTVQ/" target="_blank">Glass bottles</a></li>
</ol>
<div>
Note:<br />
<br />
<ol style="text-align: left;">
<li>The food huggers come as a set of 4. Only the two larger ones have diameters large enough for the glass bottles linked to above. The smaller two won't fit.<br />So if you get 6 bottles, you will need to order 3 sets of food huggers. Of the 12 pieces of food huggers, you will end up using only 6 of them.</li>
<li>Various sized food huggers seem to be colored differently to match the color of the vegetable/fruit they are supposed to protect. Yellow is for lemons, Purple for onions, Green for capsicum, Red for tomatoes. This is a good thing - food huggers come in various colors and so do the glass bottles. So there is a very high chance that you would end up getting matching cushions for each bottle except for the blue one.</li>
<li>These silicone rubber huggers can also be used for green tea flasks as well.</li>
<li>Also, here are some photos on how these huggers can protect half cut vegetables from drying up when left in the fridge.</li>
</ol>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilWf2d9dfuu9xbqWr274WfL5nl2s6Q4WELQo8fEj3-dhoz6-zVMQQDmNEJSqJdlIGQoOo7edUuXlPpAWov7VA_nmdCGGw98pkI4bDQNzgCs8omACEAr_zL2iSu4i4FJR7M0N0-vZvxxaA/s1600/IMG_20180107_232309100.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilWf2d9dfuu9xbqWr274WfL5nl2s6Q4WELQo8fEj3-dhoz6-zVMQQDmNEJSqJdlIGQoOo7edUuXlPpAWov7VA_nmdCGGw98pkI4bDQNzgCs8omACEAr_zL2iSu4i4FJR7M0N0-vZvxxaA/s320/IMG_20180107_232309100.jpg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2t-ppaXW4f9kpq5g4UfZT1t3s3r8ZNWo__VDjhXSVRUnduqWt1bT_laWMyhTMOG-mMFlIeAZQK2_O9exjI61_vDgoRPKryXW9kax4dc3eKwDh29lYGk58jC1caMx4xlNbNp-w8L1zm7g/s1600/IMG_20180107_232335011.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2t-ppaXW4f9kpq5g4UfZT1t3s3r8ZNWo__VDjhXSVRUnduqWt1bT_laWMyhTMOG-mMFlIeAZQK2_O9exjI61_vDgoRPKryXW9kax4dc3eKwDh29lYGk58jC1caMx4xlNbNp-w8L1zm7g/s320/IMG_20180107_232335011.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ6NXOFts55eoCRY4J23qD_gJ8x-DOHliNHUjNvOC1Qjx3N8fbSrwBGF-o_MHOoArMXoA4ZzHq2HXfpiQoRfAgceKmE29WtEZ4zizU_nCe25JXimO-jHPcPAkykr0ObDD-f9KG7MGqrVY/s1600/IMG_20180107_232510415.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ6NXOFts55eoCRY4J23qD_gJ8x-DOHliNHUjNvOC1Qjx3N8fbSrwBGF-o_MHOoArMXoA4ZzHq2HXfpiQoRfAgceKmE29WtEZ4zizU_nCe25JXimO-jHPcPAkykr0ObDD-f9KG7MGqrVY/s320/IMG_20180107_232510415.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJi1AA7o_iWONKqz1aPcp2if2Be4B3bsMguEOcWjcOK8WNdlqJwq_dAiCA8DiZ0VvRuOSt3J-DflM3PBfbMNVWwXs7eK0Pr7koSNVh4q5QsY6B-U_lE7UGz96ktIXC3MRD7TXFPdu669I/s1600/IMG_20180107_232519136.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJi1AA7o_iWONKqz1aPcp2if2Be4B3bsMguEOcWjcOK8WNdlqJwq_dAiCA8DiZ0VvRuOSt3J-DflM3PBfbMNVWwXs7eK0Pr7koSNVh4q5QsY6B-U_lE7UGz96ktIXC3MRD7TXFPdu669I/s320/IMG_20180107_232519136.jpg" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
<br />
<br /></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-26139519319839439652018-01-05T13:16:00.004+05:302021-05-30T10:55:07.098+05:30Adding new elements to OpenWrt's LuCI on GL-MiFi<div dir="ltr" style="text-align: left;" trbidi="on">
If you are an IoT enthusiast who uses devices that run OpenWrt (routers from <a href="https://www.gl-inet.com/products/" target="_blank">Goodlife</a>, or <a href="https://www.seeedstudio.com/LinkIt-Smart-7688-Duo-p-2574.html" target="_blank">MT7688</a>), you would have considered creating a plugin for LuCI so that you can expose the functionality of any sensors/actuators that you may have connected to your OpenWrt box via OpenWrt's builtin web console.<br />
<br />
<a href="https://wiki.openwrt.org/doc/devel/luci" target="_blank">This article </a>on openwrt.org's wiki will tell you exactly how to do that.<br />
As maybe obvious from the page, if you want to create dynamically generated web content, you will need to write lua scripts.<br />
<br />
When trying out the steps from the wiki article for my <a href="https://www.gl-inet.com/mifi/" target="_blank">GL-MiFi</a>, I had to modify the file locations for placing various script like so:<br /><br />
<br />
<ol style="text-align: left;">
<li><span style="font-family: Courier New, Courier, monospace;"><b>new_tab.lua </b></span>had to be placed in:<br /><span style="font-family: Courier New, Courier, monospace;">/usr/lib/lua/luci/controller/<b>myapp<br /></b></span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>cbi_tab.lua </b></span>had to be placed in:<br /><span style="font-family: Courier New, Courier, monospace;">/usr/lib/lua/luci/model/cbi/<b>myapp-mymodule<br /></b></span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>cbi_file </b></span>can be put in the same place as mentioned:<br /><span style="font-family: Courier New, Courier, monospace;">/etc/config<br /></span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>view_tab.htm </b></span>had to be placed in:<br /><span style="font-family: Courier New, Courier, monospace;">/usr/lib/lua/luci/view/<b>myapp-mymodule</b></span></li>
</ol>
<div>
<span style="font-family: inherit;">Once I had the placed the files in the right location, I could see them in the web UI</span></div><div>
<br /></div>
<div>
<span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></span></div>My next step is to modify the lua scripts to run executables in C to query the various sensors that I have connected to my OpenWrt devices and display the latest values within a tab in WebUI. <br /> <br /> <br /> I use the device specific SDK from OpenWrt to compile my C programs into executables. <br /> <br /> <br /> Later on I will package my lua scripts and C programs into a simple .ipkg packages that one can install on any OpenWrt device</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-58265247376473393862017-08-26T15:06:00.000+05:302017-09-04T12:11:47.938+05:30Build system comparison for C shared library: Manual vs. Makefile vs. Bazel<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Here is a simple code for shared library (.so) and an executable that uses it:</div>
<h4 style="text-align: left;">
<b>Library Source files (libhello.c and libhello.h):</b></h4>
<script src="https://gist.github.com/lithiumhead/eff09dce13ce4d2402381a7ca78de1ff.js"></script>
<script src="https://gist.github.com/lithiumhead/2921b8436136cddf830aee6f1810350a.js"></script>
<br />
<h4 style="text-align: left;">
Source for the executable that uses the above library (main.c):</h4>
</div>
<script src="https://gist.github.com/lithiumhead/d725ac3db4a0c59be7c2577347a39ebc.js"></script>
There are many ways to build and execute these sources. Lets look at three of them. The first one is a collection of manual commands that you need to execute in a particular order. The other two uses some form of build system. Before you proceed, make sure to have the C compiler installed on your Ubuntu PC. To do this, execute the following at the command prompt:<br />
<br />
<span style="color: blue; font-family: "courier new" , "courier" , monospace;"><b>sudo apt-get install build-essential git</b></span><br />
<span style="color: blue; font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<h4 style="text-align: left;">
Manual build:</h4>
<div>
(Reference: <a href="http://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html" target="_blank">http://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html</a>)<br />
Place the three source files in the same directory. Open the command prompt, switch to the same directory and execute the following commands to compile, execute and clean:<br />
<ol style="text-align: left;">
<li>Compilation</li>
<ol>
<li>Compiling the library sources into object files with Position Independent Code:<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace;"><b>gcc -c -Wall -Werror -fpic libhello.c</b></span></li>
<li>Creating a shared library from an object file<br /><b><span style="color: blue; font-family: "courier new" , "courier" , monospace;">gcc -shared -o libhello.so libhello.o</span></b></li>
<li>Linking with a shared library<br />(prefix "lib" will be automatically added to library name, -L is used to specify search folder)<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace;"><b>gcc -L$(pwd) -Wall -o main.exe main.c -lhello</b></span><br /><br />if there are any issues, use the command to debug linker: ld -lhello --verbose</li>
</ol>
<li>Running the executable</li>
<ol>
<li>Making the library available at runtime<br /><b><span style="color: blue; font-family: "courier new" , "courier" , monospace;">export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH</span></b></li>
<li> Run the binary<br /><b><span style="color: blue; font-family: "courier new" , "courier" , monospace;">./main.exe</span></b></li>
</ol>
<li>Cleaning</li>
<ol>
<li>Execute:<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace;"><b>rm -rf *.o *.so *.exe</b></span></li>
</ol>
</ol>
<div>
<h4>
Building using Makefile:</h4>
<h4>
<div>
<div style="font-weight: normal;">
Place the three source files in the same directory. Also create and place a new file "Makefile" with the following contents in the same directory:</div>
<div style="font-weight: normal;">
<script src="https://gist.github.com/lithiumhead/e7d47a967a22c3c22851af53ee1992d4.js"></script><br /></div>
<div style="font-weight: normal;">
Open the command prompt, switch to the same directory and execute the following commands to compile, execute and clean:</div>
<ol style="text-align: left;">
<li style="font-weight: normal;">Compilation</li>
<ul style="font-weight: normal;">
<li><b style="color: blue; font-family: "courier new", courier, monospace;">make all</b></li>
</ul>
<li style="font-weight: normal;">Running the executable</li>
<ol style="font-weight: normal;">
<li>Making the library available at runtime<br /><b><span style="color: blue; font-family: "courier new" , "courier" , monospace;">export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH</span></b></li>
<li> Run the binary<br /><b><span style="color: blue; font-family: "courier new" , "courier" , monospace;">./main.exe</span></b></li>
</ol>
<li style="font-weight: normal;">Cleaning</li>
<ul style="font-weight: normal;">
<li><b style="color: blue; font-family: "courier new", courier, monospace;">make clean</b></li>
</ul>
</ol>
</div>
</h4>
<h4>
Building using Bazel:</h4>
<h4>
<div style="font-weight: normal;">
<div>
</div>
<ol><ol style="font-weight: normal;">
</ol>
</ol>
</div>
</h4>
<h4>
<div>
<div style="font-weight: normal;">
To use <a href="https://bazel.build/" target="_blank">Bazel (The build system from Google)</a>, you need to first install it. Do so using following commands:</div>
<br />
<ol style="text-align: left;">
<li style="font-weight: normal;">Install JDK 8</li>
<ul>
<li><span style="color: blue; font-family: "courier new" , "courier" , monospace;">sudo apt-get install openjdk-8-jdk</span></li>
</ul>
<li style="font-weight: normal;">Add Bazel distribution URI as a package source (one time setup):</li>
<ul>
<li><span style="color: blue; font-family: "courier new" , "courier" , monospace;">echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list</span></li>
<li><span style="color: blue; font-family: "courier new" , "courier" , monospace;">curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -</span></li>
</ul>
<li style="font-weight: normal;">Install and update Bazel</li>
<ul>
<li><span style="color: blue; font-family: "courier new" , "courier" , monospace;">sudo apt-get update && sudo apt-get install bazel</span></li>
</ul>
</ol>
<div style="font-weight: normal;">
Next, create a directory structure like so:</div>
<div style="font-weight: normal;">
<br /></div>
<span style="font-weight: normal;"><span style="font-family: "courier new" , "courier" , monospace;">Current folder</span></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-weight: normal;">├─</span></span><span style="font-family: "courier new" , "courier" , monospace; font-weight: normal;">───</span><span style="font-weight: normal;"><span style="font-family: "courier new" , "courier" , monospace;">WORKSPACE <span style="color: red;">(Blank file)</span></span></span><br />
<span style="font-weight: normal;"><span style="font-family: "courier new" , "courier" , monospace;">│</span></span><br />
<span style="font-weight: normal;"><span style="font-family: "courier new" , "courier" , monospace;">└───main <span style="color: red;">(folder)</span></span></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-weight: normal;"> ├───</span></span><span style="font-weight: normal;"><span style="font-family: "courier new" , "courier" , monospace;">BUILD <span style="color: red;">(Bazel build script)</span></span></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-weight: normal;"> ├───</span></span><span style="font-weight: normal;"><span style="font-family: "courier new" , "courier" , monospace;">libhello.c</span></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-weight: normal;"> ├───</span></span><span style="font-weight: normal;"><span style="font-family: "courier new" , "courier" , monospace;">libhello.h</span></span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-weight: normal;"> └───</span><span style="font-weight: normal;"><span style="font-family: "courier new" , "courier" , monospace;">main.c</span></span><br />
<div>
<br /></div>
<span style="font-weight: normal;">The content of the BUILD file should be as follows:<br />
<script src="https://gist.github.com/lithiumhead/0f1129c312d7cf05540f9b1d76aa8b75.js"></script>
</span><br />
Now carry out the following commands to build the file using Bazel from the command prompt after changing to the directory with blank "WORKSPACE" file:
<br />
<ol style="text-align: left;">
<li style="font-weight: normal;">Compilation</li>
<ul style="font-weight: normal;">
<li><b style="color: blue; font-family: "courier new", courier, monospace;">bazel build //main:all</b></li>
</ul>
<li style="font-weight: normal;">Running the executable</li>
<ul>
<li><span style="color: blue; font-family: "courier new" , "courier" , monospace;">./bazel-bin/main/main.exe</span></li>
</ul>
<ol>
</ol>
<li style="font-weight: normal;">Cleaning</li>
<ul style="font-weight: normal;">
<li><b style="color: blue; font-family: "courier new", courier, monospace;">bazel clean</b></li>
</ul>
</ol>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiekL4DqFrN0XrDIrTpijjVxSawU0gIS8eSXc4cygLlVOqzB4F5nAcCL8hTN7H7jVuu_xkzS4TS84l5mnIGnciY9lPyX8Ex2DbpoB6nOVRwcVC-2pnopPuqAJ49MOaBPIWG8EQ_nKpUkvk/s1600/Screenshot+2017-08-26+15.03.14.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="483" data-original-width="1158" height="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiekL4DqFrN0XrDIrTpijjVxSawU0gIS8eSXc4cygLlVOqzB4F5nAcCL8hTN7H7jVuu_xkzS4TS84l5mnIGnciY9lPyX8Ex2DbpoB6nOVRwcVC-2pnopPuqAJ49MOaBPIWG8EQ_nKpUkvk/s400/Screenshot+2017-08-26+15.03.14.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Compiling, running and cleaning using Bazel</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrzYKNmdAsqvOs38GHENQ1eFf4ge0oTkMQdTftTqVKr59A36ycu2xBDX_yGdWiMawuYiNEc-yeZYigRh6PQm28b96CtnJ80A0e4EIridF4YQbrzMuv4T2-tW4VL_Un7x0MsF4C5scpSb0/s1600/Screenshot+2017-08-26+14.59.42.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="931" data-original-width="1562" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrzYKNmdAsqvOs38GHENQ1eFf4ge0oTkMQdTftTqVKr59A36ycu2xBDX_yGdWiMawuYiNEc-yeZYigRh6PQm28b96CtnJ80A0e4EIridF4YQbrzMuv4T2-tW4VL_Un7x0MsF4C5scpSb0/s400/Screenshot+2017-08-26+14.59.42.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Output files created in the working directory by Bazel</td></tr>
</tbody></table>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPi2cnC7H4HAKm4e_2Kra6ppbVwxR5iGvNvs9vaPxK_e90JEUKEylTh8p5B2wQMbkRNtKXIjZFJ0NhKc4fDoMNU3XjEVX7h17Rm4tX6BCWcAa_cDz9J1QArzNhN9GZQpqRmyLDd3WjPHI/s1600/Bazel+linkstatic.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="859" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPi2cnC7H4HAKm4e_2Kra6ppbVwxR5iGvNvs9vaPxK_e90JEUKEylTh8p5B2wQMbkRNtKXIjZFJ0NhKc4fDoMNU3XjEVX7h17Rm4tX6BCWcAa_cDz9J1QArzNhN9GZQpqRmyLDd3WjPHI/s400/Bazel+linkstatic.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">By default, (when linkstatic option is not specified in BUILD file), Bazel links libraries to executables statically. To disable that, specify linkstatic = 0</td></tr>
</tbody></table>
</div>
</div>
</h4>
</div>
</div>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-27245903181537581452017-07-17T13:24:00.000+05:302017-07-17T13:24:00.491+05:30My favourite alias in .bashrc on Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Colorizing and handling system/kernel logs<br />
<ul style="text-align: left;">
<li>alias logread='cat /var/log/syslog | ccze -A'</li>
<li>alias logclear='sudo truncate -s 0 /var/log/syslog'</li>
<li>alias logsave='cat /var/log/syslog | ccze -h > ~/log.html'</li>
<li>alias dmesgread='dmesg | ccze -A'</li>
<li>alias dmesgclear='sudo dmesg -c'</li>
<li>alias dmesgsave='dmesg | ccze -h > ~/log.html'</li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5CRh4nog2OOV8jDIoFAPmseYd8F0WPtv06BE-uGHUWrg4fN2U-IzL8a3CJbD_0OXQWF-9LN7mvOvAvAvzTwCQzid5m_v4Kd_PwwVc0LbzJ8w7KhaQNqt6PisFq7Wnbo0UmLn5U9T6VrU/s1600/Screenshot+from+2017-07-17+12-03-28.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="400" data-original-width="1475" height="171" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5CRh4nog2OOV8jDIoFAPmseYd8F0WPtv06BE-uGHUWrg4fN2U-IzL8a3CJbD_0OXQWF-9LN7mvOvAvAvzTwCQzid5m_v4Kd_PwwVc0LbzJ8w7KhaQNqt6PisFq7Wnbo0UmLn5U9T6VrU/s640/Screenshot+from+2017-07-17+12-03-28.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You will have to install ccze (sudo apt-get install ccze)</td></tr>
</tbody></table>
<br />
<br /></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-57202214996008969902017-07-13T01:28:00.002+05:302017-07-13T01:28:58.658+05:30Replacing batteries in Black and Decker DP240 2.4V Direct-Plug Rechargeable Screwdriver<div dir="ltr" style="text-align: left;" trbidi="on">
I have owned a <a href="http://www.blackanddecker.com/products/power-tools/portable-power-tools/screwdrivers/24v-directplug-rechargeable-screwdriver/dp240" target="_blank">Black and Decker DP240 Cordless Electric Screwdriver</a> for 5 years now. Its battery had started losing its capacity to hold charge, so I looked online to see if it was possible to change its batteries. I couldn't find any blog/DIY guide on which batteries to replace the internal ones with and how to go about pry open the screwdriver and putting it back. So here are some photos outlining how I changed the batteries in mine and turned it into new.<br />
<br />
To open the screwdrive, you will need a set of "Torx Pin 6 lobe" screwdriver set. You cant use regular torx screwdriver bits. You need ones with holes in the center of the bits so that the center pin on the screw can fit into those holes. You can buy just a set of <a href="http://www.ebay.co.uk/itm/TORX-PIN-6-LOBE-SECURITY-SCREWDRIVER-INSERT-BITS-TX10-15-20-25-27-30-40-45-/162199890679" target="_blank">just the bits here.</a><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhogKuebPrggnEQF5c-ECkS-2AqCXhUO7WvmDaYqlvXocA2aBBNnHyRxXOSvlawhoCsZXlRUiL3nvfX9sqT17lk-saT5gHqXRUvF6KbJbl_hGgJK7CvS2bX6yoeuOos-1xG6Cxe_XSnrVQ/s1600/IMG_8161.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1534" data-original-width="1600" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhogKuebPrggnEQF5c-ECkS-2AqCXhUO7WvmDaYqlvXocA2aBBNnHyRxXOSvlawhoCsZXlRUiL3nvfX9sqT17lk-saT5gHqXRUvF6KbJbl_hGgJK7CvS2bX6yoeuOos-1xG6Cxe_XSnrVQ/s320/IMG_8161.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Torx pin 6 lobe Screwdrivers to open the shell</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoZv3yjAWQaVAnrV4_2dVIRxBgKB6LukxJ2Tuj9xa6O1qjfCsTQHv96cLumWXb9MI8mPb5QQGqkwdIzAQZCxMPmlEx9_dKFY8m536A8FXQWfzdDRHI4jnumkt8teBOru_R4dcKqJ0-L80/s1600/IMG_8130.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoZv3yjAWQaVAnrV4_2dVIRxBgKB6LukxJ2Tuj9xa6O1qjfCsTQHv96cLumWXb9MI8mPb5QQGqkwdIzAQZCxMPmlEx9_dKFY8m536A8FXQWfzdDRHI4jnumkt8teBOru_R4dcKqJ0-L80/s320/IMG_8130.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Screwdriver with the shell opened<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFKqF2nxJSELcmS9-3zTeZ-PRLPXGYoVgE-MsLIaJxeGrDZAk5nmEe0oLJD4GnJAPMXiUVqVF_D9FjWvVI2PgxV_K5ZuNQ2yWvsnRvXwVYqSm2GxJPQkw9ATAEICEREefYZxgOLEIS-Zs/s1600/IMG_8155.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1399" data-original-width="1600" height="279" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFKqF2nxJSELcmS9-3zTeZ-PRLPXGYoVgE-MsLIaJxeGrDZAk5nmEe0oLJD4GnJAPMXiUVqVF_D9FjWvVI2PgxV_K5ZuNQ2yWvsnRvXwVYqSm2GxJPQkw9ATAEICEREefYZxgOLEIS-Zs/s320/IMG_8155.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px;">It seems that the screwdriver comes with two AA size<br style="font-size: 12.8px;" /><span style="font-size: 12.8px;">1.2V NiCd 800 mAh cells installed</span></td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHwxiFs4yMvEy-li21VFeeL97QmWK3KKntbTrRTiqW5jmRmv8FK0WSSfJvon3ZXyeRDinaatVB9GHa9cQMk6TWGtobqA1Gl8io9umE6mkLGm55DGVfopX8GgtNLwmVFcZmoykJIdAF2fI/s1600/IMG_8134.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHwxiFs4yMvEy-li21VFeeL97QmWK3KKntbTrRTiqW5jmRmv8FK0WSSfJvon3ZXyeRDinaatVB9GHa9cQMk6TWGtobqA1Gl8io9umE6mkLGm55DGVfopX8GgtNLwmVFcZmoykJIdAF2fI/s320/IMG_8134.JPG" width="320" /></a></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheeufHjMHNMeBaxonqPYlIW3IOzy2h3ccZYCFNuZCUhPg_Y3_1qGvw0YqA68PODZ4Did57M4sukBYU0_tWC50POfbzffir71bNiHYQlplCwKZyKEtj9Ju8GghpKoSXFxDjyP3O5QRWuqQ/s1600/IMG_8135.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheeufHjMHNMeBaxonqPYlIW3IOzy2h3ccZYCFNuZCUhPg_Y3_1qGvw0YqA68PODZ4Did57M4sukBYU0_tWC50POfbzffir71bNiHYQlplCwKZyKEtj9Ju8GghpKoSXFxDjyP3O5QRWuqQ/s320/IMG_8135.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I replaced the 800mAh batteries with <a href="http://www.amazon.in/Panasonic-Eneloop-2550mAh-Rechargeable-BK-3HCCE/dp/B00JHKSL28?_encoding=UTF8&tag=googinhydr18418-21" target="_blank">2550 mAh NiMH cells</a><br />eneloop by Panasonic is the best brand of NiMH cells</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrFZLzVxncTviIV_Y4DJM-Bv9rkpDIb_nSG7RdqtHulqqKVJEhHg1F8_o3dd1BoT4CJv13nxhy_0U3ZsKf6OHF_P2dzVhLpFunNlaLvmYozKR1W-HefSWMEEqjuW7Xa834UM3B28gw9JI/s1600/IMG_8150.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1453" data-original-width="1600" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrFZLzVxncTviIV_Y4DJM-Bv9rkpDIb_nSG7RdqtHulqqKVJEhHg1F8_o3dd1BoT4CJv13nxhy_0U3ZsKf6OHF_P2dzVhLpFunNlaLvmYozKR1W-HefSWMEEqjuW7Xa834UM3B28gw9JI/s320/IMG_8150.JPG" width="320" /></a></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh02OrgoBOIavrmoYdPZ6ZW4N7w_po_H7MmEk1L6KSxh7F3XsLE3Pbpv-MlbNz50zR-T2em0Up7zS0lZgf5BTOh6-9HD3gZEc8epTEpiU8ADISbJiX1v6geZIiiYGY41uvGTzq_51Nz_vQ/s1600/IMG_8151.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1482" data-original-width="1600" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh02OrgoBOIavrmoYdPZ6ZW4N7w_po_H7MmEk1L6KSxh7F3XsLE3Pbpv-MlbNz50zR-T2em0Up7zS0lZgf5BTOh6-9HD3gZEc8epTEpiU8ADISbJiX1v6geZIiiYGY41uvGTzq_51Nz_vQ/s320/IMG_8151.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Soldering wires onto the cells</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN_gRw4xVR6OQzoe95VgY-93sqP9R82PzjruwsQ_8pGCuQsUx3e9ssiHlhPzOxjrbEBoD9g4MNGgLPLEwtx_FbJ8pWyKTlyQBrWZw69mu8SUiYx3qMZZZlGDIMr-tG_fXkLPf9DAfX7zE/s1600/IMG_8153.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1527" data-original-width="1600" height="305" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN_gRw4xVR6OQzoe95VgY-93sqP9R82PzjruwsQ_8pGCuQsUx3e9ssiHlhPzOxjrbEBoD9g4MNGgLPLEwtx_FbJ8pWyKTlyQBrWZw69mu8SUiYx3qMZZZlGDIMr-tG_fXkLPf9DAfX7zE/s320/IMG_8153.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">And putting the screw driver back together</td></tr>
</tbody></table>
<br />
<br /></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com2tag:blogger.com,1999:blog-8517901213371477159.post-18159049781898879772017-05-11T08:55:00.002+05:302017-05-11T08:56:35.609+05:30Come C tricks<div dir="ltr" style="text-align: left;" trbidi="on">
Swapping the values of two variables with out using a third!!<br />
x = x ^ y;<br />
y = x ^ y;<br />
x = x ^ y;<br />
All hail the XOR operation<br />
Reference: <a href="https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/xor.html" target="_blank">https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/xor.html</a><br />
<hr />
<br />
int c;<br />
c &= (c-1);<br />
check if c == 0<br />
<br />
This allows you to check if C is a power of 2 (i.e. 0,1,2,4,8...)<br />
<br />
<hr />
<br />
Reading sentences (including spaces) from stdin:<br />
<br />
scanf("%s",str); can't read spaces in input string.<br />
To do that, you have to:
scanf(" %[^\n]s",str);<br />
<br />
Note the space before % within the quotes.<br />
<br />
Reference: <a href="https://gpraveenkumar.wordpress.com/2009/06/10/how-to-use-scanf-to-read-string-with-space/" target="_blank">https://gpraveenkumar.wordpress.com/2009/06/10/how-to-use-scanf-to-read-string-with-space/</a></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-26085194902601240952017-05-01T18:00:00.001+05:302017-05-01T18:01:24.254+05:30Set Elon's latest tweet as your desktop wallpaper<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
If you have an Ubuntu box, you can use a script to to set your wallpaper's to Elon's Latest Tweet.<br />
<div>
<br /></div>
<div>
Here is how you setup:</div>
<div>
<ol style="text-align: left;">
<li>Install required packages.</li>
<li>Download tweet.sh - an OAuth based twitter client implemented completely as a bash script.</li>
<li>Get Token keys for from your Twitter account and save it in the config file. You need this for OAuth that twee.sh uses.</li>
<li>Get a free account on <a href="http://www.page2images.com/" target="_blank">http://www.page2images.com/</a> and fetch your API keys. This service allows you to generate screenshot of any supplied URL - you can use this service to to fetch PNGs's of Elon's tweets. We do screenshots because aren't just interested in tweet's text but also any images that Elon chooses to attach with his tweets.</li>
<li>In the batch script (elon_tweet.sh) appended below, configure the pages2images API key</li>
<li>Setup the batch script (elon_tweet.sh) as a cron job which runs once every minute.</li>
</ol>
<div>
You can set this script up on a Raspberry Pi running Raspbian connected to your TV as well. Its always nice to have some inspiration trickling in while you work.</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9vDoq4jc-aFSfKjmMrW2LI2Fc-6z9auT36OwDyfQd8QKrj9tYwlssSUGQFlAfpZ4VdU7ZZkAtTOaByd90bu-iShc4hcncVAkO53KDu0hLZEU_GHj-r3mwdrNF5j8oMA53Koq2DtTiyzA/s1600/Screenshot+from+2017-05-01+11-29-36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9vDoq4jc-aFSfKjmMrW2LI2Fc-6z9auT36OwDyfQd8QKrj9tYwlssSUGQFlAfpZ4VdU7ZZkAtTOaByd90bu-iShc4hcncVAkO53KDu0hLZEU_GHj-r3mwdrNF5j8oMA53Koq2DtTiyzA/s320/Screenshot+from+2017-05-01+11-29-36.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc77GXCpnn0yxbXlixqnL5LHKv_Hq_Dg3m3x-oU3O1UyKW-cGoLtuD3m3xQQuBUDA3uj7MK5xyUVqY_2HpLr2LNOy4WmmxtA-VabDpV0bp2-967mJSZ_jbVkPGrGUa2TZR4ipNsruqVUI/s1600/Screenshot+from+2017-05-01+11-30-58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc77GXCpnn0yxbXlixqnL5LHKv_Hq_Dg3m3x-oU3O1UyKW-cGoLtuD3m3xQQuBUDA3uj7MK5xyUVqY_2HpLr2LNOy4WmmxtA-VabDpV0bp2-967mJSZ_jbVkPGrGUa2TZR4ipNsruqVUI/s320/Screenshot+from+2017-05-01+11-30-58.png" width="320" /></a></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeklpLwF7Xv_8mlgvOib7c0rMlVb3koUzEwvSrYnAJ4rIrBGHh8C3Y8ZGGZESJxl5Y1NeaYKAlXN2oLzLVnlXwDWlBZAKQfOn8IrehBlHrV9ml1ogAt4VEdJWW8CCT1KVEd9-jLqvDYzA/s1600/Screenshot+from+2017-05-01+12-34-44.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeklpLwF7Xv_8mlgvOib7c0rMlVb3koUzEwvSrYnAJ4rIrBGHh8C3Y8ZGGZESJxl5Y1NeaYKAlXN2oLzLVnlXwDWlBZAKQfOn8IrehBlHrV9ml1ogAt4VEdJWW8CCT1KVEd9-jLqvDYzA/s320/Screenshot+from+2017-05-01+12-34-44.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Here is how my desktop looks like</td></tr>
</tbody></table>
<div>
Here's how to go about putting the pieces together:</div>
<div>
<ol style="text-align: left;">
<li>Open a terminal window and install the required software on your ubuntu box:<br /><span style="color: magenta; font-family: "courier new" , "courier" , monospace;"><b>sudo apt-get install jq imagemagick pngcrush nkf</b></span></li>
<li>Clone <a href="https://github.com/piroor/tweet.sh" target="_blank">https://github.com/piroor/tweet.sh</a> and place <b>tweet.sh</b> and <b>tweet.client.key</b> in your home directory</li>
<li>While logged into Twitter, visit <a href="https://apps.twitter.com/" target="_blank">https://apps.twitter.com/</a> and create a new app and generate the required Token and Keys and place them in <b>tweet.client.key</b></li>
<li>Mark tweet.sh as executable:<br /><span style="color: magenta; font-family: "courier new" , "courier" , monospace;"><b>sudo chmod +x tweet.sh</b></span></li>
<li>Register on <a href="http://www.page2images.com/" target="_blank">http://www.page2images.com/</a> and get your API key</li>
<li>Create a new script called <b>elon_tweet.sh</b> in your home folder and copy and paste the code snippet appended below.</li>
<li>Edit <b>elon_tweet.sh</b> and insert the pages2image API key at the appropriate location.</li>
<li>Mark <b>elon_tweet.sh</b> as executable:</li>
<li>Set the script to run once every minute:<br /><span style="color: magenta; font-family: "courier new" , "courier" , monospace;"><b>crontab -e</b></span><br />and insert the following line:<br /><span style="color: magenta; font-family: "courier new" , "courier" , monospace;"><b>* * * * * bash ~/elon_tweet.sh</b></span></li>
</ol>
</div>
<div>
The script will run once every minute and will check if there is any new tweet from Elon since last check. If there is, it will submit the URL for screenshot generation and exit. When the script is run again at the next consecutive minute, it will fetch the image, crop it and set it up as wallpaper. If Elon has put up a new tweet, the URL of this new tweet is submitted for screenshot and the script exits. In such situation, you will miss out the 2nd tweet if the time difference between 1st and 3rd tweet is less than 2 minutes - this can be fixed in the script, but it seemed to be a bit much. Thank God Elon doesn't go crazy on twitter. All the tweets are saved in the Pictures folder.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn6If71n_VC4rHbJtKpb4zuxhKc3KaAFXPkmL3qNEYyUDcIvgafbl4qj3WD9blFhkHrfRgd9Dq88rNlj8qANMvEi6Lapd1LjrBgkeH7154aSnbsl01NeQwHwIRTB5xrhPftcTzevZuK3g/s1600/Screenshot+from+2017-05-01+12-35-11.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="202" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn6If71n_VC4rHbJtKpb4zuxhKc3KaAFXPkmL3qNEYyUDcIvgafbl4qj3WD9blFhkHrfRgd9Dq88rNlj8qANMvEi6Lapd1LjrBgkeH7154aSnbsl01NeQwHwIRTB5xrhPftcTzevZuK3g/s400/Screenshot+from+2017-05-01+12-35-11.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Tweet screenshots are saved in Pictures folder</td></tr>
</tbody></table>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3B_PLr5FZI0ilwOgXzN78r0Gyu-0I7OE2bLOgCJQWtHLGT7QgOmaqLFlRpeNVU3nzQ86lV9SB5vSIKR6WF6UvEyhJFajCJ1ql8T5E_eYCJtETduBzIloYhyphenhyphendQFE-YdiwuDlwsmG43-sU/s1600/859006158345879552.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3B_PLr5FZI0ilwOgXzN78r0Gyu-0I7OE2bLOgCJQWtHLGT7QgOmaqLFlRpeNVU3nzQ86lV9SB5vSIKR6WF6UvEyhJFajCJ1ql8T5E_eYCJtETduBzIloYhyphenhyphendQFE-YdiwuDlwsmG43-sU/s400/859006158345879552.png" width="346" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This is what the cropped tweet looks like</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTmhEd98snKPuxlmXJVOrk69rQn4_JKvJHR1478iE2Drsv5aT89O55qiyNQYypUuz-ogfTwviUw1nQTXYBV4pw79QeWKmLrIoO7LWuoqR6w8J0oraL9h4E_d6FLQzrYgh6j9ct2Pzb1KE/s1600/858908487018926080.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTmhEd98snKPuxlmXJVOrk69rQn4_JKvJHR1478iE2Drsv5aT89O55qiyNQYypUuz-ogfTwviUw1nQTXYBV4pw79QeWKmLrIoO7LWuoqR6w8J0oraL9h4E_d6FLQzrYgh6j9ct2Pzb1KE/s400/858908487018926080.png" width="346" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This is what the cropped tweet looks like</td></tr>
</tbody></table>
<br />
<br /></div>
</div>
<b>elon_tweet.sh
</b><script src="https://gist.github.com/lithiumhead/6ebd8e9a7b9025a0fbef22ecc660f961.js"></script></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-77403671419877757202017-04-26T01:05:00.000+05:302017-04-26T01:05:05.742+05:30Classroom Timer V1<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
If you have ever been a teacher at any point in your life, you would have realized the importance of keeping your students engaged and on task at all times during the short period every day that you get to spend time teaching them. If you have just 30 minutes per day, you want to maximize the learning by having a structured lesson plan that moves smoothly from Introduction to New Material to Guided Practice and into Independent Practice. And if you have planned for the lecture properly, you would know how much time you want to spend at each stage doing each activity with the kids to ensure that the lesson is completed on time and doesn't spill over onto the next lecture.<br />
<br />
You may have a clock in your class, but having a countdown timer makes more sense in competitive and group activities. When the kids see the time ticking down, and they rush to try to finish the activity on time, it can give them an adrenalin rush and bring excitement to the activity.<br />
<br />
I am an engineer by profession and passion. So during as a fellow at Teach For India, I was always looking for ways to enhance teaching through use of technology. And so I made a small classroom timer based on Arduino. The first version had a dot matrix display and switches. Soon, I figured that adding WiFi and controlling the timer using a mobile phone would allow the time to be permanently installed above the blackboard in the classroom and avoid the need to touch the timer repeatedly and hence avoid any breakage due to accidentally dropping the timer.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitilGRinY7SzUdkwnCeaQqj1jRz3_KtHSLcNjarG7f7xj9nrD55QcMB6z8fk3l4DfPmQJ1Lps1VraNROpXd3E760-x7ql0YMH5hxBFAQJuYMGTqua2OkF2C0NmfnYi0JDiQ1SDps0opls/s1600/IMG_20160323_110615.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="291" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitilGRinY7SzUdkwnCeaQqj1jRz3_KtHSLcNjarG7f7xj9nrD55QcMB6z8fk3l4DfPmQJ1Lps1VraNROpXd3E760-x7ql0YMH5hxBFAQJuYMGTqua2OkF2C0NmfnYi0JDiQ1SDps0opls/s400/IMG_20160323_110615.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The first version based on Arduino UNO and 8x8 Matrix display</td></tr>
</tbody></table>
For the first version I used an <a href="http://www.vishaworld.com/Arduino-Uno-id-2413759.html" target="_blank">Arduino UNO</a> along with a <a href="http://www.vishaworld.com/Dispalys/4-in-1---8-x-8-Dot-Matrix---MAX7219-based-Module-id-2414196.html" target="_blank">4 panels of 8x8 LED Matrix Displays</a>. The left most 2 displays displayed the time remaining in minutes and the right most two displays were for the two digits which reported the seconds remaining. These display modules are powered by <a href="https://www.maximintegrated.com/en/datasheet/index.mvp/id/1339" target="_blank">MAX7219</a> which allows you to control the displays using just 3 pins of the Arduino UNO. I connected the pins 2,3,4 of Arduino UNO R3 respectively to the DataIn_Pin, Clock_Pin, Load_Pin of the 4 module display. I powered the device using a portable power bank and put everything in a box. There are four switches connected to pins 8, 9, 10 and 11 of the Arduino which allows you to start / pause / stop the countdown as well as set the time that you want to countdown from in increments of 30 seconds.<br />
<br />
There are four switches. When you power up the timer, it starts counting down from 1:00 (1 minute). You can pause this by pressing the stop button once, and continue the countdown when you press start button. If you press stop twice, the timer is reset to the last set value (1:00 by default). When the timer is stopped (press stop twice), you can use the up and down buttons to set a new reload time. Once you have set the time, you can press start to start counting down. the switches are wired in active low mode. There are pullups enabled on the 4 points. I have also added external pullup resistors. When the switches are presses, they short the corresponding arduino pin to ground.<br />
<br />
Here is a video and photo of the internals:<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/-m6tZAWwh1Q/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/-m6tZAWwh1Q?feature=player_embedded" width="320"></iframe></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMPwFAdvAGRc7TMRf0frMz7mUX2QDcUqNzA8JBbwLlyvdqJrOidy10BqMo5y5mTUAQzg6Mbc6MLrfnwsAq6AR4cUwKsK8z7kN57F2KkHUlPHMR9CmC_ZNJOZOE81YcUpl4i5VHO34RFd8/s1600/2016-03-26+10.50.05.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMPwFAdvAGRc7TMRf0frMz7mUX2QDcUqNzA8JBbwLlyvdqJrOidy10BqMo5y5mTUAQzg6Mbc6MLrfnwsAq6AR4cUwKsK8z7kN57F2KkHUlPHMR9CmC_ZNJOZOE81YcUpl4i5VHO34RFd8/s320/2016-03-26+10.50.05.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjUUmfYbsnrS9lGV40UY22KWrwWSwD1JA8l8vBYEN8Bvv5RZyZhe4bUPunoZniGICaN7VgmlIQy4IUSO7VSF1Ypo3fWpjbgS56QKU_45Bj3-LLv6CuV7QddnquxhOLlVBZv9f0X6BFyZ4/s1600/2016-03-26+10.50.13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjUUmfYbsnrS9lGV40UY22KWrwWSwD1JA8l8vBYEN8Bvv5RZyZhe4bUPunoZniGICaN7VgmlIQy4IUSO7VSF1Ypo3fWpjbgS56QKU_45Bj3-LLv6CuV7QddnquxhOLlVBZv9f0X6BFyZ4/s320/2016-03-26+10.50.13.jpg" width="320" /></a></div>
<br />
The first time I set about assembling the device, I used a plastic box. Soon after the plastic box broke and the power bank mal-functioned and so I got a switch box and transferred all the circuitry to the new box. the new box was sturdier and looked neater!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT7T2E1C3HrDUx_hFqCWiom8WlvukS_3z4cninGYdgkrF-Mm1SI8QrlRc-0VVsuHsvr17LLtkLXMJDe5mNph8RTz-sshycHDSUQBrkTAbYoWRptqz8-Y-4uH8tUw7DaVGL5dd6tXTNiNg/s1600/IMG_20160929_200556.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="295" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT7T2E1C3HrDUx_hFqCWiom8WlvukS_3z4cninGYdgkrF-Mm1SI8QrlRc-0VVsuHsvr17LLtkLXMJDe5mNph8RTz-sshycHDSUQBrkTAbYoWRptqz8-Y-4uH8tUw7DaVGL5dd6tXTNiNg/s400/IMG_20160929_200556.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Classroom Timer V1 in a better box</td></tr>
</tbody></table>
<h4 style="text-align: left;">
<br />Code</h4>
I have made use of the following 3 libraries:<br />
<br />
<ol style="text-align: left;">
<li>TimerOne - for using a Timer Interrupt to update the display once every second.</li>
<li>LedControl - This one is used for interfacing to MAX7219 displays. I had to modify this library because I used the modules upside down.</li>
<li>PinChangeInt - Since the 4 buttons are connected to interrupt pins, I have sued Pin Change interrupts to respond to button presses. </li>
</ol>
<div>
Many of these libraries are continuously updated, and the newer version might not work with my existing code. Also I had to modify LedControl library as mentioned above - so I have created a github repository for the code as well as a library here: <a href="https://github.com/lithiumhead/ClassroomTimerV1" target="_blank">https://github.com/lithiumhead/ClassroomTimerV1</a></div>
<div>
In case you want to use the code, download the 3 library folders to your Documents\Arduino\libraries folder, then download the .ino file and put it in a new folder on your computer. make sure this folder has the same name as the .ino file. double click on the .ino file and use Arduino to download the code onto your Arduino UNO R3.<br />
The ClassroomTimerV1.ino file is present in the github repo above and is also embedded as a gist below:</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
<script src="https://gist.github.com/lithiumhead/a021eb4e19ce021741dd6e2c80e875a4.js"></script></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-63356962716566337812017-04-25T02:06:00.001+05:302017-04-25T02:06:52.003+05:30tweet.sh on LinkIt Smart 7688 Duo (OpenWrt)<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 style="text-align: left;">
Temboo-less tweeting from the shell</h4>
<a href="https://www.seeedstudio.com/LinkIt-Smart-7688-Duo-p-2574.html" target="_blank">LinkIt 7688 Duo</a> is a cheaper ($15.9 vs $74.95) and breadboardable version of <a href="https://www.sparkfun.com/products/12053" target="_blank">Arduino Yun</a>. Arduino Yun comes preloaded with <a href="https://temboo.com/arduino/yun/" target="_blank">Temboo </a>whereas LinkIt does not have that preloaded. Temboo is a great go between service that allows your IoT project to talk to existing services like google drive, twitter or dropbox - but to do anything long term and meaningful with it, you have to upgrade from a free temboo plan to a paid plan - Arduino Yun is already expensive and this makes it even moire expensive. I used Arduino Yun and Temboo to make a shimmering lamp that reacts to <a href="http://www.electronicsfaq.com/2014/02/a-lamp-that-shimmers-when-your.html" target="_blank">tweets from your sweetheart</a> - But now it was time to move on to better yet cheaper builds.<br />
<br />
A Raspberry Pi running <a href="https://nodered.org/" target="_blank">Node Red</a> <a href="https://www.youtube.com/watch?v=f5o4tIz2Zzc" target="_blank">can achieve a lot</a> but here I want to focus on LinkIt because I am using it as a part of a larger "art" project. Since LinkIt has an AVR microcontroller (Arduino programmable over WiFi and Arduino Bridge), it allows for greater flexibility in interfacing to sensors and modules via the microcontroller. Also, until someone (or me) ports Node Red to OpenWrt platforms, I would prefer to use bash scripts and Arduino code to get my bidding done.<br />
<br />
So one of the first things on my agenda was to figure out a Temboo less way of fetching tweets. What is outlined below is how I got <a href="https://github.com/piroor/tweet.sh">https://github.com/piroor/tweet.sh</a> (which is a bash script to fetch tweets)to work on OpenWrt - more specifically LinkIt 7688 Duo. For this, we wont be writing any Arduino code since the Microcontroller does not come into play (yet). But what we will be doing is playing around with bash scripts and cross compiling 2 packages for OpenWrt.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj95GrllKVtAn-4fspESAzov8nAkzHcMg5LgN9qFOKBFFArtdYQr80owjIb208sIuS-_4YeN-Sgw84eAkTmbomoSUoE51KmVr8RFgD0v2KAXyIYg4bdHsX_HHLlKc18dkeOPzC0t6eutXY/s1600/2017-04-03+23.08.50.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj95GrllKVtAn-4fspESAzov8nAkzHcMg5LgN9qFOKBFFArtdYQr80owjIb208sIuS-_4YeN-Sgw84eAkTmbomoSUoE51KmVr8RFgD0v2KAXyIYg4bdHsX_HHLlKc18dkeOPzC0t6eutXY/s400/2017-04-03+23.08.50.jpg" width="225" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">My LinkIt 7688 Duo as a part of a larger project.<br />
The LinkIt is the one in the middle. The one on a bottom is a 5V powersupply.<br />
And the one on top is a dimmer circuit - similar to the one I used in my <a href="http://www.electronicsfaq.com/2014/02/a-lamp-that-shimmers-when-your.html" target="_blank">twitter lamp project</a>. </td></tr>
</tbody></table>
<br />
<h4 style="text-align: left;">
Step 1 - Cross compiling packages required by tweet.sh</h4>
Since tweet.sh is just a bash script, it requires certain packages to exist on your system. They are curl, jq, nkf, openssl. Of these openssl and curl can be installed on your LinkIt since they are a part of the OpenWrt repositories. But jq and nkf - these you will have to cross compile on a Linux PC and transfer them to LinkIt.<br />
<br />
Here are the steps to make sure you have all the packages required by tweet.sh on your LinkIt:<br />
<br />
<br />
<ol style="text-align: left;">
<li>Connect your LinkIt to your home's WiFi network - <a href="http://www.electronicsfaq.com/2014/02/a-lamp-that-shimmers-when-your.html" target="_blank">check this</a></li>
<li>Figure out your LinkIt's IP address - there are many ways to do this:</li>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_1GZm-sq1XR37aguXW8jMmXXsK9VYD3S-JDIHH9J4SWAhCJAq5eBbU8Ls6RWdEyA1RZtIuqZnOBygI9vendmMsaEcZqodEtpFk7oBq9jZ95aZWCc_Hvn1eyWEXBisJXrB-1a3_dHOTDE/s1600/Screenshot+2017-04-24+12.18.29.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_1GZm-sq1XR37aguXW8jMmXXsK9VYD3S-JDIHH9J4SWAhCJAq5eBbU8Ls6RWdEyA1RZtIuqZnOBygI9vendmMsaEcZqodEtpFk7oBq9jZ95aZWCc_Hvn1eyWEXBisJXrB-1a3_dHOTDE/s400/Screenshot+2017-04-24+12.18.29.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Using my router's page to figure out the IP addresses of my 2 LinkIts connected to my home network.<br />
The MAC addresses of LinkIt begin with 9e:65:f9<br />
(Yes I have OpenWrt installed on my home router as well)</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvFdZyWvcDLRcSqSMJvVwiIWG4BQp5ilIprDBbBb49aGj30E80D0B5e8D9yZAXJ70eCSElQ3KyVJpm9yRJPT_Y-diHtuKL1xMlJ3razcqCFTpfINS2LtTt-rFXpkwh2C43SSEFSOlv89o/s1600/Screenshot+2017-04-24+12.17.15.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvFdZyWvcDLRcSqSMJvVwiIWG4BQp5ilIprDBbBb49aGj30E80D0B5e8D9yZAXJ70eCSElQ3KyVJpm9yRJPT_Y-diHtuKL1xMlJ3razcqCFTpfINS2LtTt-rFXpkwh2C43SSEFSOlv89o/s320/Screenshot+2017-04-24+12.17.15.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Using Arduino IDE to figure out the IP addresses of LinkIt</td></tr>
</tbody></table>
<ol>
<li>You may need to log on to your <a href="https://www.howtogeek.com/204057/how-to-see-who%E2%80%99s-connected-to-your-wi-fi-network/" target="_blank">WiFi Router's page</a> from your PC and look at the list of devices and IP addresses.</li>
<li>You can install Arduino on your PC, <a href="https://docs.labs.mediatek.com/resource/linkit-smart-7688/en/get-started/get-started-with-the-linkit-smart-7688-duo-development-board/install-arduino-ide-with-board-support-package" target="_blank">add support for LinkIt 7688 Duo</a> and then wait for a few moments till Arduino automatically discovers the LinkIt. Then you can look under Tools>Ports</li>
</ol>
<li>Use <a href="http://www.putty.org/" target="_blank">PuTTY</a> to login to your LinkIt 7688 Duo. Login will be "root" and password would be whatever you set during the getting started stage.</li>
<li>Lets install the basic packages that are required and available - execute the following commands on LinkIt over PuTTY:<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /><b>opkg update<br /><br />opkg install ip curl openssl bash nano grep getopt bc ca-certificates </b></span></li>
<li>We still need to install nkf and jq. For that, we will need to use a Linux computer - preferable one running Ubuntu and perform the following steps (on your Linux PC not LinkIt):</li>
<ol>
<li>Download OpenWRT SDK for Linux from <a href="https://labs.mediatek.com/en/platform/linkit-smart-7688#Software and tools" target="_blank">here</a> onto your x64 Ubuntu Laptop. (I used Ubuntu 15.10 x64 on a VirtualBox Virtual Machine - I used a virtualbox image from <a href="http://www.osboxes.org/" target="_blank">http://www.osboxes.org/</a>)</li>
<li>Extract the folder to your home folder:<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>tar -xvf OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar</b></span></li>
<li>Install some required build tools on your Ubuntu PC:<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>sudo apt-get install autoconf build-essential</b></span></li>
<li>Set the environment variables:<br /><br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>export PATH=~/OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin:$PATH<br /><br />export STAGING_DIR=~/OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir</b></span></li>
<li>Change to ~/OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar/package :<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>cd ~/OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar/package</b></span></li>
<li>Create two folders here:<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>mkdir jq<br />mkdir nkf</b></span></li>
<li>Create the makefile for jq and place it in the jq directory that you just created. (Appended Below):<br /><b><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;">gedit jq/Makefile</span></b></li>
<li>Create the makefile for nkf and place it in the nkf directory that you just created (Appended Below)<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>gedit nkf/Makefile</b></span></li>
<li>Go back to ~/OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64:<br /><b><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;">cd ~/OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64</span></b></li>
<li>And issue the make command:<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>make</b></span></li>
<li>cd to the ourput directory:<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>cd ~/OpenWrt-SDK-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/bin/ramips/packages/base</b></span></li>
<li>You will find the two .ipk files:<br /><b><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;">jq_1.5_ramips_24kec.ipk<br />nkf_2.1.4-1_ramips_24kec.ipk</span></b></li>
<li>Copy these two ipk files to your LinkIt 7688 duo. you can do this in many ways but the best way is to use <a href="http://www.hypexr.org/linux_scp_help.php" target="_blank">scp</a> protocol. In my case I simply copied the files from my Ubuntu Virtual Machine to my Windows machine and used WinSCP (Make sure file protocol is set to SCP) to login into my LinkIt and copied the .ipk files to the /root folder there.</li>
<li>Issue the following commands to install jq and nkf on your LinkIt (Issue commands over PuTTY while in /root directory):<br /><span style="color: blue; font-family: "courier new" , "courier" , monospace; font-size: x-small;"><b>opkg install jq_1.5_ramips_24kec.ipk<br />opkg install nkf_2.1.4-1_ramips_24kec.ipk</b></span></li>
<li>And you are done with installing the required packages</li>
</ol>
</ol>
<div>
Here are the Makefiles for cross compiling jq and nkf</div>
<div>
<br />
<b><span style="font-size: large;">Makefile for nkf:</span></b></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #f8f8f8; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #008800;">include $(TOPDIR)/rules.mk</span>
<span style="color: darkgoldenrod;">PKG_NAME</span><span style="color: #666666;">:=</span>nkf
<span style="color: darkgoldenrod;">PKG_VERSION</span><span style="color: #666666;">:=</span>2.1.4
<span style="color: darkgoldenrod;">PKG_RELEASE</span><span style="color: #666666;">:=</span>1
<span style="color: darkgoldenrod;">PKG_SOURCE_SUBDIR</span><span style="color: #666666;">:=</span><span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_NAME<span style="color: #aa22ff; font-weight: bold;">)</span>-<span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_VERSION<span style="color: #aa22ff; font-weight: bold;">)</span>
<span style="color: darkgoldenrod;">PKG_SOURCE</span><span style="color: #666666;">:=</span><span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_SOURCE_SUBDIR<span style="color: #aa22ff; font-weight: bold;">)</span>.tar.gz
<span style="color: darkgoldenrod;">PKG_SOURCE_URL</span><span style="color: #666666;">:=</span>http://dl.osdn.jp/nkf/64158/
<span style="color: darkgoldenrod;">PKG_MD5SUM</span><span style="color: #666666;">:=</span>dbce0a2131cd4e30f73cbfdcc57c06ec
<span style="color: darkgoldenrod;">PKG_BUILD_PARALLEL</span><span style="color: #666666;">:=</span>1
<span style="color: darkgoldenrod;">PKG_INSTALL</span><span style="color: #666666;">:=</span>1
<span style="color: darkgoldenrod;">PKG_USE_MIPS16</span><span style="color: #666666;">:=</span>0
<span style="color: darkgoldenrod;">PKG_LICENSE</span><span style="color: #666666;">:=</span>MIT
<span style="color: darkgoldenrod;">PKG_MAINTAINER</span><span style="color: #666666;">:=</span>Yoshio HANAWA <<span style="color: #aa22ff; font-weight: bold;">for</span>-openwrt@hnw.jp>
<span style="color: #008800;">include $(INCLUDE_DIR)/package.mk</span>
<span style="color: #008800;">define Package/nkf</span>
SECTION:<span style="color: #666666;">=</span>utils
CATEGORY:<span style="color: #666666;">=</span>Utilities
TITLE:<span style="color: #666666;">=</span>Network Kanji code conversion Filter <span style="color: #666666;">(</span>NKF<span style="color: #666666;">)</span>
URL:<span style="color: #666666;">=</span>https://osdn.jp/projects/nkf/
<span style="color: #008800;">endef</span>
<span style="color: #008800;">define Package/nkf/description</span>
Network Kanji code conversion Filter <span style="color: #666666;">(</span>NKF<span style="color: #666666;">)</span>
<span style="color: #008800;">endef</span>
<span style="color: darkgoldenrod;">MAKE_INSTALL_FLAGS</span> <span style="color: #666666;">+=</span> <span style="color: #bb6622; font-weight: bold;">\</span>
<span style="color: darkgoldenrod;">prefix</span><span style="color: #666666;">=</span><span style="color: #bb4444;">"$(PKG_INSTALL_DIR)"</span> <span style="color: #bb6622; font-weight: bold;">\</span>
<span style="color: darkgoldenrod;">MKDIR</span><span style="color: #666666;">=</span><span style="color: #bb4444;">"mkdir -p"</span>
<span style="color: #008800;">define Package/nkf/install</span>
<span style="color: #aa22ff; font-weight: bold;">$(</span>INSTALL_DIR<span style="color: #aa22ff; font-weight: bold;">)</span> <span style="color: #aa22ff; font-weight: bold;">$(</span>1<span style="color: #aa22ff; font-weight: bold;">)</span>/usr/bin
<span style="color: #aa22ff; font-weight: bold;">$(</span>INSTALL_BIN<span style="color: #aa22ff; font-weight: bold;">)</span> <span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_INSTALL_DIR<span style="color: #aa22ff; font-weight: bold;">)</span>/bin/nkf <span style="color: #aa22ff; font-weight: bold;">$(</span>1<span style="color: #aa22ff; font-weight: bold;">)</span>/usr/bin/
<span style="color: #008800;">endef</span>
<span style="color: #aa22ff; font-weight: bold;">$(</span><span style="color: #aa22ff;">eval</span> <span style="color: #aa22ff; font-weight: bold;">$(</span>call BuildPackage,nkf<span style="color: #aa22ff; font-weight: bold;">))</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<b><span style="font-size: large;">Makefile for jq:</span></b><br />
<div style="background: #f8f8f8; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #008800; font-style: italic;">#jq is written in C and has no runtime dependencies, so it should be possible to build it for nearly any platform. Prebuilt binaries are available for Linux, OS X and Windows.</span>
<span style="color: #008800; font-style: italic;">#The binaries should just run, but on OS X and Linux you may need to make them executable first using chmod +x jq.</span>
<span style="color: #008800; font-style: italic;">#jq is licensed under the MIT license. For all of the gory details, read the file COPYING in the source distribution.</span>
<span style="color: #008800;">include $(TOPDIR)/rules.mk</span>
<span style="color: darkgoldenrod;">PKG_NAME</span><span style="color: #666666;">:=</span>jq
<span style="color: darkgoldenrod;">PKG_VERSION</span><span style="color: #666666;">:=</span>1.5
<span style="color: darkgoldenrod;">PKG_RELEASE</span><span style="color: #666666;">:=</span>
<span style="color: darkgoldenrod;">PKG_SOURCE_URL</span><span style="color: #666666;">:=</span>https://github.com/lithiumhead/jq
<span style="color: darkgoldenrod;">PKG_SOURCE_PROTO</span><span style="color: #666666;">:=</span>git
<span style="color: darkgoldenrod;">PKG_SOURCE_SUBDIR</span><span style="color: #666666;">:=</span><span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_NAME<span style="color: #aa22ff; font-weight: bold;">)</span>-<span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_VERSION<span style="color: #aa22ff; font-weight: bold;">)</span>
<span style="color: darkgoldenrod;">PKG_SOURCE_VERSION</span><span style="color: #666666;">:=</span>b3078a3b1c1b3285926151e0e3af886877e7395d
<span style="color: darkgoldenrod;">PKG_SOURCE</span><span style="color: #666666;">:=</span><span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_NAME<span style="color: #aa22ff; font-weight: bold;">)</span>-<span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_VERSION<span style="color: #aa22ff; font-weight: bold;">)</span>-<span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_SOURCE_VERSION<span style="color: #aa22ff; font-weight: bold;">)</span>.tar.gz
<span style="color: darkgoldenrod;">PKG_FIXUP</span><span style="color: #666666;">:=</span>autoreconf -i
<span style="color: darkgoldenrod;">PKG_INSTALL</span><span style="color: #666666;">:=</span>1
<span style="color: #008800;">include $(INCLUDE_DIR)/package.mk</span>
<span style="color: #008800;">define Package/jq</span>
SECTION:<span style="color: #666666;">=</span>Utilities
CATEGORY:<span style="color: #666666;">=</span>Utilities
DEPENDS:<span style="color: #666666;">=</span>
TITLE:<span style="color: #666666;">=</span>jq json interface
URL:<span style="color: #666666;">=</span>
<span style="color: #008800;">endef</span>
<span style="color: #008800;">define Build/Compile</span>
<span style="color: #aa22ff; font-weight: bold;">$(</span>MAKE<span style="color: #aa22ff; font-weight: bold;">)</span> -C <span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_BUILD_DIR<span style="color: #aa22ff; font-weight: bold;">)</span> <span style="color: darkgoldenrod;">CFLAGS</span><span style="color: #666666;">=</span>-msoft-float
<span style="color: #008800;">endef</span>
<span style="color: #008800;">define Package/jq/install</span>
<span style="color: #aa22ff; font-weight: bold;">$(</span>INSTALL_DIR<span style="color: #aa22ff; font-weight: bold;">)</span> <span style="color: #aa22ff; font-weight: bold;">$(</span>1<span style="color: #aa22ff; font-weight: bold;">)</span>/usr/bin
<span style="color: #aa22ff; font-weight: bold;">$(</span>INSTALL_BIN<span style="color: #aa22ff; font-weight: bold;">)</span> <span style="color: #aa22ff; font-weight: bold;">$(</span>PKG_INSTALL_DIR<span style="color: #aa22ff; font-weight: bold;">)</span>/usr/bin/jq <span style="color: #aa22ff; font-weight: bold;">$(</span>1<span style="color: #aa22ff; font-weight: bold;">)</span>/usr/bin/
<span style="color: #008800;">endef</span>
<span style="color: #aa22ff; font-weight: bold;">$(</span><span style="color: #aa22ff;">eval</span> <span style="color: #aa22ff; font-weight: bold;">$(</span>call BuildPackage,jq<span style="color: #aa22ff; font-weight: bold;">))</span>
</pre>
</td></tr>
</tbody></table>
</div>
<h4 style="text-align: left;">
Step 2 - Cross compiling packages required by tweet.sh</h4>
<div>
Next we need to get tweet.sh onto LinkIt and configure it.</div>
<div>
<ol style="text-align: left;">
<li>Visit https://github.com/lithiumhead/tweet.sh download tweet.sh and tweet.client.key to your PC and transfer it to your LinkIt using WinSCP. You can also download the two files directly to your LinkIt by issuing 2 commands over PuTTY:<br /><span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;"><b>curl -O https://raw.githubusercontent.com/lithiumhead/tweet.sh/master/tweet.sh<br />curl -O https://raw.githubusercontent.com/lithiumhead/tweet.sh/master/tweet.client.key</b></span></li>
<li>Mark tweet.sh as executable:<br /><span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;"><b>chmod +x tweet.sh</b></span></li>
<li>Now we need to configure the keys and add them to tweet.client.key on LinkIt. Visit twitter.com and login to your twitter account.</li>
<li>Next open a new tab in the same browser and visit https://apps.twitter.com/</li>
<li>Click on "Create New Apps"</li>
<li>Enter something in Name, Description and Website</li>
<li>Accept the Developer Agreement and click "Create your Twitter Application"</li>
<li>Now click on your newly created application and click on "Keys and Access Token"</li>
<li>Open tweet.client.key over WinSCP and copy and past key from the webpage to tweet.client.key</li>
<ol>
<li>Enter your twitter handle next to MY_SCREEN_NAME=</li>
<li>Enter "en" next to MY_LANGUAGE=</li>
<li>Copy the string mentioned next to Consumer Key (API Key) to CONSUMER_KEY=</li>
<li>Copy the string next to Consumer Secret (API Secret) to CONSUMER_SECRET=</li>
<li>Copy Access Token to ACCESS_TOKEN=</li>
<li>Copy Access Token Secret to ACCESS_TOKEN_SECRET=</li>
<li>Click save</li>
</ol>
</ol>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPoo5bWIBbqSQ7oU9C3XjfN0Y1HUFwBVpbgI2cq_fCDY_7Jh_gn7KDtKqfK_eVj1tYiMjMTEsjvCbwdQipRakGS5DUAaDEdPuv1MiYnHYljnd9JvXyiLDY28vY6XmPPaYj7eeNMOlPFUo/s1600/Screenshot+2017-04-25+01.25.05.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPoo5bWIBbqSQ7oU9C3XjfN0Y1HUFwBVpbgI2cq_fCDY_7Jh_gn7KDtKqfK_eVj1tYiMjMTEsjvCbwdQipRakGS5DUAaDEdPuv1MiYnHYljnd9JvXyiLDY28vY6XmPPaYj7eeNMOlPFUo/s400/Screenshot+2017-04-25+01.25.05.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Editing tweet.client.key</td></tr>
</tbody></table>
<div>
The original tweet.sh is published at https://github.com/piroor/tweet.sh but I had to fork it and make some modification to it so that it would run on OpenWrt. I have forked it at <a href="https://github.com/lithiumhead/tweet.sh" target="_blank">https://github.com/lithiumhead/tweet.sh</a> and that's what we have used. (Modifications involved creating symbolic links to stdin and stdout in proc file system - these are lacking by default in OpenWrt)</div>
</div>
<div>
<br /></div>
<div>
Finally everything is set and we can test our tweet.sh setup by fetching the latest tweet from - say - elonmusk, piping it through jq and printing only the unique tweet id and the text of the tweet itself:</div>
<div>
<br /></div>
<div>
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;"><b>./tweet.sh search -q "from:elonmusk" -c 1 | jq '.statuses[0].id, .statuses[0].text'</b></span></div>
<div>
<br /></div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMzTWplSwB3BICERZ0nIo7KrG856BYS5MtGGg-FNyV-tdYhB4peHC3diMMH74lUTFdpHXBYS7F4llnLJPN-N01JrEUUvyYdnI7wshSZiEKAzf0aSBYnGnStsXIMCHUujDUQZ0TPwj5bI0/s1600/Screenshot+2017-04-25+02.05.34.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMzTWplSwB3BICERZ0nIo7KrG856BYS5MtGGg-FNyV-tdYhB4peHC3diMMH74lUTFdpHXBYS7F4llnLJPN-N01JrEUUvyYdnI7wshSZiEKAzf0aSBYnGnStsXIMCHUujDUQZ0TPwj5bI0/s640/Screenshot+2017-04-25+02.05.34.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">tweet.sh running in a PuTTY window with Twitter open in Google Chrome</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-29250576293422224092017-04-20T17:23:00.000+05:302017-04-20T17:36:51.675+05:30Dealing with WiFi IP Cameras and .264 files<div dir="ltr" style="text-align: left;" trbidi="on">
On a recent visit to China, I purchased a cheap IP camera which looks like a robot:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggDBF7wn-ZBsuTyFssqEExa1-MOeh3tEXstr-wZ2_sNRuv-Z68X0Yt9PpkQj_R8aH3SslVx9xSe7Ld14hyphenhyphenoVgORpj0uikNIWN4RYkn9GUmVBXxqAtdNrTUp5Uh0aHtJsRyKpM0sTDU6Bo/s1600/Clipboard01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggDBF7wn-ZBsuTyFssqEExa1-MOeh3tEXstr-wZ2_sNRuv-Z68X0Yt9PpkQj_R8aH3SslVx9xSe7Ld14hyphenhyphenoVgORpj0uikNIWN4RYkn9GUmVBXxqAtdNrTUp5Uh0aHtJsRyKpM0sTDU6Bo/s320/Clipboard01.jpg" width="226" /></a></div>
You can get one online from <a href="https://www.amazon.com/Tomlov-Wireless-Surveillance-Camera-Monitor/dp/B01I8TSKY2" target="_blank">amazon</a> for twice the amount that you might pay for it when you buy it from one of the shops in ShenZhen (I got it for around 150 CNY or 1500 INR). The camera is supposed to be installed in your house where you can configure it to connect to your home's WiFi router. That way you can connect to the camera from anywhere in the world (using your web browser or smart phone app) and watch and hear what ever the camera picks up. Here are some of the features of this camera:<br />
<br />
<ul style="text-align: left;">
<li>Tech Specs (you can find these on the amazon page as well, although the model might say something else)</li>
<ul>
<li>Model: The packaging for my camera said "Mini Robot Wireless Camera H811 IP Camera"</li>
<li>Power: DC Input 5V 2Amps (via microUSB connector)</li>
<li>Image quality: 960P 1.3Megapixel</li>
</ul>
<li>WiFi:</li>
<ul>
<li>Out of the box, the camera defaults to WiFi master mode (i.e. wifi hotspot) . This is so that you can use the app on your smartphone to connect to it and if required, you can configure the camera to switch to client mode and connect to your home's WiFi router.</li>
<li>By default, when you look for it, the SSID of the WiFi signal emitted by the camera would be something like: "HSL-337026-GDDEN"</li>
<li>The default WiFi WPA2 key is 0123456789</li>
<li>Android app:</li>
<ul>
<li>The app for your smart phone is called NetCam (Google Play Store <a href="https://play.google.com/store/apps/details?id=hsl.p2pipcam&hl=en" target="_blank">link</a>)</li>
</ul>
<li>Computer:</li>
<ul>
<li>In case you connect to the camera using a laptop, punch in the following URL into your web browser: http://192.168.246.1:81/</li>
<li>It will ask you for login credentials, enter "admin" as login and leave the password blank.</li>
</ul>
</ul>
<li>Reset button and microSD card slot:</li>
<ul>
<li>The camera has a microSD card slot on the back. If you install a microSD card, the camera will also record the video (only video no audio) onto the SD card.</li>
<li>The small hole next to the camera on the back is for resetting the camera in case you forget its login password (this is separate from the WiFi password)</li>
</ul>
<li>Physical structure:</li>
<ul>
<li>The bottom part of the camera is made of iron and the camera head itself has a magnet in it. This allows you to screw in the bottom of the camera wherever you want and them attach the camera head and orient it in any direction you want.</li>
<li>The bottom of the camera also has a QR code which you can scan with your smart phone app to connect to it for the first time. The QR code has the WiFi Master SSID encoded into it.</li>
</ul>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDXD6T17KEOBT1UN-elJw7_jJKHhj60LnyLT3CvZJ1KlPje9W0U13hKRjcNMWJBJY8wbxo9Ychn2F4IlWUM3Vx8G_fMEVY4_4NViTDhoD8iUMn19_T6MAoQ1VX0vMpIE_i-ye_urIF_OI/s1600/Clipboard01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDXD6T17KEOBT1UN-elJw7_jJKHhj60LnyLT3CvZJ1KlPje9W0U13hKRjcNMWJBJY8wbxo9Ychn2F4IlWUM3Vx8G_fMEVY4_4NViTDhoD8iUMn19_T6MAoQ1VX0vMpIE_i-ye_urIF_OI/s400/Clipboard01.jpg" width="386" /></a></div>
<div>
<br /></div>
<div>
So what did I do with the camera? I mounted it in my car as my dashcam. <span style="background-color: yellow;">The problem is that the camera does not have a battery backed <a href="https://en.wikipedia.org/wiki/Real-time_clock" target="_blank">real time clock</a> (RTC) and there is no internet (which would have helped re-sync the clock because the camera supports <a href="https://en.wikipedia.org/wiki/Network_Time_Protocol" target="_blank">network time protocol</a> or NTP) in my car so the camera does not maintain the time when I turn off the car (and power to the camera is cut).</span> I use a 2 amp 5V smart phone charger that plugs into my cigarette lighter to power the camera. I could have connected the camera directly to the 12V battery and that would have ensure that the camera ran continuously and never lost time, but then my car battery would get drained as well.<br />
<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8hJoCsjC18AWQMTn02wE-A_0WIKkAfAi6ww2zuB2gNh8n_oB3fAddQewR6Q-NYkpUB9EC7eUH7yXm33RuoJQa3OgAguMclz5iGu1aIiUygmLDgJm_q7vh33lVhchwkJDLPshQZxV7ETA/s1600/IMG_20160614_175459.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8hJoCsjC18AWQMTn02wE-A_0WIKkAfAi6ww2zuB2gNh8n_oB3fAddQewR6Q-NYkpUB9EC7eUH7yXm33RuoJQa3OgAguMclz5iGu1aIiUygmLDgJm_q7vh33lVhchwkJDLPshQZxV7ETA/s320/IMG_20160614_175459.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTYWYs0S93zq-49w7mT5v_JuF3eWi6vJGKNx_X-EZZGo00OnoVvl42FQWhkruxNd-mt25YsT9o9Gg0zOgBdtE-sWtxcH2AKdc2KcLM_SFgFRnjevnSLrNNJF2Ds7l-qlVzh-nMImlzWpU/s1600/IMG_20160614_175851.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTYWYs0S93zq-49w7mT5v_JuF3eWi6vJGKNx_X-EZZGo00OnoVvl42FQWhkruxNd-mt25YsT9o9Gg0zOgBdtE-sWtxcH2AKdc2KcLM_SFgFRnjevnSLrNNJF2Ds7l-qlVzh-nMImlzWpU/s320/IMG_20160614_175851.jpg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjInoEmdB0GD2iW1DIycteAkzebSWP55Cj2k9jjkE6qWC_m_8k9GZBsvepIScJ-mLDAtfOdaMwur2b1XRhOKSH06QD1lnz5D1Kgo9lC1BJ2J0Ro5wabzSQ9vSj4GJ-dfV6iaxXAdmNlwRY/s1600/IMG_20160614_180349.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjInoEmdB0GD2iW1DIycteAkzebSWP55Cj2k9jjkE6qWC_m_8k9GZBsvepIScJ-mLDAtfOdaMwur2b1XRhOKSH06QD1lnz5D1Kgo9lC1BJ2J0Ro5wabzSQ9vSj4GJ-dfV6iaxXAdmNlwRY/s320/IMG_20160614_180349.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4zqrPRTdmQRlQdJBwn-zstXiPjvbkcUThAbEAhixmFDROjUHm1etkbbCPLPLkBZ9SUG9UpKZz5iunbhVP_LZbnm2OoOVYWThjBj3EkuUQlNOZ8EGVPeehY6g4mqpKprU9Jj7Ow-zjtv4/s1600/IMG_20160614_180357.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4zqrPRTdmQRlQdJBwn-zstXiPjvbkcUThAbEAhixmFDROjUHm1etkbbCPLPLkBZ9SUG9UpKZz5iunbhVP_LZbnm2OoOVYWThjBj3EkuUQlNOZ8EGVPeehY6g4mqpKprU9Jj7Ow-zjtv4/s320/IMG_20160614_180357.jpg" width="320" /></a></div>
<div>
<br /></div>
<div>
I installed the base (made of iron) of the camera onto my rear view mirror and the camera heat got attached to the base thanks to the magnet present inside the head.<br />
<br />
<b>About RTC and NTP:</b><br />
As mentioned above, this camera does not have any battery (neither Li-ion or coin cell) to main clock when the car is turned off. The camera can act as a WiFi client and can synchronize its time at boot up using an NTP server. But for I would need to get an internet connection for my car - possibly a 3G/4G hotspot. In cases where one does not want to do all that, there is a way out. The Global Positioning System is essentially made up of atomic clocks orbiting Earth. We can use a GPS receiver along with a WiFi capable microcontroller and implement the NTP server functionality. There is a tutorial on instructable on how to go about it: <a href="http://www.instructables.com/id/ESP8266-Wireless-NTP-Stratum1-Server/">http://www.instructables.com/id/ESP8266-Wireless-NTP-Stratum1-Server/</a> - what this instructable allows you to do is to make a small WiFi Access Point (using ESP8266) that doubles up as an NTP server. When you connect your devices (this camera or your smart phone) it would be able to access the internet but you can configure the NTP server address to point to this ESP8266 device and atleast your time synchronization will work. (<a href="https://www.hackster.io/rayburne/tardis-time-esp8266-ap-webserver-gps-6b5d2a" target="_blank">Another similar project</a>)<br />
<br />
<b>About handling the .264 media files on a Windows desktop</b><br />
You can connect to the camera using the Android app to watch live video and configure the camera, but there is no way for you to review the video recorded by the camera while the memory card is inside the camera. The android app has no option to playback the recordings. The only way is for you to remove the memory card and insert it into a memory card reader and either connected it to your computer or to your android phone using a USB OTG cable.<br />
The moment you remove the microSD card and insert it into a card reader and attach it to your Windows PC, this is what you see:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix32b7g16i6M7i5ENAYmQK8Wak_0mUG5evmxGfwZR1Y35e_y8MLxDbIZ0QMIG-cvG51JMbrTMulJGuTALbw90cG_2u2el35_DyTt2okn1qLSkpgilWBtXiEwP6djLAaGr6u8gDfivHHOk/s1600/2017-04-20+14.47.39.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix32b7g16i6M7i5ENAYmQK8Wak_0mUG5evmxGfwZR1Y35e_y8MLxDbIZ0QMIG-cvG51JMbrTMulJGuTALbw90cG_2u2el35_DyTt2okn1qLSkpgilWBtXiEwP6djLAaGr6u8gDfivHHOk/s320/2017-04-20+14.47.39.jpg" width="195" /></a></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVCJjhsoPNAHZL4WIOVrFGYCsr3UgQK0Z56L5_2_YMHApqtUp5wWjLQHag5WhrnPQPFMsaVuc54fm8s7gv215rdwO-_eyxVmN4S7c367dFPTUI_E30TsR4hVAbNKspfaelb5HCSzB5_2w/s1600/Screenshot+2017-04-20+14.49.04.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVCJjhsoPNAHZL4WIOVrFGYCsr3UgQK0Z56L5_2_YMHApqtUp5wWjLQHag5WhrnPQPFMsaVuc54fm8s7gv215rdwO-_eyxVmN4S7c367dFPTUI_E30TsR4hVAbNKspfaelb5HCSzB5_2w/s400/Screenshot+2017-04-20+14.49.04.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The camera fills up the microSD card with equal sized stub files</td></tr>
</tbody></table>
<br />
The camera has filled up the memory card with stub files. The camera starts recording the video into first file. When one file fills up (around 5 minutes worth of video), it continues recording in to the next file in sequence. This ensures that in case the power is cut to the camera (e.g. car accident/break in), atleast the last file would have been saved properly and would help in investigation.<br />
<br />
<b>Playing back on Desktop:</b><br />
You can use VLC Media Player to play these .264 files. You have to make a small change in the settings:<br />
<br />
<ol style="text-align: left;">
<li>Select View>Preferences</li>
<li>Switch to "All" under Show Settings</li>
<li>Click on "Demuxers" under Input/Codecso</li>
<li>Select "H264 video demuxer" from the drop down list and click Save</li>
<li>Now you can drag and drop .264 files into VLC media player and play them back</li>
<li>Make sure to change the Demux module setting from "H264 video demuxer" back to "Automatic" once you are done with playing .264 files. This will allow you to play your regular video files correctly.</li>
</ol>
<div>
Here are the screenshots to clarify the above steps:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB2h7HErLYeJzNWeB5jfw5FPotAhCioEfLMobmAcN1O9VddIpLQHrOj0yBrSZCUsZq3gOianJAdXZM6SDCaj2DBoCqmVh8H5iuRYSmYpWow7IXuF0vxR4Fv3Neh-K78sK8PCU8PLEf7Zk/s1600/Screenshot+2017-04-20+15.15.54.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB2h7HErLYeJzNWeB5jfw5FPotAhCioEfLMobmAcN1O9VddIpLQHrOj0yBrSZCUsZq3gOianJAdXZM6SDCaj2DBoCqmVh8H5iuRYSmYpWow7IXuF0vxR4Fv3Neh-K78sK8PCU8PLEf7Zk/s400/Screenshot+2017-04-20+15.15.54.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ6KP2b6VkDzywzLPxDEAsLAZ6879ukI6YsmzStLCXviK13DNZcmNXB_mlnkiVjue38gazPJctimu9n343yYY4CivCaEv2wwQxTTV-T1GBkQuFCcJw2ovRXXR7nHBFha-MXy5XcAPBep0/s1600/Screenshot+2017-04-20+15.16.05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ6KP2b6VkDzywzLPxDEAsLAZ6879ukI6YsmzStLCXviK13DNZcmNXB_mlnkiVjue38gazPJctimu9n343yYY4CivCaEv2wwQxTTV-T1GBkQuFCcJw2ovRXXR7nHBFha-MXy5XcAPBep0/s400/Screenshot+2017-04-20+15.16.05.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvVBPxJ6pQstZZ0IZAs8CxN7hzZ-iPRjg-rky1DDnp8v1QRbGMN2NVBV8uaR2xnymrHewx9aEazXwjrFC6w258DfIgyg5TKQ1ICh-YYBJxlU2Qz4sSLedRJXORj9OuL6RbZjDD69HvlCI/s1600/Screenshot+2017-04-20+15.16.23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvVBPxJ6pQstZZ0IZAs8CxN7hzZ-iPRjg-rky1DDnp8v1QRbGMN2NVBV8uaR2xnymrHewx9aEazXwjrFC6w258DfIgyg5TKQ1ICh-YYBJxlU2Qz4sSLedRJXORj9OuL6RbZjDD69HvlCI/s400/Screenshot+2017-04-20+15.16.23.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4okqkS1fos5pYpV0PoxF2ySX0PE4m0ZOc-LutdUT8gvYsiuTU5ISPtjTD2f4Hw3aVK5gmunTYa-bAGLzSm0QL6dqhKZjnGtmi71GXSYivG5_FNwkLxniWDsea53wFa2WHOElmnDxehy0/s1600/Screenshot+2017-04-20+15.16.29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4okqkS1fos5pYpV0PoxF2ySX0PE4m0ZOc-LutdUT8gvYsiuTU5ISPtjTD2f4Hw3aVK5gmunTYa-bAGLzSm0QL6dqhKZjnGtmi71GXSYivG5_FNwkLxniWDsea53wFa2WHOElmnDxehy0/s400/Screenshot+2017-04-20+15.16.29.png" width="400" /></a></div>
<div>
<br />
You will note that when playing .264 files, you don't hear any audio. I am not sure if the camera records audio or not but, according to what I have read in discussion forums, no one has gotten any audio playback from these raw H264 format video files.<br />
<b><br /></b>
<b>Converting videos on Desktop:</b><br />
In case you want to convert the video to mp4 format, there are two steps that you have to follow:<br />
<br />
<ol style="text-align: left;">
<li>Use <a href="http://www.wikihow.com/Install-FFmpeg-on-Windows" target="_blank">ffmpeg</a> to convert the .264 file in to raw uncompressed AVI file. This will take care of stream errors which usually creep in when the power supply to the camera (like in a car) is not reliable or when the camera experiences vibration.</li>
<li>Use ffmpeg to convert the uncompressed file to mp4</li>
</ol>
<div>
<br /></div>
<div>
<b>Here are the steps in the conversion process:</b></div>
<div>
<ol style="text-align: left;">
<li>Visit http://ffmpeg.zeranoe.com/builds/ and download the latest stable, static 32bit version.</li>
<li>Unzip the file into a folder on your computer.</li>
<li>Move your .264 video file into the bin folder of the ffmpeg folder</li>
<li>Open a command prompt and cd to the ffmpeg/bin folder</li>
<li>Issue the command <b>ffmpeg -i apf00047.264 -vcodec rawvideo -y output.avi</b><br />This will begin converting the file apf00047.264 into a raw uncompressed file.<br />During the conversion process, ffmpeg will display a number of messages about finding errors in the stream and compensating for it. Once the conversion process is done, you will realise that the 64MB file has been converted to an .avi file occupying 6.8 GB of space. You can try playing this file in VLC player (make sure to set Demux module back to Automatic)</li>
<li>Finally you can convert the uncompressed avi file to mp4 format using the command:<br /><b>ffmpeg -i output.avi output.mp4</b><br />Once that is done, you can delete the output.avi uncompressed video file. The output.mp4 video file can be uploaded to Youtube and Facebook if required. The .mp4 file can also be played using VLC player. It of course wont have any audio - that's the issue of the camera. The output.mp4 would be around 107 MB in size.</li>
</ol>
<div>
<b>Here some screenshots outlining the above steps:</b></div>
</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLn7JhvU9xVtjG3pLwpo3_FSrH3iak7LbtrHwuoLfiUexaH8Y7i6CvA8dCSNdJimwX597uGqOEJQoeryXgxWoRd7Ykigm1LG2Ujr9F3Ys2g7qiOM6U9AfEbMx9NF7WjAdu0PgWJmOvduY/s1600/Screenshot+2017-04-20+15.56.41.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLn7JhvU9xVtjG3pLwpo3_FSrH3iak7LbtrHwuoLfiUexaH8Y7i6CvA8dCSNdJimwX597uGqOEJQoeryXgxWoRd7Ykigm1LG2Ujr9F3Ys2g7qiOM6U9AfEbMx9NF7WjAdu0PgWJmOvduY/s400/Screenshot+2017-04-20+15.56.41.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Downloading the ffmpeg utility for Windows</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTK9TqyPaDsDGr1kF0UxTkTHDLgNe1caj-bkwDlgpoXPuQBK-vCTHcdGRuezVnVzuFfRFzDtB1u_V9Ez7JR-GXyYuRYvsSlrWIzNs-LAJNQDRkBSY4T8FDa9sHyG36aGWPiJo7nzfem_c/s1600/Screenshot+2017-04-20+15.59.41.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTK9TqyPaDsDGr1kF0UxTkTHDLgNe1caj-bkwDlgpoXPuQBK-vCTHcdGRuezVnVzuFfRFzDtB1u_V9Ez7JR-GXyYuRYvsSlrWIzNs-LAJNQDRkBSY4T8FDa9sHyG36aGWPiJo7nzfem_c/s400/Screenshot+2017-04-20+15.59.41.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Copy your .264 video file to the bin folder within the extracted ffmpeg folder</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQHH9XMyCyygkP_oFxaNtKA60M6AKCstHovsZwZ5Z9HyYlJNI8tcU4Cx7N1bvrmGcvpQQzV25s9ubwJY-pfvu4tiV0jfDAnq-e9z-VFZRB0splGWlOES7RD6cWEgXUEXbJGHWCJmdzBek/s1600/Screenshot+2017-04-20+16.01.20.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQHH9XMyCyygkP_oFxaNtKA60M6AKCstHovsZwZ5Z9HyYlJNI8tcU4Cx7N1bvrmGcvpQQzV25s9ubwJY-pfvu4tiV0jfDAnq-e9z-VFZRB0splGWlOES7RD6cWEgXUEXbJGHWCJmdzBek/s400/Screenshot+2017-04-20+16.01.20.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Opening a command prompt and navigating to the ffmpeg's bin folder</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipHHoNN7kDduw1c0ObCqnKcPncH5Ek4K3fuvoTeJCUK3GdVKgSegiqugc7sQc0dVW0uYzjPDJ_Tl3z-QNoTlvVGTLNJqn_CrO9wG7h54tn2M2oR2lpEMrVpK_qvh-tgCGz1lXwjfztcKY/s1600/Screenshot+2017-04-20+16.07.18.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipHHoNN7kDduw1c0ObCqnKcPncH5Ek4K3fuvoTeJCUK3GdVKgSegiqugc7sQc0dVW0uYzjPDJ_Tl3z-QNoTlvVGTLNJqn_CrO9wG7h54tn2M2oR2lpEMrVpK_qvh-tgCGz1lXwjfztcKY/s400/Screenshot+2017-04-20+16.07.18.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Issuing a command to start conversion of .264 to uncompressed .avi format</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzdJMEGijq5vEgZXr5OD81ep0vysILJQPTlUwSlICKZiC8Ld2uFyo34TMNW2wQyBDKqWA3TSZlmz7GRfPrbnG0OLP9KvEJyKzTEAa_VauCy-DTtOkbMLlFZdNGAYQVLfBTl42wwCbtvrM/s1600/Screenshot+2017-04-20+16.06.00.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzdJMEGijq5vEgZXr5OD81ep0vysILJQPTlUwSlICKZiC8Ld2uFyo34TMNW2wQyBDKqWA3TSZlmz7GRfPrbnG0OLP9KvEJyKzTEAa_VauCy-DTtOkbMLlFZdNGAYQVLfBTl42wwCbtvrM/s400/Screenshot+2017-04-20+16.06.00.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ffmpeg spews messages regarding stream errors while creating uncompressed .avi file</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZNCPKRoHY8COH3RpWYqucSEzeHGVZInrXN2LzV4cmT4I3X2Z3ddbEmhny9TQUrKcxebh-mO5y1GPJSn97JjLYuk6rDqu9jWLR_zQVDGPNqFZX5SMNWfSDQ8Ut5m8SHE2zwGoN3FOtftk/s1600/Screenshot+2017-04-20+16.16.04.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZNCPKRoHY8COH3RpWYqucSEzeHGVZInrXN2LzV4cmT4I3X2Z3ddbEmhny9TQUrKcxebh-mO5y1GPJSn97JjLYuk6rDqu9jWLR_zQVDGPNqFZX5SMNWfSDQ8Ut5m8SHE2zwGoN3FOtftk/s400/Screenshot+2017-04-20+16.16.04.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The uncompressed output.avi file is huge - 6.8 GB</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpu-xJ3abEyayPBDd8E3e7K-ugfJTRPkGD755GxWkGUSehyX3eRQhp_N3JGEag55Iy__CilZk1gIoXjpItzquf0xrnWpHT-Jbyu0XwF-rhHeZUHD89WupaBgUgirVskytUGfmfzLYgUDY/s1600/Screenshot+2017-04-20+16.15.15.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpu-xJ3abEyayPBDd8E3e7K-ugfJTRPkGD755GxWkGUSehyX3eRQhp_N3JGEag55Iy__CilZk1gIoXjpItzquf0xrnWpHT-Jbyu0XwF-rhHeZUHD89WupaBgUgirVskytUGfmfzLYgUDY/s400/Screenshot+2017-04-20+16.15.15.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You can play the uncompressed output.avi in VLC Player</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvFQTbbpL-TjxKSDrx9PGy0wxbQmHGdh29drVfutbW17pg6FpSyZ_JMibdy-QNjTiYcQqpXpwvQInMe562Tl4uPfxWbiluqqKxPJjz0jMJ2SqmeU0E2FbbQxaqe3vqZctoQnvLk4xbhOY/s1600/Screenshot+2017-04-20+16.28.55.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvFQTbbpL-TjxKSDrx9PGy0wxbQmHGdh29drVfutbW17pg6FpSyZ_JMibdy-QNjTiYcQqpXpwvQInMe562Tl4uPfxWbiluqqKxPJjz0jMJ2SqmeU0E2FbbQxaqe3vqZctoQnvLk4xbhOY/s400/Screenshot+2017-04-20+16.28.55.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Executing ffmpeg a second time to convert uncompressed .avi to .mp4 format</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVJ3k6S-0M0kkcBj3RjSO-d7QuPsYGDOnmD0v-3yrZX7ShqbhMe8ETWkOLv2wVgzRD2i9gnnHrfMmY2pVbkEZ2cK9duAq0JQNdpLY7HtTXFWS9HBfEL9_mKJcJS8zvHokT-JKKBqcG_JQ/s1600/Screenshot+2017-04-20+16.32.31.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="330" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVJ3k6S-0M0kkcBj3RjSO-d7QuPsYGDOnmD0v-3yrZX7ShqbhMe8ETWkOLv2wVgzRD2i9gnnHrfMmY2pVbkEZ2cK9duAq0JQNdpLY7HtTXFWS9HBfEL9_mKJcJS8zvHokT-JKKBqcG_JQ/s400/Screenshot+2017-04-20+16.32.31.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Playing output.mp4 in VLC Player</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Playing back on Android Phone:</b></div>
<div>
You can use a USB OTG cable along with a card reader to connect the microSD card to your android phone. Once you do that - and if your phone supports USB OTG - a notification will pop up allowing you to explore the files on the microSD card. Now you can use this file explore feature and long press the .264 file that you are interested in to select it. Once selected, copy it to your phones internal memory. Then start the MX player app. The MX player (<a href="https://play.google.com/store/apps/details?id=com.mxtech.videoplayer.ad&hl=en" target="_blank">Free version with ads</a> | <a href="https://play.google.com/store/apps/details?id=com.mxtech.videoplayer.pro&hl=en" target="_blank">pro version</a>) app scans the phone's memory for video files, and this .264 file will show up as well. Just tap on it and the video will start playing.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJqG-eVgS0xS3nZju8jKbSm30p62W5WwDHLG3q3TTqoLQCZEh5b2M5OFj9dsw67xZL5uTPiyFarT2yGcBltt_l-QoMpKRQprIBV0jVYHhufdIu_zN8golRYXzj4nSNMgXNFoReLO0Irf8/s1600/IMG_7874.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJqG-eVgS0xS3nZju8jKbSm30p62W5WwDHLG3q3TTqoLQCZEh5b2M5OFj9dsw67xZL5uTPiyFarT2yGcBltt_l-QoMpKRQprIBV0jVYHhufdIu_zN8golRYXzj4nSNMgXNFoReLO0Irf8/s320/IMG_7874.JPG" width="213" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Use the OTG Cable to connect card reader to the Android phone.<br />
Explore the file using Android's builtin feature an copy the files to phone's internal memory.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhybejr8iUJF2auCuivSOMzywfkJqvxW3WDfwrcPY0UDOa7jX-EaB5Aw45Lx-lETt9Y-2MOWM5pAS7pmtbtw_bEV0XtERoCaJmZnjKAglPBbkp0Xl8pFxl8XtOHRatjT8i0L1GWs2Fn1e4/s1600/IMG_7877.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhybejr8iUJF2auCuivSOMzywfkJqvxW3WDfwrcPY0UDOa7jX-EaB5Aw45Lx-lETt9Y-2MOWM5pAS7pmtbtw_bEV0XtERoCaJmZnjKAglPBbkp0Xl8pFxl8XtOHRatjT8i0L1GWs2Fn1e4/s320/IMG_7877.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">MX Player app shows the recently copied .264 video file.</td></tr>
</tbody></table>
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx02eyJ8hyztGRPSMd_ggQ2j7ixhKDFGETRwBpEDOKuyIR969x4rHZ4BucKUl1GFabEImJdGrOXwdGI6XEl-Id3cezyQGftYrtydgZXD5Zk13ejjt_uXc9xbBXo87QFfpi1cOi0PdRX6U/s1600/IMG_7875.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx02eyJ8hyztGRPSMd_ggQ2j7ixhKDFGETRwBpEDOKuyIR969x4rHZ4BucKUl1GFabEImJdGrOXwdGI6XEl-Id3cezyQGftYrtydgZXD5Zk13ejjt_uXc9xbBXo87QFfpi1cOi0PdRX6U/s320/IMG_7875.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Tap on the file to play it.</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
</div>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com2tag:blogger.com,1999:blog-8517901213371477159.post-70240639090840818362017-02-23T13:33:00.001+05:302017-02-25T14:09:26.561+05:30Arduino code for ESP8266 to take readings from DHT11 and upload them to InitialState.com<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
www.initialstate.com is a great data broker and visualization platform for IoT devices. Up until now it was out of reach for ESP8266 fans because the Arduino environment for ESP8266 did not support SSL/TLS connections. But now it does. So here is how to get HTTPS working on ESP8266 using Arduino IDE and upload readings from DHT11 every 10 seconds.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQjrQqvtsNh_dBB7G0MJvYjbdyAXlQINZLnfqC4Yp5viwvEZWhaVDkdjBAHKQtW_U5IWCfa9ccag3ZTYYOLdrooofVuYq7cKGVkVFDxzoqAeOLUvc5dnprbS0x7aQ2lUFGiWVhYs5yaoc/s1600/2017-02-23+13.24.55.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQjrQqvtsNh_dBB7G0MJvYjbdyAXlQINZLnfqC4Yp5viwvEZWhaVDkdjBAHKQtW_U5IWCfa9ccag3ZTYYOLdrooofVuYq7cKGVkVFDxzoqAeOLUvc5dnprbS0x7aQ2lUFGiWVhYs5yaoc/s400/2017-02-23+13.24.55.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ESP8266 and DHT11</td></tr>
</tbody></table>
Steps for Windows computers:<br />
<br />
<ol style="text-align: left;">
<li>Install <a href="http://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers" target="_blank">CP2102 drivers </a>for the USB-UART chip onboard the ESP8266 NodeMcu v1.0 board</li>
<li>Get the latest offline Arduino IDE Windows Installer from <a href="https://www.arduino.cc/en/Main/Software" target="_blank">https://www.arduino.cc/en/Main/Software</a></li>
<li>Install Board support for ESP8266 in your Arduino IDE, follow instructions here:<br /><a href="https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon" target="_blank">https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon</a></li>
<li>Assemble your ESP8266 and DHT11 circuit. You will need 3 jumper cables and a breadboard to connect 3 signals from ESP8266 to DHT11 module. Connect pin marked D2 on ESP8266 to DHT11's data pin. Also supply 3.3V and GND from ESP8266 to DHT11's Vcc and GND.</li>
<li>Plug your ESP8266 into your computer's USB port using a microUSB cable.</li>
<li>Get a free account on www.initialstate.com, create a new bucket and make a note of the Bucket key and Access key.</li>
<li>Download shown below and open it in your Arduino IDE</li>
<li>Modify 4 things by supplying your own:</li>
<ol>
<li>WLAN_SSID</li>
<li>WLAN_PASS</li>
<li>INITIALSTATE_ACCESS_KEY</li>
<li>INITIALSTATE_BUCKET_KEY</li>
</ol>
<li>Download the code into your ESP8266 board and watch it go! Keep the Serial Monitor within Arduino IDE open to watch what data is being sent to www.initialstate.com</li>
</ol>
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIDN6w05OVnqdKTwagPoMtEeLCvo7PvGGE1y4E4sO0_2QAoGP4pA1C_IIz1YKE2aUHW1MbltwtTeVLcWJcdJwgVn9pt2hakQmdjw9dsfcS570Becq60oBtmPOZxSUUPC5ClCfuqTxmf-I/s1600/Screenshot+2017-02-23+01.18.00.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="202" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIDN6w05OVnqdKTwagPoMtEeLCvo7PvGGE1y4E4sO0_2QAoGP4pA1C_IIz1YKE2aUHW1MbltwtTeVLcWJcdJwgVn9pt2hakQmdjw9dsfcS570Becq60oBtmPOZxSUUPC5ClCfuqTxmf-I/s400/Screenshot+2017-02-23+01.18.00.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Data received on initialstate.com</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG_smLxvEs_PAPscw8z1UC8H3n_LnngLrsIOLNM_lhzrxVtXPFSj-WeYy9xs8tBlVNecheNXTQ4TJ9tstS9wRQFetmaM1PpuVba6vn_D6SsC8vxKRO6VzoK6kD535czxhVI-6FFVe9sxE/s1600/Screenshot+2017-02-23+01.18.59.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG_smLxvEs_PAPscw8z1UC8H3n_LnngLrsIOLNM_lhzrxVtXPFSj-WeYy9xs8tBlVNecheNXTQ4TJ9tstS9wRQFetmaM1PpuVba6vn_D6SsC8vxKRO6VzoK6kD535czxhVI-6FFVe9sxE/s640/Screenshot+2017-02-23+01.18.59.png" width="571" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Watch the code go on Serial Monitor</td></tr>
</tbody></table>
InitialStateDHT11.ino:
<script src="https://gist.github.com/lithiumhead/d7607b1c2745b4bea43507670cb278cf.js"></script></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com2tag:blogger.com,1999:blog-8517901213371477159.post-30295755889364556172017-01-15T14:10:00.002+05:302017-02-25T14:08:10.721+05:30Scanning X-Ray Films<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
So Recently - because of binge running - I ended up with pain in my right thigh. So I had to visit an orthopedic doctor who diagnosed me with a pulled <a href="http://www.spine-health.com/wellness/exercise/stretches-and-exercise-sciatic-pain-piriformis-syndrome" target="_blank">sciatica</a>. We got an X-Ray done to make sure it wasn't the spine that was digging into the nerve to cause pain. It wasn't. No I usually digitize my medical records myself - the prescriptions and lab reports. This time I had an X-Ray film that I needed to scan with a regular scanner.<br />
Drawing inspiration from https://www.youtube.com/watch?v=NM5XzDYfG60 here is what I got:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCxS96lavBB-zBv7s0uxZX4OEzNmZRhKCzpgDhDAiJe2X1j_dx9jByi9h7ET-QH83s_ShL7mh3Y2YRN8ywvSKnQy1tPQHy4kfm-JSnTULujA-x89dLqXC48BPE0DC7N65eUe9F04X6Yw0/s1600/img217.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCxS96lavBB-zBv7s0uxZX4OEzNmZRhKCzpgDhDAiJe2X1j_dx9jByi9h7ET-QH83s_ShL7mh3Y2YRN8ywvSKnQy1tPQHy4kfm-JSnTULujA-x89dLqXC48BPE0DC7N65eUe9F04X6Yw0/s640/img217.jpg" width="464" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Trial 1: Regular scan on Epson L550. Regular settings</td></tr>
</tbody></table>
<br />
<hr />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeKvNUK3jrnzA7Lemgby2wiMONulXyDZEIrrfEsSHYJxo5WQCMb8ibd9h0aOZKDQkD5V2uzp8A7gQ98EeBQL9O07IkD5t38LumXz5OrOqAZTZJeWtLeYlabp1mZzOkJ5WfBpJaOL9Lyh4/s1600/img218.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeKvNUK3jrnzA7Lemgby2wiMONulXyDZEIrrfEsSHYJxo5WQCMb8ibd9h0aOZKDQkD5V2uzp8A7gQ98EeBQL9O07IkD5t38LumXz5OrOqAZTZJeWtLeYlabp1mZzOkJ5WfBpJaOL9Lyh4/s640/img218.jpg" width="464" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Trial 2: My friend has a Lenovo yoga 500 laptop - the one whose screen can be<br />
flipped 360 degrees and turned into a tablet PC. I did just that and used it as a backlight<br />
for the X-Ray film. I created a 1920x1080 sized image in mspaint with nothing but white in it.<br />
I used IrfanView to display the image fullscreen and placed the laptop over the X-Ray film on the scanner.<br />
Performed the scan with regular settings and got immediately improved results!<br />
All I needed to do was to somehow remove the magenta and light green lines caused by scanning the screen.<br />
<span style="font-size: 12.8px;">Some sort of diffuser was needed.</span><br />
<span style="font-size: 12.8px;"><br /></span>
<span style="font-size: 12.8px;"><br /></span>
<br />
<span style="font-size: 12.8px;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIdkVRf9F8Q6RtdqiEFhxsfrtHFRFejS0PWixgdx7c5osEAJZLxi0_45wBgLGYMqgoZM5eJlrX4-NQoPA_1Yp9BLANGke66GjVydEFq1S183eI0mOo6OD5SCrNr2nhOq4P45t3Smp8amU/s1600/2017-01-15+13.40.53.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIdkVRf9F8Q6RtdqiEFhxsfrtHFRFejS0PWixgdx7c5osEAJZLxi0_45wBgLGYMqgoZM5eJlrX4-NQoPA_1Yp9BLANGke66GjVydEFq1S183eI0mOo6OD5SCrNr2nhOq4P45t3Smp8amU/s320/2017-01-15+13.40.53.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px;">Lenovo yoga 500 as a backlight</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy0oVRNfONVQ_57CFPWS1z63ypOTgjYtwf0MKbRMOg_T-EuSp76hv_hANCRHezfqUQhCUUPyhzPJhqsLN-80OR-l7IwSEwV1E_KiNx8cCTAv6LQytKG_Ceoa58pyJr3Z2VU4yS0xEBp-U/s1600/2017-01-15+13.41.38.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy0oVRNfONVQ_57CFPWS1z63ypOTgjYtwf0MKbRMOg_T-EuSp76hv_hANCRHezfqUQhCUUPyhzPJhqsLN-80OR-l7IwSEwV1E_KiNx8cCTAv6LQytKG_Ceoa58pyJr3Z2VU4yS0xEBp-U/s320/2017-01-15+13.41.38.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px;">Lenovo Yoga 500 as backlight</td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<hr />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3Tvki6lue4Ya9eCK64cYNgLRRP7-8e9lJLSJemvIFk0ODqr9w8aSrnWMzF91v6yYx5ff_Sn8qaKwujBgZRb7XTPTflaRAqhMaZWBsodcw9vhz1JNMp0w98CRNlMM0KO0m93Sxto1d5fI/s1600/img219.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3Tvki6lue4Ya9eCK64cYNgLRRP7-8e9lJLSJemvIFk0ODqr9w8aSrnWMzF91v6yYx5ff_Sn8qaKwujBgZRb7XTPTflaRAqhMaZWBsodcw9vhz1JNMp0w98CRNlMM0KO0m93Sxto1d5fI/s640/img219.jpg" width="464" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Trial 3: Used a copier paper as a diffuser between the tablet PC screen and X-Ray: No Joy</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4cFFSZ2y2LaFipHXHbCoE_HbeqtN81dEZ7s_ttLNdUEZsZCBdWDevMK9E6qoKXBF2ZA5Sixc8Zz5ibXipxTo4Nab3kixiZJ2QHx3mWkaAnykibD767A6cOLNyQ8_KSU4cmhobYmJesvk/s1600/2017-01-15+13.41.27-2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4cFFSZ2y2LaFipHXHbCoE_HbeqtN81dEZ7s_ttLNdUEZsZCBdWDevMK9E6qoKXBF2ZA5Sixc8Zz5ibXipxTo4Nab3kixiZJ2QHx3mWkaAnykibD767A6cOLNyQ8_KSU4cmhobYmJesvk/s320/2017-01-15+13.41.27-2.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">75 gsm copier paper as diffuser</td></tr>
</tbody></table>
</div>
<hr />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIcEDB6FN_1bzQEceh2TWgKHlxdhjpl8sZa6VenU5pOlpEkxvCYn1w_Qd_BXF29w6m1PIj4aV5v6VGWcjdr59SflolAxC7uKkC3nX6Tn2zHBavyWA-6D-XNPEdo88N3C_gEcWEaKSuJC4/s1600/img220.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIcEDB6FN_1bzQEceh2TWgKHlxdhjpl8sZa6VenU5pOlpEkxvCYn1w_Qd_BXF29w6m1PIj4aV5v6VGWcjdr59SflolAxC7uKkC3nX6Tn2zHBavyWA-6D-XNPEdo88N3C_gEcWEaKSuJC4/s640/img220.jpg" width="464" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Trial 4: Used "Clear Plastic Folder Sheet" as diffuser between the X-Ray and backlight (Tablet Pc screen) : Perfect</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Dv9sX1FtRvp-opVvWBvtPINNoMx8OabTZpKJuacen-vsDHxDM6y-paLfdAGlKgNiPlwk5MneOfE5HFEXU-7w0eCZIhtBcWKgcD8TG4kL-FqAiM6cy6LLPGiR_2ZCedDaGowlUag2_NY/s1600/2017-01-15+13.51.25.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Dv9sX1FtRvp-opVvWBvtPINNoMx8OabTZpKJuacen-vsDHxDM6y-paLfdAGlKgNiPlwk5MneOfE5HFEXU-7w0eCZIhtBcWKgcD8TG4kL-FqAiM6cy6LLPGiR_2ZCedDaGowlUag2_NY/s320/2017-01-15+13.51.25.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Folder sheet as diffuser</td></tr>
</tbody></table>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-90247966889541038572016-12-20T17:59:00.002+05:302017-02-28T14:34:45.362+05:30Setting up TL-WPS510U Wireless Print Server<div dir="ltr" style="text-align: left;" trbidi="on">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1nKiTsw6Zt40TVHqz02zqLaaZjZYc2X3qKitl8aVRif29Zw0AjR_V_ungnHySUXD2YmeR1nQssDds-m1tZjwy0E1R1UvtKEqEWGbNLKBhhpCZ5Ul7WGXPPiquivSjAetbpikFXa2L_LI/s1600/2016-12-20+17.55.52.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1nKiTsw6Zt40TVHqz02zqLaaZjZYc2X3qKitl8aVRif29Zw0AjR_V_ungnHySUXD2YmeR1nQssDds-m1tZjwy0E1R1UvtKEqEWGbNLKBhhpCZ5Ul7WGXPPiquivSjAetbpikFXa2L_LI/s400/2016-12-20+17.55.52.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">HP LaserJet 1020 plus working fine with TL-WPS510U wireless print server</td></tr>
</tbody></table>
<br />
We have an HP LaserJet 1020 plus which we wanted to share on our network. Since this is a printer which only has a USB port, it can be shared by connecting it to a windows computer and <a href="http://www.howtogeek.com/howto/windows-7/share-files-and-printers-in-windows-7-with-homegroup/" target="_blank">sharing the printer via homegroup</a>. But this required us to keep the connected computer on all the time.<br />
<br />
So I decided to try out the <a href="http://www.amazon.in/TP-Link-TL-WPS510U-150Mbps-Pocket-Sized-Wireless/dp/B003CFAU0U" target="_blank">TP-Link Wireless Print Server TL-WPS510U</a>. In India it costs around ₹5000 and so it makes sense for anyone to go for this device to retro fit your old printer into a a network capable one.<br />
<br />
But there is a caveat. The supplied CD which allows you to configure the software won't work on any PC. The TL-WPS510U is configured to join an "Ad-Hoc" WiFi network named WLAN-PS. The supplied software on your CD, makes your PC join this Ad-Hoc network and then sends commands and credentials to the TL-WPS510U over this Ad-Hoc network and instructs it to join to your home/office's WiFi network (i.e. your WiFi Router which operates in infrastructure mode).<br />
<br />
Now now all WiFi adapters support Ad-Hoc mode. So the software on the CD supplied with TL-WPS510U will not work on all computers. To check if the WiFi adapter on your PC supports Ad-Hoc mode, type the following command in the Command Prompt Window (Press the Windows Key + R and type cmd and press enter):<br />
<br />
netsh wlan show drivers<br />
<br />
I executed this command on two of the computers I have access to. Check the field "Hosted network supported". If it says "Yes" then your computer can host ad-hoc networks.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKDBI9YhLF4YW2MBKNqF0r8EEIKhDbStdM-26J3Vvg_57FFsVkm6bN_lem6SB4iGcslISdX4Sd4xi6ev8OAx7FM_sgW5uBDC0mnjJv29f3IO0-CwUX6PJYAIcTha2Oy6Nc2AxNjtnU7sQ/s1600/Screenshot+2016-12-20+16.58.28.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKDBI9YhLF4YW2MBKNqF0r8EEIKhDbStdM-26J3Vvg_57FFsVkm6bN_lem6SB4iGcslISdX4Sd4xi6ev8OAx7FM_sgW5uBDC0mnjJv29f3IO0-CwUX6PJYAIcTha2Oy6Nc2AxNjtnU7sQ/s400/Screenshot+2016-12-20+16.58.28.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The Intel(R) Dual Band Wireless-AC 3165 does not support ad-hoc mode</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibK7lkcUU_4PrWr9WOxHxljOlQ5EoXzbUfrYP4ufkWIMSI7RiVNyNZ8ExCFlXdRsh-zXw9zWGDyDkRHCaJBwhWCX8_Jt_kOCczBWFQ3I2YRgDdKQ1xiGa1pW2_SXWGLWVLMsIoq3g7Mk0/s1600/Clipboard01.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibK7lkcUU_4PrWr9WOxHxljOlQ5EoXzbUfrYP4ufkWIMSI7RiVNyNZ8ExCFlXdRsh-zXw9zWGDyDkRHCaJBwhWCX8_Jt_kOCczBWFQ3I2YRgDdKQ1xiGa1pW2_SXWGLWVLMsIoq3g7Mk0/s400/Clipboard01.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"> Intel(R) Dual Band Wireless-AC 3160 does support ad-hoc mode</td></tr>
</tbody></table>
Sometimes it might be possible to upgrade your WiFi Chipset drivers and have the ad-hoc capability enabled in the new drivers. But if that does not work for you, make sure you run the CD that came with TL-WPS510U only on a computer that supported hosted networks. Before you run the CD on a particular computer, will need to make sure that the computer has the target printers drivers pre-installed on it. To do that, connect the printer to your computer via USB to the computer and install the driver from the CD supplied with the printer. And once that is done, you can go ahead with setting up the print server for it.<br />
<br />
Once you have configured the TL-WPS510U and gotten it connected to your network, you will need to go to each computer on the network and configure them to be able to use the printer. To do that, make sure you have the printer drivers installed on all the computers that you want should be able to print to the printer over network.<br />
<br />
Now you can run the CD on each computer you wanted to connect to the printer. When you are doing so, make sure to select "Setup Wizard" instead of "Easy Setup". We use "Easy Setup" on on the first computer when we are trying to configure the TL-WPS510U to connect to our home/office WiFi. For all consecutive computers on which u want to use the printer, select the "Setup Wizard". Once the printer server has connected to the network, you no longer need the computers to support "Hosted network" to be able for it to print to the printer via the print server.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy9RKx4bOti2xkk7Ed7MawYIRESaPRF1MXLF8PZpq7-XN8NX-t584NbXkMeq_aPPwKlhwK4eq5MRdThCDyb7L0F7G2AvP973bxxBd1b_8HVB1Y_AUFs-nNJ0qH7-7HGJsaa9bpjVglJCI/s1600/Screenshot+2016-12-20+17.46.17.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="314" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy9RKx4bOti2xkk7Ed7MawYIRESaPRF1MXLF8PZpq7-XN8NX-t584NbXkMeq_aPPwKlhwK4eq5MRdThCDyb7L0F7G2AvP973bxxBd1b_8HVB1Y_AUFs-nNJ0qH7-7HGJsaa9bpjVglJCI/s400/Screenshot+2016-12-20+17.46.17.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Select Setup Wizard on all consecutive computers</td></tr>
</tbody></table>
<br />
In case you want configure the computer to connect to a printer over the network via print server - without using the print server driver CD, go to "Devices and Printers" and click on "Add a printer". Click on "The printer that wasn't listed" and then from the following screen click on "Add a printer using TCP/IP address or hostname".<br />
<br />
If you were using the CD, the support software would have automatically discovered the print server on your network. But while performing the steps manually, you will need to know the IP address of the print server. To do that, you can look up the list of devices and the IP addresses assigned to them from your WiFi router's admin console. It is recommended that you assign a static IP address to the print server during initial configuration (i.e. when you are running the CD to connect the print server to the network).<br />
<br />
Once you go ahead with selecting "Add a printer using TCP/IP address or hostname", you will need to know the setting to use with the print server, here are the settings (Change the IP address to your own print server's IP address)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrCSSbLfezkRCCic9D8OfVwYpwzQR18ysyxzcO_biYq1bYQXXOMcathYiEDxMOkf6t1TxbhaJvK2foKR72lMxPtqwuMYs15rG0EpQbF7VZEOk_dJ21MTdFbd_WkRxvfuIeLPR5l-9E7Mc/s1600/Screenshot+2016-12-13+17.45.07.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrCSSbLfezkRCCic9D8OfVwYpwzQR18ysyxzcO_biYq1bYQXXOMcathYiEDxMOkf6t1TxbhaJvK2foKR72lMxPtqwuMYs15rG0EpQbF7VZEOk_dJ21MTdFbd_WkRxvfuIeLPR5l-9E7Mc/s400/Screenshot+2016-12-13+17.45.07.png" width="377" /></a></div>
<br />After this screen, it will ask you to select the make and model of the printer that is attached to the print server, make sure that you select the correct one.<br />
<br /></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com1tag:blogger.com,1999:blog-8517901213371477159.post-3118461879308652692016-12-04T14:52:00.000+05:302016-12-04T14:52:36.093+05:30ESP8266 + DHT22 + Arduino + Web Server<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
So here is a modified version of how to get a DHT22 working on ESP8266 NodeMcu board using the Arduino IDE (not Lua)<br />
<br />
The project is based on:<br />
<a href="http://randomnerdtutorials.com/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide/">http://randomnerdtutorials.com/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide/</a><br />
<br />
<div style="text-align: left;">
</div>
<ol style="text-align: left;">
<li>Get the components and assemble them. In India you can find these on <a href="http://vishaworld.com/" target="_blank">VishaWorld.com</a></li>
<ol>
<li>NodeMcu ESP8266 | <a href="http://www.vishaworld.com/ESP8266-NodeMCU-id-2414299.html" target="_blank">Link</a></li>
<li>DHT22 | </li>
<li>Male-Male Jumper Wires | </li>
<li>Bread Board | <a href="http://www.vishaworld.com/Prototyping-Tools/Transparent-Breadboard-id-2421102.html" target="_blank">Link</a></li>
<li>MicroUSB cable | </li>
</ol>
<li>Assemble the circuit as shown. Connect the Data pin of SHT22 to D2 of NodeMcu (which is referred to pin 4 in Arduino IDE)</li>
<li>Install the driver for USB-Serial chip on your PC:<br /><a href="http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx" target="_blank">http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx</a></li>
<li>Install Arduino on your computer and install support for ESP8266 Board, refer:<br /><a href="https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon" target="_blank">https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon</a></li>
<li>Install the DHT-sensor-library-master library as outlined here:<br /><a href="http://randomnerdtutorials.com/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide/" target="_blank">http://randomnerdtutorials.com/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide/</a></li>
<li>You would need to download and place Adafruit_Sensor.h in this same library folder as well. Get that file from: <a href="https://github.com/adafruit/Adafruit_Sensor/blob/master/Adafruit_Sensor.h" target="_blank">https://github.com/adafruit/Adafruit_Sensor/blob/master/Adafruit_Sensor.h</a><br />Click on "Raw" to get the file.</li>
<li>Copy the code below, and download it into your ESP8266 NodeMcu board. Make sure to select the proper board and COM port.</li>
</ol>
<div>
To test:</div>
<div>
<ol style="text-align: left;">
<li>Connect your mobile to the WiFi hotspot created by ESP8266 : Temperature_Server<br />Password is: vishaworld.com</li>
<li>Make sure to turn off the 3G data connection on your phone. Andorid will report that the wifi network "Temperature_Server" does not provide internet access. Ignore the message.</li>
<li>Open chrome and punch in 10.10.10.10 in the URL field and ESP8266 will serve you with the latest reading from the temperature sensor.</li>
</ol>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoiMCAJW4ZhWR_O3i12v2bntKDhI4ekg0QB7YIXLWLbAIgwiWP1n3sL1axMxGA1heeNNQg7r-mfuuda99DmrEO-RYZj9WfpqmJFVdCBttaZRouqxNjW27VD4719Id8peY9Gh6yq4kIRcA/s1600/IMG_20161203_191325547.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoiMCAJW4ZhWR_O3i12v2bntKDhI4ekg0QB7YIXLWLbAIgwiWP1n3sL1axMxGA1heeNNQg7r-mfuuda99DmrEO-RYZj9WfpqmJFVdCBttaZRouqxNjW27VD4719Id8peY9Gh6yq4kIRcA/s400/IMG_20161203_191325547.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Xw_g4fTPPioa4anAzRDIDTEe5opRUNmdnHgv9EF6WjxbrKQuoFuBmh9Qv7r7cYVyxAQTdDq4-BARXcGfAkzMcKoQSCdX4bvEeShQmHt15-NhYMVdY2TA_5CGC0SUKEa2hIJe5oFel88/s1600/Screenshot_20161203-225640.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Xw_g4fTPPioa4anAzRDIDTEe5opRUNmdnHgv9EF6WjxbrKQuoFuBmh9Qv7r7cYVyxAQTdDq4-BARXcGfAkzMcKoQSCdX4bvEeShQmHt15-NhYMVdY2TA_5CGC0SUKEa2hIJe5oFel88/s400/Screenshot_20161203-225640.png" width="225" /></a></div>
<br />
<br />
<br /></div>
</div>
</div>
<script src="https://gist.github.com/lithiumhead/de9b65758b7d834754d02d3675ec368b.js"></script>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0tag:blogger.com,1999:blog-8517901213371477159.post-2737479942648095752016-11-14T19:10:00.001+05:302016-11-15T17:17:15.475+05:30Mounting ARM Linux (OLinuXino/Raspberry Pi) SD card .img files on Desktop PC to access its rootfs<div dir="ltr" style="text-align: left;" trbidi="on">
Linux distributions for embedded ARM board like Raspberry Pi or iMX233-OLinuXino-MAXI are available as prebuilt SD card images supplied as raw .img files.<br />
For example, .img files for ArchLinux are available for <a href="http://archlinuxarm.org/platforms/armv6/raspberry-pi#qt-platform_tabs-ui-tabs2" target="_blank">Raspberry Pi</a> and <a href="http://archlinuxarm.org/platforms/armv5/olinuxino#qt-platform_tabs-ui-tabs2" target="_blank">OLinuXino</a>.<br />
These files can be written to SD cards using the program <a href="http://en.wikipedia.org/wiki/Dd_(Unix)" target="_blank">dd</a> on Linux or <a href="http://sourceforge.net/projects/win32diskimager/" target="_blank">Win32 Disk Imager</a> on Windows.<br />
<br />
These files contain the image of the SD card as a whole including multiple partitions - bootloader/bootlets, rootfs, swap etc.<br />
<br />
At some point of time we might find ourselves wanting to access the files from the rootfs contained within one of the partition of these image files. Accessing the kernel headers folder for cross-compiling kernel modules for these boards can be one such situation. And one does not necessarily need to write the image to an SD card and mount it back on ones desktop to achieve this.<br />
<br />
Major Hayden has straightforward instructions <a href="http://rackerhacker.com/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/" target="_blank">here</a> on how to mount .img files which contain multiple partitions.<br />
<br />
So when I found myself wanting to extract the rootfs from ArchLinux distribution for OLinuXino (ArchLinuxARM-2014.02-olinuxino-rootfs.img) onto my Ubuntu 12.04 32 bit Desktop, here are the steps I followed:<br />
<br />
<br />
<b>Analyse the image file using the fdisk and file commands:</b><br />
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_JA94Kg1_tlt7j01BQiuq6kb_d00XbsvJUthstwOpu8iWfSaw_mx6VN20VFs8aNstME8otTxvlZwmlSEu7XMqhPT34YLXpwLZ-i3nW9L0I57kXYkyCAHARehxpkEoIyejr2ia1ucmCOg/s1600/Clipboard01.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_JA94Kg1_tlt7j01BQiuq6kb_d00XbsvJUthstwOpu8iWfSaw_mx6VN20VFs8aNstME8otTxvlZwmlSEu7XMqhPT34YLXpwLZ-i3nW9L0I57kXYkyCAHARehxpkEoIyejr2ia1ucmCOg/s640/Clipboard01.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">There are two partitions, the first one is for the bootloader and the second one is the rootfs. We want to mount the second one</td></tr>
</tbody></table>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
The start sector for the second partition which houses the rootfs is 67584. We need to mount that. Since block size is 512, we need to mount starting from 67584*512 byte 34603008<br />
<div>
<br /></div>
Make a folder for mounting the rootfs. I named mine "rootfs"<br />
<br />
And issue the command to mount:<br />
<b>sudo mount -o ro,loop,offset=34603008 ArchLinuxARM-2014.02-olinuxino-rootfs.img rootfs</b><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBweZQ5lGtVO7hdiG9yBuHEZJ7vuKbK8D8YenhF4WYqg-f_8YUwsAM0IYdZVm5KqcoKuHHBfkwtLw7rNZmWDYh29zmEEX61hxfaE_oSzB5PkStqAfWver8oGaOKFyoQoV8623J7NRQwH0/s1600/Clipboard01.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBweZQ5lGtVO7hdiG9yBuHEZJ7vuKbK8D8YenhF4WYqg-f_8YUwsAM0IYdZVm5KqcoKuHHBfkwtLw7rNZmWDYh29zmEEX61hxfaE_oSzB5PkStqAfWver8oGaOKFyoQoV8623J7NRQwH0/s640/Clipboard01.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The rootfs from the .img file is successfully mounted</td></tr>
</tbody></table>
You can even use nautilus to browse the mounted folder!!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyXxU0kWfXKM3UnmGV48SgS50BZp1wE7td43g25sG2M-fj2dsEij90a3tPj2zpOJEkS9FbW7nPFtcaaMT_9-BODAUdACUfUSHiypv_b8ql2i9xcqmS02i-olsmwa8qyOl4YKiWsUHLZQo/s1600/Clipboard01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="197" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyXxU0kWfXKM3UnmGV48SgS50BZp1wE7td43g25sG2M-fj2dsEij90a3tPj2zpOJEkS9FbW7nPFtcaaMT_9-BODAUdACUfUSHiypv_b8ql2i9xcqmS02i-olsmwa8qyOl4YKiWsUHLZQo/s400/Clipboard01.jpg" width="400" /></a></div>
<br /></div>
</div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0Pune, Maharashtra, India18.5204303 73.85674369999992518.2795358 73.534020199999929 18.7613248 74.17946719999992tag:blogger.com,1999:blog-8517901213371477159.post-36034559835720212042016-11-14T18:25:00.001+05:302016-11-14T18:27:34.965+05:30Compiling Linux Kernel modules on OLinuXino (ArchLinux ARM)<div dir="ltr" style="text-align: left;" trbidi="on">
So if you have an OLinuXino and have installed the development tools on the board and successfully compiled userspace programs on it (refer <a href="http://www.electronicsfaq.com/2013/09/helloworld-on-olinuxino-archlinux-arm.html">this blog post</a>), and are feeling adventurous, you can try compiling kernel modules as well. (Make sure you have gcc setup – refer to the blog post linked to above) <br />
<br />
So at the OLinuXino console (Serial or SSH) logged in as root:<br />
<ol>
<li>Install kernel headers: <br /><span style="color: blue; font-family: "courier new";">pacman -S linux-armv5-headers<br /></span> </li>
<li>In your home directory, create the main.c source file: <br /><span style="font-family: "courier new" , "courier" , monospace;"><span style="color: blue;">nano main.c</span> </span><br /> <br />and type the following and save the file:<br />
<!-- HTML generated using hilite.me --><div style="background: #111111; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="background-color: #0f140f; color: #ff0007; font-style: italic; font-weight: bold;">#include <linux/module.h> </span><span style="background-color: #0f140f; color: #008800; font-style: italic;">//Needed by all modules</span>
<span style="background-color: #0f140f; color: #ff0007; font-style: italic; font-weight: bold;">#include <linux/kernel.h> </span><span style="background-color: #0f140f; color: #008800; font-style: italic;">//Needed for KERN_INFO</span>
<span style="color: #cdcaa9; font-weight: bold;">int</span> <span style="color: #ff0086; font-weight: bold;">init_module</span><span style="color: white;">(</span><span style="color: #cdcaa9; font-weight: bold;">void</span><span style="color: white;">)</span> <span style="color: white;">{</span>
<span style="color: white;">printk(KERN_INFO</span> <span style="color: #0086d2;">"Hello world\n"</span><span style="color: white;">);</span>
<span style="background-color: #0f140f; color: #008800; font-style: italic;">//A non 0 return means init_module failed; module can't be loaded.</span>
<span style="color: #fb660a; font-weight: bold;">return</span> <span style="color: #0086f7; font-weight: bold;">0</span><span style="color: white;">;</span>
<span style="color: white;">}</span>
<span style="color: #cdcaa9; font-weight: bold;">void</span> <span style="color: #ff0086; font-weight: bold;">cleanup_module</span><span style="color: white;">(</span><span style="color: #cdcaa9; font-weight: bold;">void</span><span style="color: white;">)</span> <span style="color: white;">{</span>
<span style="color: white;">printk(KERN_INFO</span> <span style="color: #0086d2;">"Goodbye world\n"</span><span style="color: white;">);</span>
<span style="color: white;">}</span>
<span style="color: white;">MODULE_AUTHOR(</span><span style="color: #0086d2;">"Anurag Chugh"</span><span style="color: white;">);</span>
<span style="color: white;">MODULE_DESCRIPTION(</span><span style="color: #0086d2;">"Hello World"</span><span style="color: white;">);</span>
<span style="color: white;">MODULE_LICENSE(</span><span style="color: #0086d2;">"GPL v2"</span><span style="color: white;">);</span>
</pre>
</td></tr>
</tbody></table>
</div>
</li>
<li>While still in your home directory, create the makefile: <br /><span style="font-family: "courier new" , "courier" , monospace;"><span style="color: blue;">nano Makefile</span> </span><br /> <br />and type the following into it:
<!-- HTML generated using hilite.me --><div style="background: #f8f8f8; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: darkgoldenrod;">obj-m</span> <span style="color: #666666;">+=</span> hello.o
<span style="color: darkgoldenrod;">hello-objs</span> <span style="color: #666666;">:=</span> main.o
<span style="color: #00a000;">all</span><span style="color: #666666;">:</span> <span style="color: #666666;">uninstall-kernel-module</span>
make -C /lib/modules/<span style="color: #aa22ff; font-weight: bold;">$(</span>shell uname -r<span style="color: #aa22ff; font-weight: bold;">)</span>/build <span style="color: darkgoldenrod;">M</span><span style="color: #666666;">=</span><span style="color: #aa22ff; font-weight: bold;">$(</span>PWD<span style="color: #aa22ff; font-weight: bold;">)</span> modules
-sudo insmod hello.ko
sudo dmesg -c
<span style="color: #00a000;">clean</span><span style="color: #666666;">:</span> <span style="color: #666666;">uninstall-kernel-module</span>
make -C /lib/modules/<span style="color: #aa22ff; font-weight: bold;">$(</span>shell uname -r<span style="color: #aa22ff; font-weight: bold;">)</span>/build <span style="color: darkgoldenrod;">M</span><span style="color: #666666;">=</span><span style="color: #aa22ff; font-weight: bold;">$(</span>PWD<span style="color: #aa22ff; font-weight: bold;">)</span> clean
sudo dmesg -c
<span style="color: #008800; font-style: italic;">#the '-' in front of the command tells make to continue with the next command incase an error is encountered </span>
<span style="color: #00a000;">install-kernel-module</span><span style="color: #666666;">:</span>
-sudo insmod hello.ko
<span style="color: #00a000;">uninstall-kernel-module</span><span style="color: #666666;">:</span>
-sudo rmmod hello
</pre>
</td></tr>
</tbody></table>
</div>
</li>
<li>Issue the command to clear the kernel message buffer: <br /><span style="color: blue;"><span style="font-family: "courier new" , "courier" , monospace;"><span style="font-family: courier new, courier, monospace;">dmesg –c</span><br /></span></span></li>
<li>Build the kernel module, the make file will automatically load the module as well and the kernel messages will report its execution: <br /><span style="color: blue; font-family: "courier new" , "courier" , monospace;">make</span></li>
</ol>
<span style="color: blue;"> </span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://lh3.googleusercontent.com/-B_7K3EI0jvQ/WCm0IGvVcxI/AAAAAAAAKp4/vFcr2zlX2nk/s1600-h/image%25255B3%25255D.png" style="margin-left: auto; margin-right: auto;"><img alt="image" border="0" height="417" src="https://lh3.googleusercontent.com/-3RE9v0xy774/WCm0I_RKbZI/AAAAAAAAKp8/byypsemIt6U/image_thumb%25255B1%25255D.png?imgmax=800" style="background-image: none; border-color: initial; border-style: initial; border-width: 0px; display: block; float: none; margin: 0px auto 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Successfully compiled and loaded the hellow world kernel module</td></tr>
</tbody></table>
<span style="color: blue;"> </span><br />
<span style="color: blue;"> <br /> </span></div>
Anurag Chughhttp://www.blogger.com/profile/15390575283968794206noreply@blogger.com0