{"id":1065,"date":"2019-10-10T01:15:42","date_gmt":"2019-10-10T01:15:42","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?p=1065"},"modified":"2019-10-10T01:15:42","modified_gmt":"2019-10-10T01:15:42","slug":"final-documentation-laser-etch-a-sketch","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/aboggess\/final-documentation-laser-etch-a-sketch\/","title":{"rendered":"Final Documentation &#8211; Laser &#8220;Etch-a-sketch&#8221;"},"content":{"rendered":"\n<p>A-term of 2019, I began my Light Art Practicum to complete my humanities requirement at WPI. I had to begin thinking about what I wanted my project to be. I knew I wanted to do something unique, something where I could incorporate different aspects of my learnings and hobbies. Being the mechanical engineering that I am, I wanted to design some kind of device that created light with art. I then thought to myself, what if I could control where a laser pointer is pointing and doing something with that. I also wanted it to be interactive and adaptive. I finally decided that I wanted to create a Laser &#8220;Etch-a-sketch.&#8221; <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Initial Idea<\/h3>\n\n\n\n<p>The Laser &#8220;Etch-a-sketch&#8221; would allow a user to draw on any surface using two dials. These two dials would manipulate the XY coordinate of the laser pointer, effectively creating an &#8220;Etch-a-sketch.&#8221; After the user has finished drawing, the Arduino Nano would then quickly &#8220;playback&#8221; what the user has drawn creating a persistence of vision effect. I could add more features down the road, but the main feature was the interactive drawing and playback with the persistence of vision effect.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Design<\/h3>\n\n\n\n<p>The plan was to use the following components:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Arduino Nano for the brains of the project<\/li><li>Breadboard for mounting and wiring all the components<\/li><li>2 &#8211; High-Speed Servos for manipulating the XY coordinate of the laser<\/li><li>Laser Diode<\/li><li>2 &#8211; 1&#8243; Mirrors<\/li><li>Pololu Mini Maestro 18 for the servo driver<\/li><li>5V 2A Wall Wart<\/li><li>2 &#8211; Potentiometers<\/li><li>2 &#8211; Push Button<\/li><\/ul>\n\n\n\n<p>The idea was to use the high-speed servos with mirrors oriented in a specific way that allowed each servo to control one of the axes. The potentiometers would control the position of each servo such that one potentiometer would control the x-axis and the other the y-axis of the laser diode. I designed the base, mounts, and controller in SolidWorks and 3D Printed the parts on my Creality CR-10S. Below are the pictures of the final design in SolidWorks as well as some screenshots from the slicer is was using for 3D printing (Cura 4.0.0 with Creawesome Mod).<\/p>\n\n\n\n<ul class=\"wp-block-gallery columns-2 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"662\" height=\"635\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/FullEtchASketch.jpg\" alt=\"\" data-id=\"1089\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1089\" class=\"wp-image-1089\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/FullEtchASketch.jpg 662w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/FullEtchASketch-313x300.jpg 313w\" sizes=\"auto, (max-width: 662px) 100vw, 662px\" \/><figcaption>Full Assembly of Laser &#8220;Etch-a-sketch&#8221;<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"899\" height=\"715\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/ControlBox.jpg\" alt=\"\" data-id=\"1087\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1087\" class=\"wp-image-1087\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/ControlBox.jpg 899w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/ControlBox-800x636.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/ControlBox-768x611.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/ControlBox-377x300.jpg 377w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><figcaption>Control Box with Potentiometers and Pushbuttons<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"590\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Full-Assembly-with-Laser.png\" alt=\"\" data-id=\"1090\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1090\" class=\"wp-image-1090\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Full-Assembly-with-Laser.png 672w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Full-Assembly-with-Laser-342x300.png 342w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><figcaption>Front View of Laser &#8220;Etch-a-sketch&#8221;<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"534\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/CuraSnapshot-1024x534.jpg\" alt=\"\" data-id=\"1088\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1088\" class=\"wp-image-1088\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/CuraSnapshot-1024x534.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/CuraSnapshot-800x417.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/CuraSnapshot-768x400.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/CuraSnapshot-576x300.jpg 576w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/CuraSnapshot.jpg 1153w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Snapshot from Cura 4.0.0 used for 3D Printing<\/figcaption><\/figure><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">The Wiring<\/h3>\n\n\n\n<p>Below, is a picture of the wiring diagram created in Fritzing. The Arduino is the main control unit where the processing takes place. The potentiometers are wired into the analog inputs. The buttons are wired into the digital inputs. The Red LED (Laser Diode) is wired into a digital output. What is not shown in the diagram in Fritzing, the servos are connected to a Mini Maestro 18 (shown below). The Arduino Nano communicates with the Mini Maestro 18 using a Serial connection via the TX pin on the Arduino. The Mini Maestro 18 receives 5V 2A from a wall wart to power the two servos. <\/p>\n\n\n\n<ul class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"831\" height=\"608\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Fritzing.jpg\" alt=\"\" data-id=\"1093\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1093\" class=\"wp-image-1093\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Fritzing.jpg 831w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Fritzing-800x585.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Fritzing-768x562.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Fritzing-410x300.jpg 410w\" sizes=\"auto, (max-width: 831px) 100vw, 831px\" \/><figcaption>Snapshot of Fritzing<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"903\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/0J9910.1200-1024x903.jpg\" alt=\"\" data-id=\"1094\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1094\" class=\"wp-image-1094\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/0J9910.1200-1024x903.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/0J9910.1200-800x705.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/0J9910.1200-768x677.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/0J9910.1200-340x300.jpg 340w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/0J9910.1200.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Pololul Mini Maestro 18<\/figcaption><\/figure><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">The Final Idea<\/h3>\n\n\n\n<p>Originally, the idea was for the user to draw with the potentiometers and for the &#8220;Etch-a-sketch&#8221; to quickly redraw the users&#8217; input in order to create a persistence of vision effect. This didn&#8217;t work perfectly so I worked on other artistic effects I could create with lasers. I was able to create geometric and abstract shapes. The geometric shapes I could create were lines, triangles, squares, and circles. For the abstract shapes, the two servos would sweep between their minimums and maximums. In the abstract mode, the potentiometers would control the speed at which each individual servo would sweep. This would create some abstract shapes that were unique and changing as the two servos wouldn&#8217;t sweep at the same speed. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Final Product<\/h3>\n\n\n\n<p>Below are some pictures of the final Laser &#8220;Etch-a-sketch.&#8221;<\/p>\n\n\n\n<ul class=\"wp-block-gallery columns-3 wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193349-1-1024x768.jpg\" alt=\"\" data-id=\"1102\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1102\" class=\"wp-image-1102\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193349-1-1024x768.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193349-1-800x600.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193349-1-768x576.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193349-1-400x300.jpg 400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193418-2-1024x768.jpg\" alt=\"\" data-id=\"1105\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1105\" class=\"wp-image-1105\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193418-2-1024x768.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193418-2-800x600.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193418-2-768x576.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193418-2-400x300.jpg 400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193404-1-1024x768.jpg\" alt=\"\" data-id=\"1108\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1108\" class=\"wp-image-1108\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193404-1-1024x768.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193404-1-800x600.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193404-1-768x576.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193404-1-400x300.jpg 400w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193404-1.jpg 2016w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193322-1024x768.jpg\" alt=\"\" data-id=\"1106\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1106\" class=\"wp-image-1106\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193322-1024x768.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193322-800x600.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193322-768x576.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193322-400x300.jpg 400w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193322.jpg 1134w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Fully Assembled<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193355-2-1024x768.jpg\" alt=\"\" data-id=\"1107\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1107\" class=\"wp-image-1107\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193355-2-1024x768.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193355-2-800x600.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193355-2-768x576.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193355-2-400x300.jpg 400w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/20191009_193355-2.jpg 1512w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Controller with Potentiometer and Buttons<\/figcaption><\/figure><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">The Drawings<\/h3>\n\n\n\n<p>Below are some pictures of some of the drawings that the Laser &#8220;Etch-a-sketch&#8221; created in user drawing mode and geometric shape mode. All of the pictures were taken at 1-second exposure.<\/p>\n\n\n\n<ul class=\"wp-block-gallery columns-2 is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/UserDrawn-1024x1024.jpg\" alt=\"\" data-id=\"1115\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1115\" class=\"wp-image-1115\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/UserDrawn-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/UserDrawn-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/UserDrawn-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/UserDrawn-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/UserDrawn-300x300.jpg 300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>User Drawn<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Line-1024x1024.jpg\" alt=\"\" data-id=\"1116\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1116\" class=\"wp-image-1116\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Line-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Line-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Line-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Line-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Line-300x300.jpg 300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Line<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Triangle-1024x1024.jpg\" alt=\"\" data-id=\"1117\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1117\" class=\"wp-image-1117\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Triangle-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Triangle-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Triangle-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Triangle-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Triangle-300x300.jpg 300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Right Triangle<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Square-1024x1024.jpg\" alt=\"\" data-id=\"1118\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1118\" class=\"wp-image-1118\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Square-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Square-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Square-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Square-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Square-300x300.jpg 300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Square<\/figcaption><\/figure><\/li><\/ul>\n\n\n\n<p>Below are more pictures of drawings created in the abstract shape mode.<\/p>\n\n\n\n<ul class=\"wp-block-gallery columns-3 is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract4-1024x1024.jpg\" alt=\"\" data-id=\"1122\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1122\" class=\"wp-image-1122\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract4-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract4-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract4-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract4-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract4-300x300.jpg 300w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract4.jpg 1854w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract3-1024x1024.jpg\" alt=\"\" data-id=\"1121\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1121\" class=\"wp-image-1121\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract3-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract3-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract3-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract3-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract3-300x300.jpg 300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract5-1024x1024.jpg\" alt=\"\" data-id=\"1123\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1123\" class=\"wp-image-1123\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract5-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract5-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract5-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract5-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract5-300x300.jpg 300w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract5.jpg 2006w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract1-1024x1024.jpg\" alt=\"\" data-id=\"1119\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1119\" class=\"wp-image-1119\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract1-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract1-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract1-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract1-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract1-300x300.jpg 300w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract1.jpg 1396w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract2-1024x1024.jpg\" alt=\"\" data-id=\"1120\" data-link=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/?attachment_id=1120\" class=\"wp-image-1120\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract2-1024x1024.jpg 1024w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract2-150x150.jpg 150w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract2-800x800.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract2-768x768.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-content\/uploads\/sites\/11\/2019\/10\/Abstract2-300x300.jpg 300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">The Code<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">#include \nMiniMaestro maestro(Serial);\n\n\/\/ PINS\nconst int xPotPin = 2;     \/\/A1 = X-Pot input port\nconst int yPotPin = 1;     \/\/A2 = Y-Pot input port\nconst int redPin = 3;      \/\/Red Button Pin\nconst int greenPin = 2;    \/\/Green Button Pin\nconst int laserPin = 4;\n\n\/\/X-axis Servo Variables\nconst int xServoMin = 6000; \/\/5750;\nconst int xServoMax = 6750; \/\/7000;\n\nint xServoAngle = 0;\nint xServoAnglePrev = 0;\n\n\/\/Y-axis Servo Variables\nconst int yServoMin = 6000;\nconst int yServoMax = 6750;\n\nint yServoAngle = 0;\nint yServoAnglePrev = 0;\n\n\/\/Pot Variables\nint xPotValue = 0;\nint yPotValue = 0;\n\n\/\/Push Buttons Variables\nbool redVal = false;\nbool greenVal = false;\n\n\/\/Laser Variables\nbool laserOn = false;\n\n\/\/Geometric Shape Variables\nint scaleX = 0;\nint scaleY = 0;\nint shape = 0;\nint index = 0;\nbool debounce = true;\n\nint geometryIndex = 0;\n\nbool upX = true;\nbool upY = false;\n\nint delayTime = 0;\n\nvoid setup() {\n  pinMode(redPin, INPUT);\n  pinMode(greenPin, INPUT);\n  pinMode(laserPin, OUTPUT);\n  Serial.begin(115200);\n}\n\nvoid readValues() {\n  \/\/ READ ALL INPUTS\n  xPotValue = analogRead(xPotPin);\n  yPotValue = analogRead(yPotPin);\n  redVal = digitalRead(redPin);\n  greenVal = digitalRead(greenPin);\n  \/\/ Control Laser On or Off\n  digitalWrite(laserPin, laserOn);\n  \/\/Record Previous Servo Angle Values\n  xServoAnglePrev = xServoAngle;\n  yServoAnglePrev = yServoAngle;\n}\n\nvoid calculateDelay() {\n  delayTime = abs(xServoAngle - xServoAnglePrev) * 0.035;\n}\n\nvoid writeValues() {\n  \/\/ Write to Servos\n  calculateDelay();\n  maestro.setTarget(0, xServoAngle);\n  maestro.setTarget(1, yServoAngle);\n  delay(delayTime);\n}\n\n\/\/ SHAPES\nint lineX[] = {xServoMin, xServoMax};\nint lineY[] = {6375, 6375};\n\nint triangleX[] = {xServoMin, xServoMin, xServoMax};\nint triangleY[] = {yServoMax, yServoMin, yServoMax};\n\nint squareX[] = {xServoMin, xServoMin, xServoMax, xServoMax};\nint squareY[] = {yServoMax, yServoMin, yServoMin, yServoMax};\n\nint circleX[] = {6000, 6187, 6375, 6562, 6750, 6562, 6375, 6187};\nint circleY[] = {6375, 6187, 6000, 6187, 6375, 6562, 6750, 6562};\n\nconst int threshold = 10;\n\nvoid loop() {\n  \/\/Etch-a-sketch Mode\n  while (redVal &amp;&amp; !greenVal) { \/\/Record Etch-a-sketch mode\n    index = 0;\n    while (redVal) {\n      laserOn = true;\n      readValues();\n      \/\/ MAP POT RANGE TO SERVO INPUT RANGE\n      xServoAngle = map(xPotValue, 1022, 0, xServoMin, xServoMax);\n      yServoAngle = map(yPotValue, 0, 1022, yServoMin, yServoMax);\n      writeValues();\n    }\n  }\n\n  \/\/Geometrical Shape Mode\n  while (!redVal &amp;&amp; greenVal) { \/\/Play geometrical shapes\n    xServoAngle = xServoMin;\n    yServoAngle = yServoMax;\n    while (greenVal) {\n      laserOn = true;\n      readValues();\n\n      if (redVal &amp;&amp; debounce) { \/\/Debounce button press\n        debounce = false;\n        shape++;\n        if (shape &gt;= 4) {\n          shape = 0;\n        }\n      } else if (!redVal &amp;&amp; !debounce) {\n        debounce = true;\n      }\n\n      if (shape == 0) {\n        scaleX = map(xPotValue, 1022, 0, -20, 20);\n        scaleY = map(yPotValue, 0, 1022, -20, 20);\n        if (xServoAngle &gt;= xServoMax) {\n          upX = false;\n        } else if (xServoAngle = yServoMax) {\n          upY = false;\n        } else if (yServoAngle &lt;= yServoMin) {\n          upY = true;\n        }\n        if (upX) {\n          xServoAngle = xServoAngle + 10 + scaleX;\n        }\n        if (!upX) {\n          xServoAngle = xServoAngle - 10 - scaleX;\n        }\n        if (upY) {\n          yServoAngle = yServoAngle + 10 + scaleY;\n        }\n        if (!upY) {\n          yServoAngle = yServoAngle - 10 - scaleY;\n        }\n        writeValues();\n      } else if (shape == 1) {\n        \/\/Line\n        for (int i = 0; i &lt; 3; i++) {\n          xServoAngle = lineX[i];\n          yServoAngle = lineY[i];\n          writeValues();\n        }\n      } else if (shape == 2) {\n        \/\/Triangle\n        for (int i = 0; i &lt; 4; i++) {\n          xServoAngle = triangleX[i];\n          yServoAngle = triangleY[i];\n          writeValues();\n        }\n      } else if (shape == 3) {\n        \/\/Square\n        for (int i = 0; i &lt; 5; i++) {\n          xServoAngle = squareX[i];\n          yServoAngle = squareY[i];\n          writeValues();\n        }\n      } else if (shape == 4) {\n        \/\/Circle\n        for (int i = 0; i &lt; 8; i++) {\n          xServoAngle = circleX[i];\n          yServoAngle = circleY[i];\n          writeValues();\n        }\n      }\n    }\n  }\n\n  laserOn = false;\n  readValues();\n  xServoAngle = 6375;\n  yServoAngle = 6375;\n  writeValues();\n}<\/pre>\n\n\n\n<p>I used the Pololu Mini Maestro library for controlling the servos:  <a href=\"https:\/\/github.com\/pololu\/maestro-arduino\">https:\/\/github.com\/pololu\/maestro-arduino<\/a> <\/p>\n\n\n\n<p>Special thanks to Zachary Berry for helping me with some coding issues that I faced.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A-term of 2019, I began my Light Art Practicum to complete my humanities requirement at WPI. I had to begin thinking about what I wanted my project to be. I knew I wanted to do something unique, something where I could incorporate different aspects of my learnings and hobbies. Being the mechanical engineering that I&#8230; <\/p>\n<div class=\"link-more\"><a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/aboggess\/final-documentation-laser-etch-a-sketch\/\">Read More<\/a><\/div>\n","protected":false},"author":133,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1065","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/posts\/1065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/users\/133"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/comments?post=1065"}],"version-history":[{"count":9,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/posts\/1065\/revisions"}],"predecessor-version":[{"id":1125,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/posts\/1065\/revisions\/1125"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/media?parent=1065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/categories?post=1065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a19\/wp-json\/wp\/v2\/tags?post=1065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}