{"id":1607,"date":"2020-01-19T20:20:22","date_gmt":"2020-01-19T20:20:22","guid":{"rendered":"https:\/\/ofalcao.pt\/blog\/?p=1607"},"modified":"2020-01-19T20:41:26","modified_gmt":"2020-01-19T20:41:26","slug":"ev3-code-pilot","status":"publish","type":"post","link":"https:\/\/ofalcao.pt\/blog\/2020\/ev3-code-pilot","title":{"rendered":"EV3 Code Pilot"},"content":{"rendered":"<div class=\"seriesmeta\">This post is part 2 of 3 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/barcode\" class=\"series-357\" title=\"barcode\">barcode<\/a><\/div>\n<p>The first MINDSTORMS programmable bricks, the RCX, had several &#8220;incarnation&#8221;. Most people remember the yellow brick but there were several others, including the Code Pilot that used light sequences as commands. Those VLL codes could be printed as barcodes:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/www.elecbrick.com\/lego\/\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.elecbrick.com\/lego\/vll.gif?w=840\" alt=\"\"\/><\/a><figcaption>From &#8216;http:\/\/www.elecbrick.com\/lego\/&#8217;<\/figcaption><\/figure>\n\n\n\n<p>and the Code Pilot set had a companion sheet with some codes and also key notes that could be used as a barcode piano.<\/p>\n\n\n\n<p>So let&#8217;s try a simple set of instructions:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"932\" src=\"https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2020\/01\/image.png?resize=665%2C932&#038;ssl=1\" alt=\"\" class=\"wp-image-1609\"\/><\/figure>\n\n\n\n<p>The barcodes are just EAN-13 code generated online from <a href=\"https:\/\/www.free-barcode-generator.net\/ean-13\/\">EAN-13 barcode generator<\/a>. They all start with &#8216;560&#8217; (the code for Portugal-based companies) and the remaining 12 digits are just 1\/2\/&#8230;\/5 left padded with zeros. The last digit is the checksum code and is generated by the tool.<\/p>\n\n\n\n<p>So my first program uses a nested dictionary with the EAN-13 codes paired with an action to be spoken. So the program waits for a barcode to be read, checks for the action to be spoken and execute the action we chose:<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"EV3 Code Pilot v1\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/-2bEsQtkG1Y?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Source code:<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/JorgePe\/ev3-barcode\/blob\/master\/codepilot01.py\">https:\/\/github.com\/JorgePe\/ev3-barcode\/blob\/master\/codepilot01.py<\/a><\/p>\n\n\n\n<p>The code sheet used and further developments I might make are also at <a href=\"https:\/\/github.com\/JorgePe\/ev3-barcode\/\">github<\/a>:<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"seriesmeta\">This post is part 2  of 3 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/barcode\" class=\"series-357\" title=\"barcode\">barcode<\/a><\/div><p>The first MINDSTORMS programmable bricks, the RCX, had several &#8220;incarnation&#8221;. Most people remember the yellow brick but there were several others, including the Code Pilot that used light sequences as commands. Those VLL codes could be printed as barcodes: and the Code Pilot set had a companion sheet with some codes and also key notes &hellip; <a href=\"https:\/\/ofalcao.pt\/blog\/2020\/ev3-code-pilot\" class=\"more-link\">Continuar a ler<span class=\"screen-reader-text\"> &#8220;EV3 Code Pilot&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[157,13,158,19,20,148,98],"tags":[],"series":[357],"class_list":["post-1607","post","type-post","status-publish","format-standard","hentry","category-ev3dev-en","category-ev3dev","category-lego-mindstorms-en","category-lego-mindstorms","category-linux","category-linux-en","category-python","series-barcode"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-pV","_links":{"self":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/comments?post=1607"}],"version-history":[{"count":0,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1607\/revisions"}],"wp:attachment":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/media?parent=1607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/categories?post=1607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/tags?post=1607"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/series?post=1607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}