{"id":992,"date":"2011-02-13T19:06:16","date_gmt":"2011-02-13T23:06:16","guid":{"rendered":"http:\/\/www.braindeadprojects.com\/blog\/?p=992"},"modified":"2011-02-14T11:01:17","modified_gmt":"2011-02-14T15:01:17","slug":"every-police-car-needs-flashing-lights","status":"publish","type":"post","link":"http:\/\/www.braindeadprojects.com\/blog\/what\/every-police-car-needs-flashing-lights\/","title":{"rendered":"Every Police Car needs flashing lights"},"content":{"rendered":"<p>This weekend didn&#8217;t afford me enough time for personal projects, but I did have a few moments to solder connections onto the LED system on the RC police car I&#8217;ve been modifying. (I also drilled out the rear window).<\/p>\n<p>Controlling the LEDs is simple: they\u00a0 all share a positive terminal, bring a cathode to ground and you have light. Controlling the lights via an MSP430 is simple &#8211; set the connected pin to be an output, and set the pin low. The LED board has built in resistors, so there&#8217;s no need to add them.<\/p>\n<p>There are 8 LEDs, 4 of which are independently controlled:<\/p>\n<ol>\n<li>The two (2) Headlights and two (2) Brake lights<\/li>\n<li>The Blue lightbar<\/li>\n<li>The White lightbar on the left<\/li>\n<li>The White lightbar on the right<\/li>\n<li>The Red lightbar<\/li>\n<\/ol>\n<p>With the soldering of connectors finished, I hooked them up to the Launchpad and made a quick modification to the <a href=\"http:\/\/hackaday.com\" target=\"_blank\">Hackaday.com<\/a> <a href=\"https:\/\/github.com\/Hack-a-Day\/had_launchpad-blink\/raw\/master\/main.c\" target=\"_blank\">Hello World program<\/a> &#8211;\u00a0 this time\u00a0 setting 5 pins as outputs, and turning on all the lights except the blue and white lightbar on the left. I toggle the entire lightbar approximately every ~6th of a second.<\/p>\n<p><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"480\" height=\"390\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"allowFullScreen\" value=\"true\" \/><param name=\"allowscriptaccess\" value=\"always\" \/><param name=\"src\" value=\"http:\/\/www.youtube.com\/v\/4YogCbaXs2g?fs=1&amp;hl=en_US\" \/><param name=\"allowfullscreen\" value=\"true\" \/><embed type=\"application\/x-shockwave-flash\" width=\"480\" height=\"390\" src=\"http:\/\/www.youtube.com\/v\/4YogCbaXs2g?fs=1&amp;hl=en_US\" allowscriptaccess=\"always\" allowfullscreen=\"true\"><\/embed><\/object><\/p>\n<p>The specific pins to control each light will definitely change in the future, but seeing blinky lights in the meantime is always fun. I&#8217;m happy with my choice of this particular RC car &#8211; having 8 LEDs makes it real easy to display status codes and will definitely help with debugging later.<\/p>\n<p>Next up: connect a <a href=\"http:\/\/www.parallax.com\/tabid\/768\/ProductID\/92\/Default.aspx\" target=\"_blank\">PING<\/a> sensor to\u00a0 a small servo to the roof &#8230; once my box of servos arrive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This weekend didn&#8217;t afford me enough time for personal projects, but I did have a few moments to solder connections onto the LED system on the RC police car I&#8217;ve been modifying. (I also drilled out the rear window). Controlling the LEDs is simple: they\u00a0 all share a positive terminal, bring a cathode to ground &hellip; <a href=\"http:\/\/www.braindeadprojects.com\/blog\/what\/every-police-car-needs-flashing-lights\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Every Police Car needs flashing lights<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,22,1],"tags":[],"class_list":["post-992","post","type-post","status-publish","format-standard","hentry","category-electronics","category-ti-launchpad","category-what"],"_links":{"self":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/992"}],"collection":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/comments?post=992"}],"version-history":[{"count":11,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/992\/revisions"}],"predecessor-version":[{"id":1003,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/992\/revisions\/1003"}],"wp:attachment":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/media?parent=992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/categories?post=992"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/tags?post=992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}