{"id":32844,"date":"2020-06-17T10:47:38","date_gmt":"2020-06-17T02:47:38","guid":{"rendered":"\/blog\/?p=32844"},"modified":"2020-06-17T12:23:36","modified_gmt":"2020-06-17T04:23:36","slug":"piechart-and-meters-reading-using-wio-terminal-and-ardupy","status":"publish","type":"post","link":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/","title":{"rendered":"Piechart and Meters Reading using Wio Terminal and Ardupy"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"960\" height=\"544\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/Piechart-1-1.gif\" alt=\"\" class=\"wp-image-33754\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-left\">It has been 3 months since we released <a href=\"https:\/\/www.seeedstudio.com\/Wio-Terminal-p-4509.html\">Wio Terminal<\/a>. We have got a lot of positive feedbacks and awesome projects from the community. Please refer to our continuously updating blog <a href=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/04\/resource-roundup-for-wio-terminal\/\">Resource Roundup for Wio Terminal: Tutorials, Reviews, and Projects from Community <\/a>to get more <a href=\"https:\/\/wiki.seeedstudio.com\/Wio-Terminal-Getting-Started\/\">details for Wio Terminal<\/a>. Thank you all for liking this cute IoT device! <\/p>\n\n\n\n<p>In this blog, I will take you to look into how to simply use Ardupy to show <strong>piechart and meters reading<\/strong> on Wio Terminal. Firstly, let&#8217;s figure out what is Ardupy in case you haven&#8217;t heard about this extremely easy IDE just released by the Seeed team. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Brief introduction of ArduPy<\/h2>\n\n\n\n<p><a href=\"https:\/\/wiki.seeedstudio.com\/ArduPy\/\">ArduPy <\/a>is a combination of&nbsp;<strong>Arduino<\/strong>&nbsp;and&nbsp;<strong>MicroPython<\/strong>. MicroPython uses the universal Arduino API to control the hardware so that it can be quickly compatible with new platforms.  At the same time, we provide aip package manager. You can transform your favourite Arduino library into a MicroPython library. Through ArduPy, you can use Python to verify ideas quickly, learn python programming, and learn Open-Source hardware. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Getting Started<\/strong><\/h2>\n\n\n\n<p>To get started with ArduPy, first need to install&nbsp;<strong>aip &#8211; ArduPy Integrated Platform<\/strong>&nbsp;is a utility to develop ArduPy and interact witch ArduPy board. It enables users to quickly get started with Ardupy.&nbsp;<strong>aip<\/strong>&nbsp;is meant to be a simple command-line tool. You can customize your own Ardupy firmware through it, without needing to know more details about ArduPy.<\/p>\n\n\n\n<p><em><strong>Install with macOS<\/strong><\/em><\/p>\n\n\n\n<p> For macOS user, you can simply run the following in Terminal to install ArduPy-aip: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>pip3<\/strong> install ardupy-aip <\/code><\/pre>\n\n\n\n<p><strong>Note:<\/strong>&nbsp;please make sure that you have installed&nbsp;<strong>Python 3<\/strong>&nbsp;on macOS. To install Python 3, you can use&nbsp;<a href=\"https:\/\/brew.sh\/\"><strong>Homebrew<\/strong><\/a>&nbsp;which is a software package manager for macOS. Once installed Homebrew, run the following to install python 3:&nbsp;<strong><code>brew install python3<\/code><\/strong>. You can also download and install&nbsp;<a href=\"https:\/\/www.python.org\/downloads\/mac-osx\/\">Python 3 from the official Python website<\/a>. <\/p>\n\n\n\n<p><em><strong>Install with Windows<\/strong><\/em><\/p>\n\n\n\n<p> You can download the latest versions of ArduPy for windows in the below session. Once downloaded, extract the binary&nbsp;<code>aip<\/code>&nbsp;into a directory that is in your&nbsp;<code>PATH<\/code>. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/files.seeedstudio.com\/ardupy\/tools\/aip-0.5.0\/aip.exe\"><strong>For Windows 64 Bit<\/strong><\/a><\/li><\/ul>\n\n\n\n<p><strong>OR<\/strong> if you have&nbsp;<strong>Python 3<\/strong>&nbsp;environment, you can also install using&nbsp;<code>pip3<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>pip3<\/strong> install ardupy-aip <\/code><\/pre>\n\n\n\n<p><em><strong>Install with Linux<\/strong><\/em><\/p>\n\n\n\n<p> For Linux user, you can simply run the following in Terminal to install ArduPy-aip: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>pip3<\/strong> install ardupy-aip <\/code><\/pre>\n\n\n\n<p> <strong>Note:<\/strong>&nbsp;please make sure you have&nbsp;<strong>Python 3<\/strong>&nbsp;installed and&nbsp;<code>pip3<\/code>&nbsp;is up to date. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>ArduPy-aip CLI Getting Started<\/strong><\/h2>\n\n\n\n<p><code><strong>aip<\/strong><\/code>&nbsp;is a <strong>Command-Line Interface<\/strong> <strong>(CLI)<\/strong> for ArduPy, you can use <code>aip<\/code> to install ArduPy libraries, build and flash ArduPy firmware to hardware with ease. Simply use&nbsp;<code>help<\/code>&nbsp;to get more information: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> help<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/files.seeedstudio.com\/wiki\/Wio-Terminal\/img\/aip-help.png\" alt=\"\" width=\"580\" height=\"415\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li> To get board information: <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> board <\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li> To install Arduino libraries binding with ArduPy: <\/li><\/ul>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> <strong>install<\/strong> &lt;ArduPy <strong>LibraryPath<\/strong>&gt; \n<em># Example Usage: <\/em>\n<em># aip install Seeed-Studio\/seeed-ardupy-ultrasonic-sensor<\/em><\/code><\/pre>\n<\/div><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li> To uninstall ArduPy libraries: <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> <strong>uninstall<\/strong> &lt;ArduPy <strong>LibraryPath<\/strong>&gt; <\/code>\n<code><em># Example Usage: <\/em><\/code>\n<code><em># aip uninstall Seeed-Studio\/seeed-ardu<\/em><\/code><em>py-ultrasonic-sensor<\/em><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li> To list installed ArduPy Libraries \uff1a<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> list<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li> To build ArduPy Firmware contains the libraries you installed and the basic ArduPy features: <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> build <\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li> To flash ArduPy Firmware into hardware: <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> flash <\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li> To interact with the board (shell-based file explorer): <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> shell<\/code><\/pre>\n\n\n\n<p> <strong>Note:<\/strong>&nbsp;Once entered the <code>ardupy-mpfshell<\/code>, you can use&nbsp;<code>help<\/code>&nbsp;for more information and commands. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> To run Python file: <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> shell -n -c \"runfile &lt;YourPythonFilePath&gt; [Path]\"<\/code>\n<code><em># Example Usage:<\/em><\/code>\n<code><em># aip shell -n -c \"runfile \/Users\/ansonhe\/Desktop\/ur.py\"<\/em><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li> To load files into the board using the shell: <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> shell -n -c \"put &lt;YourPythonFilePath&gt; [Path]\"<\/code>\n<code><em># Example Usage:<\/em><\/code>\n<code><em># aip shell -n -c \"put \/Users\/ansonhe\/Desktop\/ur.py\"<\/em><\/code>\n <\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li> Entering&nbsp;<strong>REPL<\/strong>&nbsp;mode: <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> shell -c \"repl\" <\/code>\n<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/files.seeedstudio.com\/wiki\/Wio-Terminal\/img\/aip-shell.png\" alt=\"\" width=\"563\" height=\"403\" \/><\/figure><\/div>\n\n\n\n<p><strong><em>For further detailed instructions about ArduPy, please visit <a href=\"https:\/\/wiki.seeedstudio.com\/ArduPy\/\">ArduPy Getting Started<\/a> to explore.<\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Immediate usages <\/h2>\n\n\n\n<p>Here are two samples illustrating the outcomes of using Wio Terminal with ArduPy:<\/p>\n\n\n\n<p><strong>Usage 1 (<a href=\"https:\/\/files.seeedstudio.com\/wiki\/Wio-Terminal-Grove\/res\/PieChart.py\">PieChart<\/a>):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> shell -n -c \"runfile &lt;YourPythonFilePath&gt; [Path]\"\n<em># Example Usage:<\/em>\n# aip shell -n -c \"runfile F:\\Ardupy-wio_terminal\\PieChart.py<\/code><\/pre>\n\n\n\n<p>And the outcome will display on the screen of Wio Terminal as below if all settings are installed properly <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"544\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/Piechart-1-2.gif\" alt=\"\" class=\"wp-image-33757\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p>Usage Code:<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #ffffff;overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em\"><pre style=\"margin: 0;line-height: 125%\"><span style=\"color: #000080;font-weight: bold\">from<\/span> machine <span style=\"color: #000080;font-weight: bold\">import<\/span> LCD, Sprite\n<span style=\"color: #000080;font-weight: bold\">import<\/span> time, math\n\nDEG2RAD = <span style=\"color: #0000FF\">0.0174532925<\/span>\nlcd = LCD()\nlcd.fillScreen(lcd.color.BLACK)\n\n<span style=\"color: #008800;font-style: italic\"># DRAW CIRCLE SEGMENTS<\/span>\n<span style=\"color: #008800;font-style: italic\"># x,y == coords of centre of circle<\/span>\n<span style=\"color: #008800;font-style: italic\"># start_angle = 0 - 359<\/span>\n<span style=\"color: #008800;font-style: italic\"># sub_angle   = 0 - 360 = subtended angle<\/span>\n<span style=\"color: #008800;font-style: italic\"># r = radius<\/span>\n<span style=\"color: #008800;font-style: italic\"># colour = 16 bit colour value<\/span>\n\n<span style=\"color: #000080;font-weight: bold\">def<\/span> fillSegment(x, y, startAngle, subAngle, r, color):\n    <span style=\"color: #008800;font-style: italic\"># Calculate first pair of coordinates for segment start<\/span>\n    sx = math.cos((startAngle - <span style=\"color: #0000FF\">90<\/span>) * DEG2RAD)\n    sy = math.sin((startAngle - <span style=\"color: #0000FF\">90<\/span>) * DEG2RAD)\n    x1 = sx * r + x\n    y1 = sy * r + y\n\n    <span style=\"color: #008800;font-style: italic\"># Draw colour blocks every inc degrees<\/span>\n    <span style=\"color: #000080;font-weight: bold\">for<\/span> i <span style=\"font-weight: bold\">in<\/span> range(startAngle, startAngle+subAngle, <span style=\"color: #0000FF\">1<\/span>):\n        <span style=\"color: #008800;font-style: italic\"># Calculate pair of coordinates for segment end<\/span>\n        x2 = math.cos((i + <span style=\"color: #0000FF\">1<\/span> - <span style=\"color: #0000FF\">90<\/span>) * DEG2RAD) * r + x\n        y2 = math.sin((i + <span style=\"color: #0000FF\">1<\/span> - <span style=\"color: #0000FF\">90<\/span>) * DEG2RAD) * r + y\n\n        lcd.fillTriangle(int(x1), int(y1), int(x2), int(y2), x, y, color)\n\n        <span style=\"color: #008800;font-style: italic\"># Copy segment end to segment start for next segment<\/span>\n        x1 = x2\n        y1 = y2\n    \n<span style=\"color: #000080;font-weight: bold\">def<\/span> main():\n    <span style=\"color: #008800;font-style: italic\"># Draw 4 pie chart segments<\/span>\n    fillSegment(<span style=\"color: #0000FF\">160<\/span>, <span style=\"color: #0000FF\">120<\/span>, <span style=\"color: #0000FF\">0<\/span>, <span style=\"color: #0000FF\">60<\/span>, <span style=\"color: #0000FF\">100<\/span>, lcd.color.RED)\n    fillSegment(<span style=\"color: #0000FF\">160<\/span>, <span style=\"color: #0000FF\">120<\/span>, <span style=\"color: #0000FF\">60<\/span>, <span style=\"color: #0000FF\">30<\/span>, <span style=\"color: #0000FF\">100<\/span>, lcd.color.GREEN)\n    fillSegment(<span style=\"color: #0000FF\">160<\/span>, <span style=\"color: #0000FF\">120<\/span>, <span style=\"color: #0000FF\">60<\/span> + <span style=\"color: #0000FF\">30<\/span>, <span style=\"color: #0000FF\">120<\/span>, <span style=\"color: #0000FF\">100<\/span>, lcd.color.BLUE)\n    fillSegment(<span style=\"color: #0000FF\">160<\/span>, <span style=\"color: #0000FF\">120<\/span>, <span style=\"color: #0000FF\">60<\/span> + <span style=\"color: #0000FF\">30<\/span> + <span style=\"color: #0000FF\">120<\/span>, <span style=\"color: #0000FF\">150<\/span>, <span style=\"color: #0000FF\">100<\/span>, lcd.color.YELLOW)\n    time.sleep(<span style=\"color: #0000FF\">1<\/span>)\n    fillSegment(<span style=\"color: #0000FF\">160<\/span>, <span style=\"color: #0000FF\">120<\/span>, <span style=\"color: #0000FF\">0<\/span>, <span style=\"color: #0000FF\">360<\/span>, <span style=\"color: #0000FF\">100<\/span>, lcd.color.BLACK)\n\n<span style=\"color: #000080;font-weight: bold\">if<\/span> __name__ == <span style=\"color: #0000FF\">&quot;__main__&quot;<\/span>:\n    <span style=\"color: #000080;font-weight: bold\">while<\/span> True:\n        main()\n<\/pre><\/div>\n\n<\/div><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Usage 2 (<a href=\"https:\/\/files.seeedstudio.com\/wiki\/Wio-Terminal-Grove\/res\/Meter.py\">Meter<\/a>):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>aip<\/strong> shell -n -c \"runfile  [Path]\"<\/code>\n<code># Example Usage:<\/code>\n<code># aip shell -n -c \"<\/code>runfile F:\\Ardupy-wio_terminal\\Meter.py\"<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"544\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/Meter.gif\" alt=\"\" class=\"wp-image-33760\" \/><\/figure><\/div>\n\n\n\n<p>Usage code:<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #ffffff;overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em\"><pre style=\"margin: 0;line-height: 125%\"><span style=\"color: #000080;font-weight: bold\">from<\/span> machine <span style=\"color: #000080;font-weight: bold\">import<\/span> LCD\n<span style=\"color: #000080;font-weight: bold\">import<\/span> time, math\n\nM_SIZE = <span style=\"color: #0000FF\">1.3333<\/span>\nLOOP_PERIOD = <span style=\"color: #0000FF\">35<\/span>\n\nltx = <span style=\"color: #0000FF\">0<\/span>\nosx = M_SIZE * <span style=\"color: #0000FF\">120<\/span>\nosy = M_SIZE * <span style=\"color: #0000FF\">120<\/span>\nupdateTime = <span style=\"color: #0000FF\">0<\/span>\nold_analog = -<span style=\"color: #0000FF\">999<\/span>\nd = <span style=\"color: #0000FF\">0<\/span>\n\ntft = LCD()\ntft.fillScreen(tft.color.BLACK)\n\n<span style=\"color: #000080;font-weight: bold\">def<\/span> valmap(value, istart, istop, ostart, ostop):\n  <span style=\"color: #000080;font-weight: bold\">return<\/span> ostart + (ostop - ostart) * ((value - istart) \/ (istop - istart))\n\n<span style=\"color: #000080;font-weight: bold\">def<\/span> plotNeedle(value, ms_delay):\n    <span style=\"color: #000080;font-weight: bold\">global<\/span> old_analog\n    <span style=\"color: #000080;font-weight: bold\">global<\/span> osx, osy, ltx\n    tft.setTextColor(tft.color.BLACK, tft.color.WHITE)\n    <span style=\"color: #000080;font-weight: bold\">if<\/span> (value &lt; -<span style=\"color: #0000FF\">10<\/span>):\n        value = -<span style=\"color: #0000FF\">10<\/span>   <span style=\"color: #008800;font-style: italic\"># Limit value to emulate needle end stops<\/span>\n\n    <span style=\"color: #000080;font-weight: bold\">if<\/span> (value &gt; <span style=\"color: #0000FF\">110<\/span>):\n        value = <span style=\"color: #0000FF\">110<\/span>\n    \n    <span style=\"color: #000080;font-weight: bold\">while<\/span>(value != old_analog):\n        <span style=\"color: #000080;font-weight: bold\">if<\/span> (old_analog &lt; value):\n            old_analog+=<span style=\"color: #0000FF\">1<\/span>\n        <span style=\"color: #000080;font-weight: bold\">else<\/span>:\n            old_analog-=<span style=\"color: #0000FF\">1<\/span>\n    \n        <span style=\"color: #000080;font-weight: bold\">if<\/span> (ms_delay == <span style=\"color: #0000FF\">0<\/span>):\n            old_analog = value\n        \n        sdeg = valmap(old_analog, -<span style=\"color: #0000FF\">10<\/span>, <span style=\"color: #0000FF\">110<\/span>, -<span style=\"color: #0000FF\">150<\/span>, -<span style=\"color: #0000FF\">30<\/span>) <span style=\"color: #008800;font-style: italic\"># Map value to angle<\/span>\n        <span style=\"color: #008800;font-style: italic\"># Calculate tip of needle coords<\/span>\n        sx = math.cos(sdeg * <span style=\"color: #0000FF\">0.0174532925<\/span>)\n        sy = math.sin(sdeg * <span style=\"color: #0000FF\">0.0174532925<\/span>)\n\n        <span style=\"color: #008800;font-style: italic\"># Calculate x delta of needle start (does not start at pivot point)<\/span>\n        tx = math.tan((sdeg + <span style=\"color: #0000FF\">90<\/span>) * <span style=\"color: #0000FF\">0.0174532925<\/span>)\n\n        <span style=\"color: #008800;font-style: italic\"># Erase old needle image<\/span>\n        tft.drawLine(int(M_SIZE * (<span style=\"color: #0000FF\">120<\/span> + <span style=\"color: #0000FF\">20<\/span> * ltx - <span style=\"color: #0000FF\">1<\/span>)), int(M_SIZE * (<span style=\"color: #0000FF\">140<\/span> - <span style=\"color: #0000FF\">20<\/span>)), int(osx - <span style=\"color: #0000FF\">1<\/span>), int(osy), tft.color.WHITE)\n        tft.drawLine(int(M_SIZE * (<span style=\"color: #0000FF\">120<\/span> + <span style=\"color: #0000FF\">20<\/span> * ltx)), int(M_SIZE * (<span style=\"color: #0000FF\">140<\/span> - <span style=\"color: #0000FF\">20<\/span>)), int(osx), int(osy), tft.color.WHITE)\n        tft.drawLine(int(M_SIZE * (<span style=\"color: #0000FF\">120<\/span> + <span style=\"color: #0000FF\">20<\/span> * ltx + <span style=\"color: #0000FF\">1<\/span>)), int(M_SIZE * (<span style=\"color: #0000FF\">140<\/span> - <span style=\"color: #0000FF\">20<\/span>)), int(osx + <span style=\"color: #0000FF\">1<\/span>), int(osy), tft.color.WHITE)\n\n        <span style=\"color: #008800;font-style: italic\"># Re-plot text under needle<\/span>\n        tft.setTextColor(tft.color.BLACK);\n        tft.drawCentreString(<span style=\"color: #0000FF\">&quot;%RH&quot;<\/span>, int(M_SIZE * <span style=\"color: #0000FF\">120<\/span>), int(M_SIZE * <span style=\"color: #0000FF\">70<\/span>), <span style=\"color: #0000FF\">4<\/span>); <span style=\"color: #008800;font-style: italic\"># Comment out to avoid font 4<\/span>\n\n        <span style=\"color: #008800;font-style: italic\"># Store new needle end coords for next erase<\/span>\n        ltx = tx\n        osx = M_SIZE * (sx * <span style=\"color: #0000FF\">98<\/span> + <span style=\"color: #0000FF\">120<\/span>)\n        osy = M_SIZE * (sy * <span style=\"color: #0000FF\">98<\/span> + <span style=\"color: #0000FF\">140<\/span>)\n\n        <span style=\"color: #008800;font-style: italic\"># Draw the needle in the new postion, magenta makes needle a bit bolder<\/span>\n        <span style=\"color: #008800;font-style: italic\"># draws 3 lines to thicken needle<\/span>\n        tft.drawLine(int(M_SIZE * (<span style=\"color: #0000FF\">120<\/span> + <span style=\"color: #0000FF\">20<\/span> * ltx - <span style=\"color: #0000FF\">1<\/span>)),int( M_SIZE * (<span style=\"color: #0000FF\">140<\/span> - <span style=\"color: #0000FF\">20<\/span>)), int(osx - <span style=\"color: #0000FF\">1<\/span>), int(osy), tft.color.RED)\n        tft.drawLine(int(M_SIZE * (<span style=\"color: #0000FF\">120<\/span> + <span style=\"color: #0000FF\">20<\/span> * ltx)), int(M_SIZE * (<span style=\"color: #0000FF\">140<\/span> - <span style=\"color: #0000FF\">20<\/span>)), int(osx), int(osy), tft.color.MAGENTA)\n        tft.drawLine(int(M_SIZE * (<span style=\"color: #0000FF\">120<\/span> + <span style=\"color: #0000FF\">20<\/span> * ltx + <span style=\"color: #0000FF\">1<\/span>)), int(M_SIZE * (<span style=\"color: #0000FF\">140<\/span> - <span style=\"color: #0000FF\">20<\/span>)), int(osx + <span style=\"color: #0000FF\">1<\/span>), int(osy), tft.color.RED)\n\n        <span style=\"color: #000080;font-weight: bold\">if<\/span>(math.fabs(old_analog - value) &lt; <span style=\"color: #0000FF\">10<\/span>):\n            ms_delay += ms_delay \/ <span style=\"color: #0000FF\">5<\/span>\n        \n        time.sleep(ms_delay)\n\n<span style=\"color: #000080;font-weight: bold\">def<\/span> analogMeter():\n    tft.fillRect(<span style=\"color: #0000FF\">0<\/span>, <span style=\"color: #0000FF\">0<\/span>, int(M_SIZE * <span style=\"color: #0000FF\">239<\/span>), int(M_SIZE * <span style=\"color: #0000FF\">126<\/span>), tft.color.LIGHTGREY)\n    tft.fillRect(<span style=\"color: #0000FF\">5<\/span>, <span style=\"color: #0000FF\">3<\/span>, int(M_SIZE * <span style=\"color: #0000FF\">230<\/span>), int(M_SIZE * <span style=\"color: #0000FF\">119<\/span>), tft.color.WHITE)\n\n    tft.setTextColor(tft.color.BLACK)\n\n    <span style=\"color: #008800;font-style: italic\"># Draw ticks every 5 degrees from -50 to +50 degrees (100 deg. FSD swing)<\/span>\n    <span style=\"color: #000080;font-weight: bold\">for<\/span> i <span style=\"font-weight: bold\">in<\/span> range(-<span style=\"color: #0000FF\">50<\/span>, <span style=\"color: #0000FF\">51<\/span>, <span style=\"color: #0000FF\">5<\/span>):\n        <span style=\"color: #008800;font-style: italic\"># Long scale tick length<\/span>\n        tl = <span style=\"color: #0000FF\">15<\/span>\n\n        <span style=\"color: #008800;font-style: italic\"># Coordinates of tick to draw<\/span>\n        sx = math.cos((i - <span style=\"color: #0000FF\">90<\/span>) * <span style=\"color: #0000FF\">0.0174532925<\/span>)\n        sy = math.sin((i - <span style=\"color: #0000FF\">90<\/span>) * <span style=\"color: #0000FF\">0.0174532925<\/span>)\n        x0 = sx * (M_SIZE * <span style=\"color: #0000FF\">100<\/span> + tl) + M_SIZE * <span style=\"color: #0000FF\">120<\/span>\n        y0 = sy * (M_SIZE * <span style=\"color: #0000FF\">100<\/span> + tl) + M_SIZE * <span style=\"color: #0000FF\">140<\/span>\n        x1 = sx * M_SIZE * <span style=\"color: #0000FF\">100<\/span> + M_SIZE * <span style=\"color: #0000FF\">120<\/span>\n        y1 = sy * M_SIZE * <span style=\"color: #0000FF\">100<\/span> + M_SIZE * <span style=\"color: #0000FF\">140<\/span>\n\n        <span style=\"color: #008800;font-style: italic\"># Coordinates of next tick for zone fill<\/span>\n        sx2 = math.cos((i + <span style=\"color: #0000FF\">5<\/span> - <span style=\"color: #0000FF\">90<\/span>) * <span style=\"color: #0000FF\">0.0174532925<\/span>)\n        sy2 = math.sin((i + <span style=\"color: #0000FF\">5<\/span> - <span style=\"color: #0000FF\">90<\/span>) * <span style=\"color: #0000FF\">0.0174532925<\/span>)\n        x2 = sx2 * (M_SIZE * <span style=\"color: #0000FF\">100<\/span> + tl) + M_SIZE * <span style=\"color: #0000FF\">120<\/span>\n        y2 = sy2 * (M_SIZE * <span style=\"color: #0000FF\">100<\/span> + tl) + M_SIZE * <span style=\"color: #0000FF\">140<\/span>\n        x3 = sx2 * M_SIZE * <span style=\"color: #0000FF\">100<\/span> + M_SIZE * <span style=\"color: #0000FF\">120<\/span>\n        y3 = sy2 * M_SIZE * <span style=\"color: #0000FF\">100<\/span> + M_SIZE * <span style=\"color: #0000FF\">140<\/span>\n\n        <span style=\"color: #008800;font-style: italic\"># Yellow zone limits<\/span>\n        <span style=\"color: #000080;font-weight: bold\">if<\/span> (i &gt;= -<span style=\"color: #0000FF\">50<\/span> <span style=\"font-weight: bold\">and<\/span> i &lt; <span style=\"color: #0000FF\">0<\/span>):\n          tft.fillTriangle(int(x0), int(y0), int(x1), int(y1), int(x2), int(y2), tft.color.GREEN)\n          tft.fillTriangle(int(x1), int(y1), int(x2), int(y2), int(x3), int(y3),tft.color.GREEN)\n        \n        <span style=\"color: #008800;font-style: italic\"># Green Zone limits<\/span>\n        <span style=\"color: #000080;font-weight: bold\">if<\/span> (i &gt;= <span style=\"color: #0000FF\">0<\/span> <span style=\"font-weight: bold\">and<\/span> i &lt; <span style=\"color: #0000FF\">25<\/span>):\n            tft.fillTriangle(int(x0), int(y0), int(x1), int(y1), int(x2), int(y2), tft.color.YELLOW)\n            tft.fillTriangle(int(x1), int(y1), int(x2), int(y2), int(x3), int(y3), tft.color.YELLOW)\n        \n        <span style=\"color: #008800;font-style: italic\"># Orange zone limits<\/span>\n        <span style=\"color: #000080;font-weight: bold\">if<\/span> (i &gt;= <span style=\"color: #0000FF\">25<\/span> <span style=\"font-weight: bold\">and<\/span> i &lt; <span style=\"color: #0000FF\">50<\/span>):\n            tft.fillTriangle(int(x0), int(y0), int(x1), int(y1), int(x2), int(y2), tft.color.ORANGE)\n            tft.fillTriangle(int(x1), int(y1), int(x2), int(y2), int(x3), int(y3), tft.color.ORANGE)\n        \n        <span style=\"color: #008800;font-style: italic\"># Short scale tick length<\/span>\n        <span style=\"color: #000080;font-weight: bold\">if<\/span> (i % <span style=\"color: #0000FF\">25<\/span> != <span style=\"color: #0000FF\">0<\/span>):\n            tl = <span style=\"color: #0000FF\">8<\/span>\n        <span style=\"color: #008800;font-style: italic\"># Recalculate coords incase tick length changed<\/span>\n        x0 = sx * (M_SIZE * <span style=\"color: #0000FF\">100<\/span> + tl) + M_SIZE * <span style=\"color: #0000FF\">120<\/span>\n        y0 = sy * (M_SIZE * <span style=\"color: #0000FF\">100<\/span> + tl) + M_SIZE * <span style=\"color: #0000FF\">140<\/span>\n        x1 = sx * M_SIZE * <span style=\"color: #0000FF\">100<\/span> + M_SIZE * <span style=\"color: #0000FF\">120<\/span>\n        y1 = sy * M_SIZE * <span style=\"color: #0000FF\">100<\/span> + M_SIZE * <span style=\"color: #0000FF\">140<\/span>\n\n        <span style=\"color: #008800;font-style: italic\"># Draw tick<\/span>\n        tft.drawLine(int(x0), int(y0), int(x1), int(y1), tft.color.BLACK)\n\n        <span style=\"color: #008800;font-style: italic\"># Check if labels should be drawn, with position tweaks<\/span>\n        <span style=\"color: #000080;font-weight: bold\">if<\/span> (i % <span style=\"color: #0000FF\">25<\/span> == <span style=\"color: #0000FF\">0<\/span>):\n            x0 = sx * (M_SIZE * <span style=\"color: #0000FF\">100<\/span> + tl + <span style=\"color: #0000FF\">10<\/span>) + M_SIZE * <span style=\"color: #0000FF\">120<\/span>\n            y0 = sy * (M_SIZE * <span style=\"color: #0000FF\">100<\/span> + tl + <span style=\"color: #0000FF\">10<\/span>) + M_SIZE * <span style=\"color: #0000FF\">140<\/span>\n\n            <span style=\"color: #000080;font-weight: bold\">if<\/span>(i\/<span style=\"color: #0000FF\">25<\/span> == -<span style=\"color: #0000FF\">2<\/span> ):\n                tft.drawCentreString(<span style=\"color: #0000FF\">&quot;0&quot;<\/span>, int(x0), int(y0) - <span style=\"color: #0000FF\">12<\/span>, <span style=\"color: #0000FF\">2<\/span>)\n            <span style=\"color: #000080;font-weight: bold\">elif<\/span> (i\/<span style=\"color: #0000FF\">25<\/span> == -<span style=\"color: #0000FF\">1<\/span> ):\n                tft.drawCentreString(<span style=\"color: #0000FF\">&quot;25&quot;<\/span>, int(x0), int(y0) - <span style=\"color: #0000FF\">9<\/span>, <span style=\"color: #0000FF\">2<\/span>)\n            <span style=\"color: #000080;font-weight: bold\">elif<\/span> (i\/<span style=\"color: #0000FF\">25<\/span> == -<span style=\"color: #0000FF\">0<\/span> ):\n                tft.drawCentreString(<span style=\"color: #0000FF\">&quot;50&quot;<\/span>, int(x0), int(y0) - <span style=\"color: #0000FF\">7<\/span>, <span style=\"color: #0000FF\">2<\/span>)\n            <span style=\"color: #000080;font-weight: bold\">elif<\/span> (i\/<span style=\"color: #0000FF\">25<\/span> == <span style=\"color: #0000FF\">1<\/span> ):\n                tft.drawCentreString(<span style=\"color: #0000FF\">&quot;75&quot;<\/span>, int(x0), int(y0) - <span style=\"color: #0000FF\">9<\/span>, <span style=\"color: #0000FF\">2<\/span>)\n            <span style=\"color: #000080;font-weight: bold\">elif<\/span> (i\/<span style=\"color: #0000FF\">25<\/span> == <span style=\"color: #0000FF\">2<\/span> ): \n                tft.drawCentreString(<span style=\"color: #0000FF\">&quot;100&quot;<\/span>, int(x0), int(y0) - <span style=\"color: #0000FF\">12<\/span>, <span style=\"color: #0000FF\">2<\/span>)\n        \n            <span style=\"color: #008800;font-style: italic\"># Now draw the arc of the scale<\/span>\n            <span style=\"color: #008800;font-style: italic\"># sx = math.cos((i + 5 - 90) * 0.0174532925)<\/span>\n            <span style=\"color: #008800;font-style: italic\"># sy = math.sin((i + 5 - 90) * 0.0174532925)<\/span>\n            <span style=\"color: #008800;font-style: italic\"># x0 = sx * M_SIZE * 100 + M_SIZE * 120<\/span>\n            <span style=\"color: #008800;font-style: italic\"># y0 = sy * M_SIZE * 100 + M_SIZE * 140<\/span>\n            <span style=\"color: #008800;font-style: italic\"># # Draw scale arc, don&#039;t draw the last part<\/span>\n            <span style=\"color: #008800;font-style: italic\"># if (i &lt; 50):<\/span>\n            <span style=\"color: #008800;font-style: italic\">#     tft.drawLine(int(x0), int(y0), int(x1), int(y1), tft.color.BLACK)<\/span>\n\n        tft.drawString(<span style=\"color: #0000FF\">&quot;%RH&quot;<\/span>, int(M_SIZE * (<span style=\"color: #0000FF\">5<\/span> + <span style=\"color: #0000FF\">230<\/span> - <span style=\"color: #0000FF\">40<\/span>)), int(M_SIZE * (<span style=\"color: #0000FF\">119<\/span> - <span style=\"color: #0000FF\">20<\/span>)), <span style=\"color: #0000FF\">2<\/span>); <span style=\"color: #008800;font-style: italic\"># Units at bottom right<\/span>\n        tft.drawCentreString(<span style=\"color: #0000FF\">&quot;%RH&quot;<\/span>, int(M_SIZE * <span style=\"color: #0000FF\">120<\/span>), int(M_SIZE * <span style=\"color: #0000FF\">70<\/span>), <span style=\"color: #0000FF\">4<\/span>); <span style=\"color: #008800;font-style: italic\"># Comment out to avoid font 4<\/span>\n        tft.drawRect(<span style=\"color: #0000FF\">5<\/span>, <span style=\"color: #0000FF\">3<\/span>, int(M_SIZE * <span style=\"color: #0000FF\">230<\/span>), int(M_SIZE * <span style=\"color: #0000FF\">119<\/span>), tft.color.BLACK); <span style=\"color: #008800;font-style: italic\"># Draw bezel line<\/span>\n\n        plotNeedle(<span style=\"color: #0000FF\">0<\/span>, <span style=\"color: #0000FF\">0<\/span>)\n\n\n<span style=\"color: #000080;font-weight: bold\">def<\/span> initial():\n    analogMeter()\n    updateTime = time.ticks_ms()\n        \n<span style=\"color: #000080;font-weight: bold\">def<\/span> main():\n    <span style=\"color: #000080;font-weight: bold\">global<\/span> updateTime, d\n    <span style=\"color: #000080;font-weight: bold\">if<\/span> (updateTime &lt;= time.ticks_ms()):\n        updateTime = time.ticks_ms() + <span style=\"color: #0000FF\">100<\/span>\n        d += <span style=\"color: #0000FF\">4<\/span>\n        <span style=\"color: #000080;font-weight: bold\">if<\/span> (d &gt;= <span style=\"color: #0000FF\">360<\/span>):\n            d = <span style=\"color: #0000FF\">0<\/span>\n        \n        value = <span style=\"color: #0000FF\">50<\/span> + <span style=\"color: #0000FF\">50<\/span> * math.sin((d+<span style=\"color: #0000FF\">0<\/span>)*<span style=\"color: #0000FF\">0.0174532925<\/span>)\n        <span style=\"color: #000080;font-weight: bold\">print<\/span>(value)\n        plotNeedle(value, <span style=\"color: #0000FF\">0<\/span>)\n\n\n<span style=\"color: #000080;font-weight: bold\">if<\/span> __name__ == <span style=\"color: #0000FF\">&quot;__main__&quot;<\/span>:\n    initial()\n    <span style=\"color: #000080;font-weight: bold\">while<\/span> True:\n        main()\n<\/pre><\/div>\n\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-left\"><em><strong>Don&#8217;t hesitate to visit our <a href=\"https:\/\/wiki.seeedstudio.com\/\">Wiki<\/a> for further interesting usages and also don&#8217;t forget to submit\u00a0any\u00a0technical\u00a0issue\u00a0into\u00a0our <a href=\"http:\/\/forum.seeedstudio.com\/\">Forum<\/a>.<\/strong><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It has been 3 months since we released Wio Terminal. We have got a lot<\/p>\n","protected":false},"author":3503,"featured_media":33817,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[3027,3003],"class_list":["post-32844","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-ardupy","tag-wio-terminal"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Piechart and Meters Reading using Wio Terminal and Ardupy - Latest News from Seeed Studio<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Piechart and Meters Reading using Wio Terminal and Ardupy - Latest News from Seeed Studio\" \/>\n<meta property=\"og:description\" content=\"It has been 3 months since we released Wio Terminal. We have got a lot\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/\" \/>\n<meta property=\"og:site_name\" content=\"Latest News from Seeed Studio\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-17T02:47:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-17T04:23:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-1030x578.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"1030\" \/>\n\t<meta property=\"og:image:height\" content=\"578\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"eason\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"eason\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/\",\"name\":\"Piechart and Meters Reading using Wio Terminal and Ardupy - Latest News from Seeed Studio\",\"isPartOf\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif\",\"datePublished\":\"2020-06-17T02:47:38+00:00\",\"dateModified\":\"2020-06-17T04:23:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/3a57d3910028a2941c4443b8e679136d\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#primaryimage\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif\",\"contentUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif\",\"width\":1066,\"height\":598,\"caption\":\"Piechart and Meters Reading using Wio Terminal and Ardupy\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.seeedstudio.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Piechart and Meters Reading using Wio Terminal and Ardupy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/\",\"name\":\"Latest News from Seeed Studio\",\"description\":\"Emerging IoT, AI and Autonomous Applications on the Edge\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/3a57d3910028a2941c4443b8e679136d\",\"name\":\"eason\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c9782b0229afb0a8930941fa9883e948?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c9782b0229afb0a8930941fa9883e948?s=96&r=g\",\"caption\":\"eason\"},\"url\":\"https:\/\/www.seeedstudio.com\/blog\/author\/eason\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Piechart and Meters Reading using Wio Terminal and Ardupy - Latest News from Seeed Studio","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/","og_locale":"en_US","og_type":"article","og_title":"Piechart and Meters Reading using Wio Terminal and Ardupy - Latest News from Seeed Studio","og_description":"It has been 3 months since we released Wio Terminal. We have got a lot","og_url":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/","og_site_name":"Latest News from Seeed Studio","article_published_time":"2020-06-17T02:47:38+00:00","article_modified_time":"2020-06-17T04:23:36+00:00","og_image":[{"width":1030,"height":578,"url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-1030x578.gif","type":"image\/gif"}],"author":"eason","twitter_card":"summary_large_image","twitter_misc":{"Written by":"eason","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/","url":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/","name":"Piechart and Meters Reading using Wio Terminal and Ardupy - Latest News from Seeed Studio","isPartOf":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#primaryimage"},"image":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#primaryimage"},"thumbnailUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif","datePublished":"2020-06-17T02:47:38+00:00","dateModified":"2020-06-17T04:23:36+00:00","author":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/3a57d3910028a2941c4443b8e679136d"},"breadcrumb":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#primaryimage","url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif","contentUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif","width":1066,"height":598,"caption":"Piechart and Meters Reading using Wio Terminal and Ardupy"},{"@type":"BreadcrumbList","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/17\/piechart-and-meters-reading-using-wio-terminal-and-ardupy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seeedstudio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Piechart and Meters Reading using Wio Terminal and Ardupy"}]},{"@type":"WebSite","@id":"https:\/\/www.seeedstudio.com\/blog\/#website","url":"https:\/\/www.seeedstudio.com\/blog\/","name":"Latest News from Seeed Studio","description":"Emerging IoT, AI and Autonomous Applications on the Edge","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/3a57d3910028a2941c4443b8e679136d","name":"eason","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c9782b0229afb0a8930941fa9883e948?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c9782b0229afb0a8930941fa9883e948?s=96&r=g","caption":"eason"},"url":"https:\/\/www.seeedstudio.com\/blog\/author\/eason\/"}]}},"modified_by":"eason","views":3444,"featured_image_urls":{"full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif",1066,598,false],"thumbnail":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-80x80.gif",80,80,true],"medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-300x168.gif",300,168,true],"medium_large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-768x431.gif",640,359,true],"large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-1030x578.gif",640,359,true],"1536x1536":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif",1066,598,false],"2048x2048":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif",1066,598,false],"visody_icon":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif",32,18,false],"magazine-7-slider-full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner.gif",1066,598,false],"magazine-7-slider-center":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-936x598.gif",936,598,true],"magazine-7-featured":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-1024x574.gif",1024,574,true],"magazine-7-medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-720x380.gif",720,380,true],"magazine-7-medium-square":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/Clean-Work-Place-Blog-Banner-675x450.gif",675,450,true]},"author_info":{"display_name":"eason","author_link":"https:\/\/www.seeedstudio.com\/blog\/author\/eason\/"},"category_info":"<a href=\"https:\/\/www.seeedstudio.com\/blog\/category\/news\/\" rel=\"category tag\">News<\/a>","tag_info":"News","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/32844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/users\/3503"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/comments?post=32844"}],"version-history":[{"count":87,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/32844\/revisions"}],"predecessor-version":[{"id":33878,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/32844\/revisions\/33878"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media\/33817"}],"wp:attachment":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media?parent=32844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/categories?post=32844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/tags?post=32844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}