{"id":16380,"date":"2022-10-27T01:25:18","date_gmt":"2022-10-27T05:25:18","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/?p=16380"},"modified":"2022-10-27T01:25:18","modified_gmt":"2022-10-27T05:25:18","slug":"light-signal-for-bike","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/light-signal-for-bike\/","title":{"rendered":"Light Signal For Bike"},"content":{"rendered":"<p>This device is designed to be placed on a bike, and signal to other vehicles with its lighting.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_16516\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16516\" loading=\"lazy\" class=\"wp-image-16516 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223109-1024x796.jpg\" alt=\"\" width=\"620\" height=\"482\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223109-1024x796.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223109-300x233.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223109-768x597.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223109-1536x1193.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223109-2048x1591.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223109-973x756.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223109-508x395.jpg 508w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16516\" class=\"wp-caption-text\">Overall Picture with Reference<\/p><\/div>\n<div id=\"attachment_16488\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16488\" loading=\"lazy\" class=\"wp-image-16488 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214055-1024x768.jpg\" alt=\"\" width=\"620\" height=\"465\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214055-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214055-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214055-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214055-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214055-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214055-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214055-508x381.jpg 508w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16488\" class=\"wp-caption-text\">Back View of the Device<\/p><\/div>\n<h2>Video of it Working:<\/h2>\n<div style=\"width: 590px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-16380-1\" width=\"590\" height=\"550\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat_20221026222431.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat_20221026222431.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat_20221026222431.mp4<\/a><\/video><\/div>\n<p>This video is taken in the dark to show its real-world effect as such a device is most crucial during nighttime.<\/p>\n<h2>Process &amp; Decisions:<\/h2>\n<p>The first major decision I made is to utilize multiple small pieces of LED strip and orientate them in a specific way to show a signal for left turn, right turn, and breaking. In my initial design, I have a circle as part of my stop signal. However, bending LED strips isn&#8217;t really a choice, and the only solution to that is to place the LEDs perpendicular to the surface of the device, which then makes them very hard to mount as those LED strips already have tapes applied on the back. The final decision on this is to remove the circular shape LED strip and have a rectangular-shaped stop sign instead, which still looks very good as shown in the video above.<\/p>\n<div id=\"attachment_16519\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16519\" loading=\"lazy\" class=\"wp-image-16519 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223343-1024x344.jpg\" alt=\"\" width=\"620\" height=\"208\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223343-1024x344.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223343-300x101.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223343-768x258.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223343-1536x516.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223343-2048x688.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223343-973x327.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026223343-508x171.jpg 508w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16519\" class=\"wp-caption-text\">Planned Layout In The Initial Design<\/p><\/div>\n<div id=\"attachment_16486\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16486\" loading=\"lazy\" class=\"wp-image-16486 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214042-1024x987.jpg\" alt=\"\" width=\"620\" height=\"598\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214042-1024x987.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214042-300x289.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214042-768x740.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214042-1536x1480.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214042-2048x1973.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214042-973x937.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214042-508x489.jpg 508w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16486\" class=\"wp-caption-text\">LED Strips Layout on the Device<\/p><\/div>\n<p>The second decision is about powering the whole system. LED strips take quite a bit of power, so I decided to use a battery pack with 4 rechargeable AA batteries to power both the Arduino, the LED strips, and all four switches. To organize all the power lines and prevent any possible shorts, I used a small circuit board to sort out all the wires. In addition, I added a small power switch that is embedded in the top wall of the case to control the power of the device.<\/p>\n<div id=\"attachment_16489\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16489\" loading=\"lazy\" class=\"wp-image-16489 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214101-1024x768.jpg\" alt=\"\" width=\"620\" height=\"465\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214101-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214101-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214101-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214101-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214101-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214101-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214101-508x381.jpg 508w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16489\" class=\"wp-caption-text\">An Overview of the Inside<\/p><\/div>\n<div id=\"attachment_16490\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16490\" loading=\"lazy\" class=\"wp-image-16490 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214106-898x1024.jpg\" alt=\"\" width=\"620\" height=\"707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214106-898x1024.jpg 898w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214106-263x300.jpg 263w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214106-768x876.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214106-973x1110.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214106-508x580.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214106.jpg 1313w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16490\" class=\"wp-caption-text\">Main Circuit Board<\/p><\/div>\n<p>Another decision I made are the inputs. The left turn and right turn inputs are non-toggled regular buttons, which I believe to be most convenient in actual usage as they are intended to be placed rider&#8217;s two thumbs on the handlebar. Needless to say, the night light switch is a toggled switch and the break switch is a hinge lever switch that will be placed between the break bar and the handlebar, so whenever the rider breaks, the lever switch gets pressed and actuates as well.<\/p>\n<div id=\"attachment_16487\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16487\" loading=\"lazy\" class=\"wp-image-16487 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214050-768x1024.jpg\" alt=\"\" width=\"620\" height=\"827\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214050-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214050-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214050-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214050-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214050-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214050-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/WeChat-Image_20221026214050-scaled.jpg 1920w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16487\" class=\"wp-caption-text\">Switches From Top to Bottom: Break, Night Light, Left Turn, Right Turn<\/p><\/div>\n<h2>Discussion<\/h2>\n<p>One major criticism of this device is the night light color. Conventionally, white lights are located at the front of a vehicle, so having a night light being white and placed at the rear of the bike may very likely confuse the person behind especially in the dark. However, since those LED strips are programmable in terms of their colors, I could easily change the color for a night light, which could be a potential solution. Another criticism is the case of the device. Being weatherproof is a crucial part of any device that is intended to be used outside, and this one is no exception. Yet the wooden case isn&#8217;t the best choice in terms of weatherproofing.<\/p>\n<p>Such an issue leads to my view of this project. I consider this device still at a development stage, as it is not ready to be brought outside and use in the real world. My original intention is to mount this device to the back of my bike, but that goal is still quite far as the mounting brackets are still to be made. Overall, I think I have achieved everything I want for this device to work in a lab, but further development is needed for it to be actually useful.<\/p>\n<p><span style=\"font-weight: 400\">Though I may not be all that satisfied with the device itself, what I was satisfied with are the things that I learned and experienced throughout this project. Things that I have never heard of like potting and experiences using the laser cutter for the wooden casing. I also learned from other people who utilized acrylic for their projects as that would be a better material for me to use instead of plywood as it is at least waterproof if sealed properly and allow for a clear view of the inside for presentations.<\/span><span style=\"font-weight: 400\"> After all, the biggest lesson that this project has given me is to think ahead to real-world applications and challenges when designing. <\/span><\/p>\n<p><span style=\"font-weight: 400\">It is on my schedule to make further improvements to this project, namely using the smaller Arduino micro or nano and going through the process of potting for a more secure and waterproof case. As for the buttons, I will look into some waterproofed switches and buttons and ways to mount them onto a bike.<\/span><\/p>\n<h2>Technical Information<\/h2>\n<div id=\"attachment_16625\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16625\" loading=\"lazy\" class=\"wp-image-16625 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Untitled-Diagram.drawio.svg\" alt=\"\" width=\"620\" height=\"620\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/\/2022\/10\/Untitled-Diagram.drawio.svg 150w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/\/2022\/10\/Untitled-Diagram.drawio.svg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/\/2022\/10\/Untitled-Diagram.drawio.svg 1024w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16625\" class=\"wp-caption-text\">Functional Block Diagram<\/p><\/div>\n<div id=\"attachment_16624\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16624\" loading=\"lazy\" class=\"wp-image-16624 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Untitled-Diagram.drawio-1.svg\" alt=\"\" width=\"620\" height=\"620\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/\/2022\/10\/Untitled-Diagram.drawio-1.svg 150w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/\/2022\/10\/Untitled-Diagram.drawio-1.svg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/\/2022\/10\/Untitled-Diagram.drawio-1.svg 1024w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16624\" class=\"wp-caption-text\">Electrical Schematic<\/p><\/div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/* Light Signal For Bike\r\n\r\n    The following code is intended to lights up a set of LED strips according to the 4 inputs.\r\n    When Left Turn is on, Upper Left, Lower Left, and Middle LED Strip turn \"on\", which is red\r\n    When Right Turn is on, Upper Right, Lower Right, and Middle LED Strip turn \"on\", which is red\r\n    When Break is on, All 5 LED strips turn \"on\", which is red\r\n    When Night Light is on, All 5 LED strips turn \"night\", which is white\r\n    Night Light has the lowest priority while other three action has equal priority.\r\n    Pin Mapping:\r\n    Arduino Pin  \/  Role \/ Description\r\n      2            Output   Upper Left LED Strip\r\n      3            Output   Middle LED Strip\r\n      4            Output   Upper Right LED Strip\r\n      5            Output   Lower Right LED Strip\r\n      6            Output   Lower Left LED Strip\r\n      7            Input    Left Turn Signal\r\n      8            Input    Right Turn Signal\r\n      9            Input    Break Signal\r\n      10           Input    Night Light Signal\r\n\r\n      Ethan Hu, 2022\r\n*\/\r\n\r\n#include &lt;PololuLedStrip.h&gt;\r\n\/\/ setup PololuLedStrip and set each strip to a pin number\r\nPololuLedStrip&lt;2&gt; ledStripLU;\r\nPololuLedStrip&lt;6&gt; ledStripLD;\r\nPololuLedStrip&lt;4&gt; ledStripRU;\r\nPololuLedStrip&lt;5&gt; ledStripRD;\r\nPololuLedStrip&lt;3&gt; ledStripM;\r\n\/\/ defind the number of LED on each strip, the maximum LED count used in this project is 6\r\n#define LED_COUNT 6\r\n\/\/ define the input pin number for the four switches\r\n#define Left_Input 7\r\n#define Right_Input 8\r\n#define Nightlight_Input 10\r\n#define Break_Input 9\r\n\/\/ create lists of colors for the LED strips to show under different circumstances\r\nrgb_color on[LED_COUNT];\r\nrgb_color off[LED_COUNT];\r\nrgb_color night[LED_COUNT];\r\n\r\nvoid setup() {\r\n  pinMode(Left_Input, INPUT);\r\n  pinMode(Right_Input, INPUT);\r\n  pinMode(Nightlight_Input, INPUT);\r\n  pinMode(Break_Input, INPUT);\r\n  \/\/ set up the list of color\r\n  for (int i = 0; i &lt; LED_COUNT; i++) {\r\n    \/\/ on is red\r\n    on[i] = rgb_color(255, 0, 0);\r\n  }\r\n  for (int i = 0; i &lt; LED_COUNT; i++) {\r\n    \/\/ off is clear\/nothing\r\n    off[i] = rgb_color(0, 0, 0);\r\n  }\r\n  for (int i = 0; i &lt; LED_COUNT; i++) {\r\n    \/\/ night is white\r\n    night[i] = rgb_color(255, 255, 255);\r\n  }\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ if left turn\r\n  if (digitalRead(Left_Input) == HIGH) {\r\n    ledStripLU.write(on, LED_COUNT);\r\n    ledStripLD.write(on, LED_COUNT);\r\n    ledStripRU.write(off, LED_COUNT);\r\n    ledStripRD.write(off, LED_COUNT);\r\n    ledStripM.write(on, LED_COUNT);\r\n  }\r\n  \/\/ if right turn\r\n  else if (digitalRead(Right_Input) == HIGH) {\r\n    ledStripRU.write(on, LED_COUNT);\r\n    ledStripRD.write(on, LED_COUNT);\r\n    ledStripLU.write(off, LED_COUNT);\r\n    ledStripLD.write(off, LED_COUNT);\r\n    ledStripM.write(on, LED_COUNT);\r\n  }\r\n  \/\/ if break\r\n  else if (digitalRead(Break_Input) == LOW) {\r\n    ledStripRU.write(on, LED_COUNT);\r\n    ledStripRD.write(on, LED_COUNT);\r\n    ledStripLU.write(on, LED_COUNT);\r\n    ledStripLD.write(on, LED_COUNT);\r\n    ledStripM.write(on, LED_COUNT);\r\n  }\r\n  \/\/ the second else is used to check whether if night light is toggled\r\n  else {\r\n    \/\/ if night light is toggled on\r\n    if (digitalRead(Nightlight_Input) == HIGH) {\r\n      ledStripRU.write(night, LED_COUNT);\r\n      ledStripRD.write(night, LED_COUNT);\r\n      ledStripLU.write(night, LED_COUNT);\r\n      ledStripLD.write(night, LED_COUNT);\r\n      ledStripM.write(night, LED_COUNT);\r\n    }\r\n    \/\/ all the LED will turn off if no signal is sent to it and night light is not toggled on\r\n    else {\r\n      ledStripRU.write(off, LED_COUNT);\r\n      ledStripRD.write(off, LED_COUNT);\r\n      ledStripLU.write(off, LED_COUNT);\r\n      ledStripLD.write(off, LED_COUNT);\r\n      ledStripM.write(off, LED_COUNT);\r\n    }\r\n  }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This device is designed to be placed on a bike, and signal to other vehicles with its lighting. &nbsp; Video of it Working: This video is taken in&#8230;<\/p>\n","protected":false},"author":228,"featured_media":16484,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[89],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16380"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/users\/228"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/comments?post=16380"}],"version-history":[{"count":10,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16380\/revisions"}],"predecessor-version":[{"id":16631,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16380\/revisions\/16631"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media\/16484"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media?parent=16380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/categories?post=16380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/tags?post=16380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}