{"id":48,"date":"2010-07-10T17:00:43","date_gmt":"2010-07-10T17:00:43","guid":{"rendered":"http:\/\/paulsarduino.co.uk\/?p=48"},"modified":"2010-07-10T17:38:13","modified_gmt":"2010-07-10T17:38:13","slug":"pov-code","status":"publish","type":"post","link":"https:\/\/paulsarduino.co.uk\/?p=48","title":{"rendered":"More POV"},"content":{"rendered":"<p>Got some POV code working&#8230;.<\/p>\n<p>Problem is sync &#8211; not synched at all, so you can see what it says but it has no idea when to start the sequence relative to the user waving it about.<\/p>\n<p>We&#8217;ll investigate a switch with a weight on as a synch pulse soon.<\/p>\n<p>Here&#8217;s some pictures of the board so far. The LEDs are mounted on some strip board and a length of old CAT5 connects it to a small shield board which plugs into the Arduino. The CAT5 supplies power and the three control lines for the shift reg.<\/p>\n<p>A photo of LED wavy end bit and another of the whole lot<\/p>\n<figure id=\"attachment_57\" aria-describedby=\"caption-attachment-57\" style=\"width: 150px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/paulsarduino.co.uk\/wp-content\/uploads\/2010\/07\/POVend.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-thumbnail wp-image-57\" title=\"POVend\" src=\"http:\/\/paulsarduino.co.uk\/wp-content\/uploads\/2010\/07\/POVend-150x150.jpg\" alt=\"\" width=\"150\" height=\"150\" \/><\/a><figcaption id=\"caption-attachment-57\" class=\"wp-caption-text\">The bit you wave about<\/figcaption><\/figure>\n<figure id=\"attachment_58\" aria-describedby=\"caption-attachment-58\" style=\"width: 150px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/paulsarduino.co.uk\/wp-content\/uploads\/2010\/07\/allPOV.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-thumbnail wp-image-58\" title=\"allPOV\" src=\"http:\/\/paulsarduino.co.uk\/wp-content\/uploads\/2010\/07\/allPOV-150x150.jpg\" alt=\"\" width=\"150\" height=\"150\" \/><\/a><figcaption id=\"caption-attachment-58\" class=\"wp-caption-text\">Both ends of the cable...<\/figcaption><\/figure>\n<h3>How the code works&#8230;<\/h3>\n<p>Its really simple&#8230; I wrote a C++ application to generate the alphabet. I&#8217;ll post that for download.<\/p>\n<p>Then a message is simply an array containing a list of pointers to smaller letter arrays. Each letter array holds a length byte followed by the binary for the letters. Binary is nice because you can tell by looking whether its right.<\/p>\n<p>So the code that really matters is:<\/p>\n<pre>int* iMsg[] = {H,E,L,L,O};\r\nint iMsgLen = 5;\r\n\r\nvoid loop()\r\n{\r\n  \/\/ send the next column for the current character\r\n  sendByteOut(iMsg[iMsgIndex][iCharIndex]);\r\n\r\n  \/\/ wait a moment\r\n  delay(1);\r\n\r\n  \/\/ move to the next column\r\n  iCharIndex++;\r\n\r\n  \/\/ have we run out of columns for this letter?\r\n  if (iCharIndex == iCharLen)\r\n  {\r\n     \/\/ start at first column - 1 because 0 is length byte\r\n     iCharIndex = 1;\r\n     \/\/ and move to the next letter\r\n     iMsgIndex++;\r\n  }\r\n\r\n  \/\/ now see if we have got to the end of the message\r\n  if (iMsgIndex == iMsgLen)\r\n  {\r\n     \/\/ start at first letter again\r\n     iMsgIndex = 0;\r\n  }\r\n\r\n  \/\/ set the length  - this could be in an if statement - but it really doesn't make much difference\r\n  iCharLen = iMsg[iMsgIndex][0];\r\n\r\n}\r\n<\/pre>\n<p>All the code is in the download area.<\/p>\n<p>Doing the synch things seems like it will be fiddly. Might come back to that after a play with TV output.<\/p>\n<p>Win32 .net application to generate Arduino font source code is her :\u00a0 <a href=\"http:\/\/paulsarduino.co.uk\/wp-content\/uploads\/2010\/07\/POVMaker.exe\">Adruino 8 bit font creator for POV<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Got some POV code working&#8230;. Problem is sync &#8211; not synched at all, so you can see what it says but it has no idea when to start the sequence relative to the user waving it about. We&#8217;ll investigate a switch with a weight on as a synch pulse soon. Here&#8217;s some pictures of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-arduino","category-arproject"],"_links":{"self":[{"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=48"}],"version-history":[{"count":9,"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/48\/revisions\/65"}],"wp:attachment":[{"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paulsarduino.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}