{"id":46,"date":"2013-04-27T15:20:17","date_gmt":"2013-04-27T15:20:17","guid":{"rendered":"http:\/\/cto.dyalog.com\/?p=46"},"modified":"2014-07-10T14:17:21","modified_gmt":"2014-07-10T14:17:21","slug":"apl-coming-to-a-robot-near-you","status":"publish","type":"post","link":"https:\/\/www.dyalog.com\/blog\/2013\/04\/apl-coming-to-a-robot-near-you\/","title":{"rendered":"APL &#8211; Coming to a Robot Near You"},"content":{"rendered":"<h2>APL on the C3Pi<\/h2>\n<p>One of the biggest joys of being the CTO of Dyalog is that you get to write code to help evaluate prototypes of proposed language features, or new tools and tutorials that we are planning to make available. This past week has been one of the most exciting for a very long time, because it started with Jason and Liam presenting me with the first fully-assembled <a title=\"C3Pi and the Raspberry Pi learn another language\" href=\"http:\/\/quick2wire.com\/2013\/04\/c3pi-and-the-raspberry-pi-learn-another-language\/\" target=\"_blank\">Dyalog-built C3Pi clone<\/a>!<\/p>\n<p><a href=\"http:\/\/www.dyalog.com\/blog\/wp-content\/uploads\/2013\/04\/DyaBot-Small.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-48\" title=\"My First Robot!\" alt=\"The first Dyalog-build C3Pi Clone\" src=\"http:\/\/www.dyalog.com\/blog\/wp-content\/uploads\/2013\/04\/DyaBot-Small.jpg\" width=\"571\" height=\"322\" srcset=\"https:\/\/www.dyalog.com\/blog\/wp-content\/uploads\/2013\/04\/DyaBot-Small.jpg 571w, https:\/\/www.dyalog.com\/blog\/wp-content\/uploads\/2013\/04\/DyaBot-Small-300x169.jpg 300w, https:\/\/www.dyalog.com\/blog\/wp-content\/uploads\/2013\/04\/DyaBot-Small-500x281.jpg 500w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/a>Jason Rivers has been constructing the hardware, and Liam Flanagan is responsible for the port of Dyalog APL to the Raspberry Pi, which will be the seat of the \u201cbrains\u201d of the robot. We have been talking to the folks at <a title=\"quick2wire.com\" href=\"http:\/\/quick2wire.com\/\" target=\"_blank\">Quick2Wire<\/a> over the winter about this project, primarily with Romilly Cocking, who is one of those select individuals who can boast that he has already achieved the <a title=\"Poetry\" href=\"http:\/\/www.dyalog.com\/blog\/poetry\/\" target=\"_blank\">dream of every programmer<\/a>.<\/p>\n<p>This week, all the bits came together:<br \/>\n\u2022 Jason finished assembling the first C3Pi mockup (we are building 4 units to play with, while we wait for the finished item from Quick2Wire).<br \/>\n\u2022 The CTO purchased and charged two sets of six AA batteries.<br \/>\n\u2022 <a title=\"Dyalog APL Version 12.2 Release Notes\" href=\"http:\/\/help.dyalog.com\/13.2\/index_CSH.htm#RelNotes13.2\/Key%20Features.htm\" target=\"_blank\">Dyalog APL version 13.2<\/a> (Unicode edition only) passes our tests on the Pi, except for an issue with de-normal floating-point numbers caused by a known issue in the Linux kernel. We aim to officially release a free non-commercial version for the Raspberry Pi by mid-May, contact us for an advance copy if you can\u2019t wait.<br \/>\n\u2022 Liam has built a shared library which interfaces <a title=\"APL to I2C Communications Layer (GitHub)\" href=\"https:\/\/github.com\/APLPi\/libi2c-com\" target=\"_blank\">APL to the I2C bus<\/a> which is used to make life a little easier for an APL developer trying to use <a title=\"I-Squared C (Wikipedia)\" href=\"http:\/\/en.wikipedia.org\/wiki\/I%C2%B2C\" target=\"_blank\">I2C<\/a>. We use I2C talk to the Arduino which controls up to 11 outputs and 6 inputs, if I am reading the <a title=\"The Arduino Board\" href=\"http:\/\/arduino.cc\/en\/Reference\/Board\" target=\"_blank\">specification<\/a> correctly. At the moment, we use three outputs for each of two motors: One analog output to control the speed and two digital outputs to activate the motor going either forwards or back.<br \/>\n\u2022 Liam has also constructed some <a title=\"Arduino Command Interpreter - GitHub\" href=\"https:\/\/github.com\/APLPi\/I2CArduinoComm\" target=\"_blank\">temporary code<\/a> we are using while we wait for the updated <a title=\"Quick2Link on GitHub\" href=\"https:\/\/github.com\/quick2wire\/quick2link\" target=\"_blank\">Quick2Link<\/a> code to become available: This is a \u201ccommand interpreter\u201d running on the Arduino which accepts 3-byte commands {pin type, pin number, output value) over the I2C interface, providing a very easy mechanism for APL to drive the Arduino outputs.<\/p>\n<p>Now, that\u2019s a pretty exciting package to find on your desk on a Monday morning! OK, Monday afternoon, to be honest &#8211; the morning was spent with Fiona Smith, our first full-time Technical Writer \u2013 another person who will soon be contributing to our \u201cPi\u201d project. Needless to say, I shortened every meeting for the rest of the week by 5 minutes, and thus managed to find the time to write some APL code capable of driving the robot (press &#8220;play&#8221; below).<\/p>\n<p>We&#8217;ll be keeping the various bits of code up-to-date in repositories under <a href=\"https:\/\/github.com\/APLPi\" target=\"_blank\">https:\/\/github.com\/APLPi<\/a>. If you think you might want to build your own hardware and play along with us, Jason will soon be starting his own series of <a title=\"Jason Rivers Blog\" href=\"http:\/\/www.jasonrivers.co.uk\/category\/dyalog\/\" target=\"_blank\">blog posts about how to build a C3Pi<\/a>. I will write a bit more about the APL code, and the longer term goals of this project, in my next post.<\/p>\n<iframe loading=\"lazy\"  id=\"_ytid_62535\"  width=\"584\" height=\"329\"  data-origwidth=\"584\" data-origheight=\"329\"  src=\"https:\/\/www.youtube.com\/embed\/5UvPouq2c7M?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=0&rel=1&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=1&\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  allow=\"autoplay; encrypted-media\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>APL on the C3Pi One of the biggest joys of being the CTO of Dyalog is that you get to write code to help evaluate prototypes of proposed language features, or new tools and tutorials that we are planning to &hellip; <a href=\"https:\/\/www.dyalog.com\/blog\/2013\/04\/apl-coming-to-a-robot-near-you\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,9,5],"tags":[],"class_list":["post-46","post","type-post","status-publish","format-standard","hentry","category-cto","category-raspberry-pi","category-robots"],"_links":{"self":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":17,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"predecessor-version":[{"id":469,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/46\/revisions\/469"}],"wp:attachment":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}