{"id":218,"date":"2015-09-25T15:21:09","date_gmt":"2015-09-25T14:21:09","guid":{"rendered":"http:\/\/npham.dk\/?p=218"},"modified":"2016-01-13T19:01:09","modified_gmt":"2016-01-13T18:01:09","slug":"gif-frame-software","status":"publish","type":"post","link":"https:\/\/npham.dk\/?p=218","title":{"rendered":"GIF frame &#8211; software"},"content":{"rendered":"<p>The software for the animated gif frame, consist of 3 parts.<\/p>\n<ol>\n<li>code for the Arduino, that reads the sd-card and displays it on\u00a0the ledstrips <em>(main board)<\/em><\/li>\n<li>code for the Arduino, that runs the LCD menu <em>(menu)<\/em><\/li>\n<li>code on the PC, which converts a GIF\u00a0into a text file, with the color codes of the GIF.<\/li>\n<\/ol>\n<h2>Arduino sketch<\/h2>\n<p>The two Arduinos communicates via the serial ports.<br \/>\nAt startup the main board, request the menu for the current settings. (it does this\u00a0by sending a <em>request_signal<\/em>)<\/p>\n<pre>Serial.write(REQUEST_DATA);       \/\/ request for new data    - value is 155\r\n<\/pre>\n<p>The menu, then sends the settings in the following format<\/p>\n<pre>Serial.write(START_SIGNAL);       \/\/ 111\r\nSerial.write(loadNext ? 1 : 0);   \/\/ next                    - values 0 or 1\r\nSerial.write(menu.mode);          \/\/ mode (single\/slideshow) - values 0 or 1\r\nSerial.write(menu.repeat);        \/\/ slideshow duration      - values 1 to 50\r\nSerial.write(menu.speed);         \/\/ speed                   - values 10 to 100\r\nSerial.write(menu.brightness);    \/\/ brightness              - values 10 to 60\r\nSerial.write(END_SIGNAL);         \/\/ 222\r\n<\/pre>\n<p>Whenever a change in the menu happens, it will also send this byte array to the main board.<br \/>\nThe menu also,saves the changes to EPROM, so that the settings\u00a0can be restored when power off and on.<\/p>\n<p>Download the sketch + xcode here: <a href=\"http:\/\/npham.dk\/wp-content\/uploads\/2016\/01\/GIF-frame.zip\" rel=\"\">GIF frame<\/a><\/p>\n<h2>PC software<\/h2>\n<p>On the PC side, I used this Processing sketch, but I think i\u00a0really\u00a0is just Java. Kinda like Arduino sketch is C\/C++.<br \/>\n<a href=\"https:\/\/github.com\/MeULEDs\/MeU_Square_GIF_Converter_Teensy\" target=\"_blank\">https:\/\/github.com\/MeULEDs\/MeU_Square_GIF_Converter_Teensy<\/a><\/p>\n<p>I modified the original code, so I only outputs the color codes, and not the Arduino sketch code.<br \/>\nHere is my version:\u00a0<a href=\"http:\/\/npham.dk\/wp-content\/uploads\/2015\/09\/GIF_Converter.pde\" target=\"_blank\">GIF_Converter.pde<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The software for the animated gif frame, consist of 3 parts. code for the Arduino, that reads the sd-card and displays it on\u00a0the ledstrips (main board) code for the Arduino, that runs the LCD menu (menu) code on the PC, which converts a GIF\u00a0into a text file, with the color codes of the GIF. Arduino [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/posts\/218"}],"collection":[{"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/npham.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=218"}],"version-history":[{"count":21,"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/posts\/218\/revisions"}],"predecessor-version":[{"id":264,"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/posts\/218\/revisions\/264"}],"wp:attachment":[{"href":"https:\/\/npham.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/npham.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/npham.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}