<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>arduino &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 08 Jul 2025 08:17:18 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>arduino &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[How to make the Watchy vibrate]]></title>
		<link>https://shkspr.mobi/blog/2023/07/how-to-make-the-watchy-vibrate/</link>
					<comments>https://shkspr.mobi/blog/2023/07/how-to-make-the-watchy-vibrate/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 09 Jul 2023 11:34:42 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[watchy]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=46247</guid>

					<description><![CDATA[I am enjoying playing with the eInk Watchy. It is a cute package and is everything I want in a Smart-Watch; geeky, long battery life, and not obnoxious.  But - fuck me! - the documentation is atrocious! Well, that&#039;s a lie. There is no documentation. It has the &#34;Chat to us on Discord&#34; anti-pattern that infects so many otherwise great projects.  So I&#039;m left to figure out how to make the Watchy&#039;s…]]></description>
										<content:encoded><![CDATA[<p>I am enjoying playing with the eInk Watchy. It is a cute package and is everything I want in a Smart-Watch; geeky, long battery life, and not obnoxious.</p>

<p>But - fuck me! - the documentation is atrocious! Well, that's a lie. There is no documentation. It has the "Chat to us on Discord" anti-pattern that infects so many otherwise great projects.</p>

<p>So I'm left to figure out how to make the Watchy's haptics work.</p>

<p>The example watchfaces have a file called <code>settings.h</code> which contains <a href="https://github.com/sqfmi/Watchy/blob/342eb48a497eb3dcb1ec03c5c156937fdec07ba9/examples/WatchFaces/7_SEG/settings.h#L24"><code>.vibrateOClock = true</code></a>. Set that and you'll get a little buzz on the hour, <em>every</em> hour.</p>

<p>But how do you make it buzz when you've hit your step-count goal? Or when the time is 13:37? Or whenever <em>you</em> want?</p>

<p>There's no documentation. And searching the code for "vibrate" or "vibe" or "vibration" yielded nothing.  But I accidentally typo'd my search and entered "vib" - and that did the trick.</p>

<p>In <code>config.h</code> there's this line: <a href="https://github.com/sqfmi/Watchy/blob/342eb48a497eb3dcb1ec03c5c156937fdec07ba9/src/config.h#L25"><code>#define VIB_MOTOR_PIN 13</code></a>.</p>

<p>So, pin 13 is wired in to the vibration motor. We can add that line to our own config file. But how do we turn the buzzer on and off?</p>

<p>With a bit of help from Discord, it became clear:</p>

<pre><code class="language-c">pinMode(VIB_MOTOR_PIN, OUTPUT);     // Set vibration motor pin as an output.
digitalWrite(VIB_MOTOR_PIN, true);  // Enable vibration motor
delay(150);                         // Vibe for 150 ms.
digitalWrite(VIB_MOTOR_PIN, false); // Disable vibration motor.
delay(500);                         // Wait half a second
digitalWrite(VIB_MOTOR_PIN, true);  // Enable vibration motor
delay(250);                         // Vibe for quarter of a second
digitalWrite(VIB_MOTOR_PIN, false); // Stop vibrating
</code></pre>

<p>That's the same as the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate">HTML5 Vibrate API</a> - you can't control the intensity, but you can <a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/">program your own vibration patterns</a>.</p>

<p>I just don't understand why hardware vendors are <em>so</em> crap at writing documentation. Don't they like people using their products?</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=46247&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/07/how-to-make-the-watchy-vibrate/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[An eInk, Wrist-Mounted, TOTP Generator]]></title>
		<link>https://shkspr.mobi/blog/2023/07/an-eink-wrist-mounted-totp-generator/</link>
					<comments>https://shkspr.mobi/blog/2023/07/an-eink-wrist-mounted-totp-generator/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 08 Jul 2023 11:34:09 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[2fa]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[eink]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[watchy]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=46213</guid>

					<description><![CDATA[Behold! Thanks to the power of the Watchy development platform, I now have all my 2FA codes available at the flick of my wrist!    HOWTO  This uses Luca Dentella&#039;s TOTP-Arduino library.  You will need a pre-shared secret which is then converted into a Hex array. Use the OTP Tool for Arduino TOTP Library to get the Hex array, Base32 Encoded Key, and a QR Code to scan into your normal TOTP…]]></description>
										<content:encoded><![CDATA[<p>Behold! Thanks to the power of the <a href="https://shkspr.mobi/blog/2023/06/review-watchy-an-eink-watch-full-of-interesting-compromises/">Watchy</a> development platform, I now have all my 2FA codes available at the flick of my wrist!</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/07/Wrist-TOTP.jpg" alt="A chunky wristwatch showing the time and a selection of 6 digit codes and their corresponding entities." width="1024" height="1024" class="aligncenter size-full wp-image-46214">

<h2 id="howto"><a href="https://shkspr.mobi/blog/2023/07/an-eink-wrist-mounted-totp-generator/#howto">HOWTO</a></h2>

<p>This uses <a href="https://github.com/lucadentella/TOTP-Arduino/">Luca Dentella's TOTP-Arduino library</a>.</p>

<p>You will need a pre-shared secret which is then converted into a Hex array. Use the <a href="https://www.lucadentella.it/OTP/">OTP Tool for Arduino TOTP Library</a> to get the Hex array, Base32 Encoded Key, and a QR Code to scan into your normal TOTP generator.</p>

<p>Add the Hex array into the code below.</p>

<p>To check that it is functioning correctly, either scan the QR code from the OTP Tool above, or use the Base32 Encoded Key with <a href="https://totp.danhersam.com/">an online TOTP generator</a>.</p>

<p>Here's how the code interfaces with the Watchy:</p>

<pre><code class="language-c">#include &lt;Watchy.h&gt; //include the Watchy library
#include "settings.h"
#include "sha1.h"
#include "TOTP.h"

class MyFirstWatchFace : public Watchy{ //inherit and extend Watchy class
    public:
        MyFirstWatchFace(const watchySettings&amp; s) : Watchy(s) {}
        void drawWatchFace(){

          ...

          RTC.read(currentTime);
          time_t epoch = makeTime(currentTime) - 3600; // BST offset


          // The shared secret - convert at https://www.lucadentella.it/OTP/
          uint8_t hmacKey[] = {}; // e.g. {0x4d, 0x79, 0x4c, 0x65, 0x67, 0x6f, 0x44, 0x6f, 0x6f, 0x72};
          int hmacKeyLength = sizeof(hmacKey) / sizeof(hmacKey[0]);

          TOTP totp = TOTP(hmacKey, hmacKeyLength);
          char* epochCode = totp.getCode( epoch );

          display.print(  "TOTP Code Twitter: ");
          display.println( epochCode );

          ...
</code></pre>

<p><a href="https://gitlab.com/edent/watchy-faces/-/tree/main">You can grab the full code from GitLab</a>.</p>

<p>I'm not very good at C++ - so please let me know what terrible mistakes I've made.</p>

<h2 id="is-this-a-good-idea"><a href="https://shkspr.mobi/blog/2023/07/an-eink-wrist-mounted-totp-generator/#is-this-a-good-idea">Is this a good idea?</a></h2>

<p>Well... Yes and no.</p>

<p>TOTP is a strong-ish form of Multi-Factor Authentication. It helps prevent attacks where someone already knows your username and password.  Having a convenient way to get your TOTP codes may make you more likely to use them. It also prevents you from getting locked out of your accounts if your phone dies or is stolen.</p>

<p>Convenient security is <em>good</em> security.</p>

<p>But... Having them on your wrist for everyone to see? I've deliberately made the font as small as I can so it is only readable up close. However, if someone is shoulder-surfing your details, they may well see your wrist. The watch isn't encrypted - so even if you hid the codes behind a button press, anyone who steals your watch will have your codes. If they steal your phone, they need to get through your PIN / biometrics.</p>

<p>Who are your adversaries? If you are trying to evade state-level actors, thieves specifically targeting you for your crypto-holdings, or an untrustworthy spouse - this probably isn't a great idea.  If you don't use 2FA because you don't keep your phone with you - this will probably increase your security posture.</p>

<p>Ultimately, all security measures are a trade-off between convenience and control.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=46213&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/07/an-eink-wrist-mounted-totp-generator/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Stupidly Small eInk Font]]></title>
		<link>https://shkspr.mobi/blog/2023/07/stupidly-small-eink-font/</link>
					<comments>https://shkspr.mobi/blog/2023/07/stupidly-small-eink-font/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 07 Jul 2023 11:34:06 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[eink]]></category>
		<category><![CDATA[watchy]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=46206</guid>

					<description><![CDATA[I have the new Watchy eInk watch. It has a cute little screen with a resolution of 200x200 pixels.  How much text can we cram in there?  A typical watch face looks like this:    My new watch face is far superior and looks like this:    That&#039;s using the GNU Unifont - which works brilliantly on tiny devices.  HOWTO   Download the GNU Unifont Download and compile HarfBuzz Run the HarfBuzz Font…]]></description>
										<content:encoded><![CDATA[<p>I have the new Watchy eInk watch. It has a cute little screen with a resolution of 200x200 pixels.  How much text can we cram in there?</p>

<p>A typical watch face looks like this:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/06/blackberry.jpg" alt="Watch with a big USB cable plugged in." width="2024" height="1518" class="aligncenter size-full wp-image-46198">

<p>My new watch face is <em>far</em> superior and looks like this:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/06/smol.jpg" alt="A chunky eInk watch with a ridiculously small font." width="1024" height="1024" class="aligncenter size-full wp-image-46207">

<p>That's using the GNU Unifont - which works brilliantly on tiny devices.</p>

<h2 id="howto"><a href="https://shkspr.mobi/blog/2023/07/stupidly-small-eink-font/#howto">HOWTO</a></h2>

<ul>
<li>Download the <a href="https://unifoundry.com/unifont/index.html">GNU Unifont</a></li>
<li>Download and compile <a href="https://harfbuzz.github.io/building.html">HarfBuzz</a></li>
<li>Run the <a href="https://harfbuzz.github.io/utilities.html#utilities-command-line-hbsubset">HarfBuzz Font Subsetter</a></li>
<li><code>./hb-subset unifont-15.0.06.ttf abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\!\"\£\$\%\^\&amp;\*\(\)\-\_\=\+\@\~\'\#\,\.\/\?\:\;\&lt;\&gt;\\\| -o latin.ttf</code></li>
<li>Convert the output to AdaFruit's GFX format using <a href="https://rop.nl/truetype2gfx/">truetype2gfx</a> (set the Font Size to 5 points for about the smallest you can reasonably go. But Font Size of 8 is a better compromise between size and readability.)</li>
<li>Follow the <a href="https://watchy.sqfmi.com/docs/create-watchface#basics">tutorial to create a new watch face</a>

<ul>
<li><strong>NOTE</strong> If you put the font file in the same director as the <code>.ino</code> file, you need to include it using <code>#include "latin5pt7b.h"</code></li>
</ul></li>
<li>Compile and upload to your watchy via USB.</li>
</ul>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/06/face.jpg" alt="A tiny pixelated font showing the time." width="600" height="599" class="aligncenter size-full wp-image-46208">

<p>Nice!</p>

<h2 id="next-steps"><a href="https://shkspr.mobi/blog/2023/07/stupidly-small-eink-font/#next-steps">Next Steps</a></h2>

<p>I dunno. Make it bounce around? Print a Shakespearean sonnet? Give me some suggestions!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=46206&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/07/stupidly-small-eink-font/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[3D Printed, Arduino Powered, Educational, Open Source, Micro-Robots!]]></title>
		<link>https://shkspr.mobi/blog/2016/02/3d-printed-arduino-powered-educational-open-source-micro-robots/</link>
					<comments>https://shkspr.mobi/blog/2016/02/3d-printed-arduino-powered-educational-open-source-micro-robots/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 17 Feb 2016 12:01:23 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[3d printing]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[zowi]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=22434</guid>

					<description><![CDATA[Last week I was invited to attend a product launch by BQ.  They&#039;re a small company based out of Spain who create some curiously innovative products - including smartphones which natively run Cyanogen.  I&#039;m particularly looking forward to reviewing their Ubuntu Tablet later in the year.  The thing which really caught my eye was Zowi (pronounced Zoë).  It looks like this:  And it dances like this:  …]]></description>
										<content:encoded><![CDATA[<p>Last week I was invited to attend a product launch by <a href="https://web.archive.org/web/20160220202059/http://www.bq.com/uk/">BQ</a>.  They're a small company based out of Spain who create some curiously innovative products - including smartphones which natively run Cyanogen.  I'm particularly looking forward to <a href="https://shkspr.mobi/blog/2016/01/finding-the-perfect-linux-laptop/">reviewing their Ubuntu Tablet</a> later in the year.</p>

<p>The thing which <strong>really</strong> caught my eye was <a href="https://web.archive.org/web/20160216200436/http://www.bq.com/uk/zowi">Zowi</a> (pronounced Zoë).</p>

<p>It looks like this:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/Zowi.jpg" alt="Zowi" width="1024" height="576" class="aligncenter size-full wp-image-22437">
And it <em>dances</em> like this:</p>

<p></p><div style="width: 620px;" class="wp-video"><video class="wp-video-shortcode" id="video-22434-2" width="620" height="348" autoplay="" preload="metadata" controls="controls"><source type="video/mp4" src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.mp4?_=2"><source type="video/webm" src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.webm?_=2"><source type="video/ogg" src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.ogv?_=2"><a href="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.mp4">https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.mp4</a></video></div><p></p>

<p>Ok, but what is it?</p>

<p>Here's what you need to know.  It's an Arduino powered robot which you can control via BlueTooth.  It's full extensible and <strong>IT COMES WITH AN ALLEN KEY!</strong></p>

<p>This "toy" is designed to be taken apart, remixed, and reassembled.  Undo two screws and get right inside its guts.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/Inside-Zowi-.jpg" alt="Inside Zowi-" width="1022" height="576" class="aligncenter size-full wp-image-22440">

<p>GPIO pins, LED display board, ultrasound sensors, motors, external buttons, and a micro-USB socket.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/Decapitated-Zowi-.jpg" alt="Decapitated Zowi-" width="1024" height="576" class="aligncenter size-full wp-image-22442">

<p>Oh, what's that? You don't like the two-legged style? OK - 3D print your own body for it, like this:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/Remixed-Zowi-.jpg" alt="Remixed Zowi-" width="1024" height="576" class="aligncenter size-full wp-image-22445">

<p>They have <a href="https://github.com/bq">very active GitHub repositories</a> which also include <a href="https://github.com/bq/zowi">the 3D designs if you want to print your own Zowi</a>.</p>

<p>At the demo they had a <a href="https://web.archive.org/web/20160208010442/https://play.google.com/store/apps/details?id=com.bq.zowi">Scratch-like programming interface running on their Android tablets</a>.  Program the robot and play games with it, all from your phone. No PC needed.</p>

<p>My favourite part? "<a href="https://github.com/bqlabs/zowi">This robot is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a>"</p>

<p>The <a href="https://web.archive.org/web/20160216200436/http://www.bq.com/uk/zowi">Zowi will be £80 on launch</a> and I can't wait to get my hands on one.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=22434&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2016/02/3d-printed-arduino-powered-educational-open-source-micro-robots/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.webm" length="272276" type="video/webm" />
<enclosure url="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.mp4" length="295948" type="video/mp4" />
<enclosure url="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.ogv" length="503999" type="video/ogg" />

			</item>
	</channel>
</rss>
