SparkFun Electronics Commentsurn:uuid:214d0e4e-f1b1-d287-ce26-ac5b4c9f82492024-03-29T09:13:38-06:00SparkFun Electronicstcabeen on According to Pete, Special Halloween Editiontcabeenurn:uuid:ec4d304a-7ae3-41ee-7ac8-f8a4bf6ac2512011-11-11T11:38:08-07:00<p>LOVE the Top Rope magnet. :D</p>
MatthewR on According to Pete, Special Halloween EditionMatthewRurn:uuid:ceb20d11-f178-c837-4ab9-ed4d898178682011-11-09T08:48:13-07:00<p>Did I miss it? I was looking forward to it.</p>
urjaman on According to Pete, Special Halloween Editionurjamanurn:uuid:a18579dd-a689-b00d-6c90-a2f1c60533a32011-11-06T08:46:36-07:00<p>Variable d counts 0 - 49 (on >=50 it gets reset and pulse is modified). When d is less than (or equal to) pulse, blue leds are on, when d is more than pulse, blue leds are off. I must be blind to not have noticed that the last time I wrote something here above.... (facepalm)</p>
Customer #229744 on According to Pete, Special Halloween EditionCustomer #229744urn:uuid:a92b5544-a3c9-c3d7-966a-c8c6b954560d2011-11-04T12:55:00-06:00<p>I still don't get how setting the variable pulse affects anything. What is the secret sauce there?</p>
Calif on According to Pete, Special Halloween EditionCalifurn:uuid:ded57373-5357-fa9f-a88f-74e7f16fcc422011-11-03T20:27:42-06:00<p>Should have skipped the resistors & PWMed everything.</p>
Calif on According to Pete, Special Halloween EditionCalifurn:uuid:754ce7bd-ba84-6640-914a-18fd5f9acf4b2011-11-03T20:27:22-06:00<p>Should have skipped the resistors & PWMed everything.</p>
Pete-O on According to Pete, Special Halloween EditionPete-Ourn:uuid:3c7affc7-24a0-f62b-f6de-6b621e0cc50e2011-11-02T08:02:28-06:00<p>What he said. Like I said before, compiled in Arduino and not optimized for anything. NOT ANYTHING! There are a zillion different ways I could have pulled this off. This was the quickest for me.</p>
Demolishun on According to Pete, Special Halloween EditionDemolishunurn:uuid:69e45a19-b27d-37dd-38a7-908ec88450bd2011-11-01T19:46:47-06:00<p>Couldn't you do the same thing with a 556 (dual 555) and a 4017 (cmos counter)?<br>
One 555 could handle the blue flashing. The other could be turned on by the trigger and warble the sound. The counter would divide down the pulses to flash the shooting leds.<br>
Maybe not as simple or configurable as using a small controller though. This looks like a fun project and it would be great to do in a 8 pin micro as well.</p>
robot256 on According to Pete, Special Halloween Editionrobot256urn:uuid:cf04bda4-a0a0-f7b6-a7e2-9852bdf743c72011-11-01T15:00:29-06:00<p>The PWMs are all bit-banged off the instruction clock in for/while loops. See the line "if d <= pulse" right after the "while trigger" loop. Looks a lot like some my own one-hour-project hack code, don't expect everything to be properly thought out. Pretty neat project even so.</p>
urjaman on According to Pete, Special Halloween Editionurjamanurn:uuid:a4b7b52b-fd87-35f1-87f8-18ba1c62863a2011-11-01T12:22:15-06:00<p>Propably not. As far as I can see he is not showing us the whole code. Maybe he rigged the timer (that is doing the PWM) overflow interrupt to push the pulse value (it is a global variable, why would it need to be global otherwise?) into the PWM register.<br>
Also, why is it an int (16-bits signed in most AVR compilers AFAIK)?<br>
uint8_t would be enough.<br>
What compiler is used? Doesnt look like code I'd write for avr-gcc.<br>
analogRead()/digitalWrite() is nowhere to be seen, nothing is included, etc.<br>
Also, using the ADC to read the trigger seems a bit excessive...</p>
IllogicGate on According to Pete, Special Halloween EditionIllogicGateurn:uuid:f645ea62-671a-9bf1-9d3c-cbf278bcafed2011-11-01T11:11:36-06:00<p>Cool. Perhaps a "zap" button for our own comments in the future if we asked a redundant question?<br>
reply | report | edit | zap<br>
lol.</p>
Customer #229744 on According to Pete, Special Halloween EditionCustomer #229744urn:uuid:7e628de0-de3c-69e9-fbac-e5df62c34f432011-11-01T10:29:35-06:00<p>I see where are setting pulse, but I don't see how you are using it's value to affect the LEDs. Is pulse a keyword that means something to the compiler?</p>
Pete-O on According to Pete, Special Halloween EditionPete-Ourn:uuid:5bc0362b-d854-f158-4294-c8fd0d1f03f42011-11-01T08:41:47-06:00<p>Oh... I 'spose.</p>
EvilGenius121 on According to Pete, Special Halloween EditionEvilGenius121urn:uuid:da6904d5-bfd3-a87f-9945-33f2fab3bba62011-11-01T08:15:30-06:00<p>Like hooking up an rc car to 5x its rated voltage? (it went fast) :)</p>
EvilGenius121 on According to Pete, Special Halloween EditionEvilGenius121urn:uuid:531caab8-83c6-e863-c720-9189d70a94942011-11-01T08:14:52-06:00<p>ah the pesky initialization procedure ;)</p>
brennen on According to Pete, Special Halloween Editionbrennenurn:uuid:867f6929-fc7b-50dc-b825-d8e44fe668d32011-11-01T00:25:44-06:00<p>I zapped it.</p>
sgrace on According to Pete, Special Halloween Editionsgraceurn:uuid:3a2f34b0-4e75-41b7-3283-7bcbbdbdb6932011-10-31T20:19:31-06:00<p>Not allowed, it's been trademarked by the University of Wyoming.</p>
AngusP on According to Pete, Special Halloween EditionAngusPurn:uuid:49cebcf7-ca13-7ea2-ae7f-80b9c81069752011-10-31T17:38:25-06:00<p>Huh? where did duplicate go??</p>
homebray on According to Pete, Special Halloween Editionhomebrayurn:uuid:43cc89b1-f49f-5f22-223c-70b3ec63d6752011-10-31T16:59:57-06:00<p>or use the internal pullup and pull the pin low on the trigger and save a part. $0.01 off the BOM! LOL.</p>
Yvan256 on According to Pete, Special Halloween EditionYvan256urn:uuid:248479ed-134f-a08b-e9e6-59ca1e24a8212011-10-31T16:56:54-06:00<p>"I knew of course when I pull the trigger I want everything to go nuts."<br>
Oh, Pete. You and your technical mumbo-jumbo.</p>
Joerice01 on According to Pete, Special Halloween EditionJoerice01urn:uuid:0767cbd9-5b80-de63-9236-f2f31d16c9f42011-10-31T16:09:45-06:00<p>Hey Pete, Any where I can download all of the epp's. Or podcasts or something?<br>
I LOVE THEM</p>
Ekisu on According to Pete, Special Halloween EditionEkisuurn:uuid:fb870e19-37f0-4b5a-e966-818fe4a7b7802011-10-31T14:42:12-06:00<p>So will there still be an According to Pete in November?</p>
Ekisu on According to Pete, Special Halloween EditionEkisuurn:uuid:ceb3bd6c-4b7f-189f-6928-6c09e80e372c2011-10-31T14:35:37-06:00<p>The arduino has a tone command built into the standard library that might have been easier to use.<br>
http://arduino.cc/en/Reference/Tone</p>
TECH GEEK on According to Pete, Special Halloween EditionTECH GEEKurn:uuid:80c56278-d09a-dc94-76e2-f225cdcbab782011-10-31T14:34:27-06:00<p>They should call you Pistol Pete!!!</p>
Single T on According to Pete, Special Halloween EditionSingle Turn:uuid:3dbcbfce-504e-5009-b9b0-0e558181ff5b2011-10-31T14:01:17-06:00<p>I love the lens you shot this in Greg. Gotta love super short focal length, with super wide angle.</p>
ben___ on According to Pete, Special Halloween Editionben___urn:uuid:f1a53887-cada-9fb9-acd9-19697015b25f2011-10-31T13:43:09-06:00<p>like an oops-<em>i</em>-forgot-to-initialize-a-value bug, fix will be pushed shortly.</p>
IllogicGate on According to Pete, Special Halloween EditionIllogicGateurn:uuid:084e93be-c66b-58f8-0285-4442e03a3ab82011-10-31T13:14:01-06:00<p>Nice hack.<br>
Oh, and could you do something on multiplexing for LED matrixes please? That would help so many people who want to make microcontroller Snake games...</p>
IllogicGate on According to Pete, Special Halloween EditionIllogicGateurn:uuid:25587980-5504-1239-9541-dc052f0283342011-10-31T13:11:21-06:00<p>Like an unsigned int or something? It's-nice-that-you-fixed-the-going-off-the-page-bug-though-I-wonder-what-caused-it-in-the-first-place...</p>
TopHat on According to Pete, Special Halloween EditionTopHaturn:uuid:60e20e9f-a0b0-cedd-7e85-8d5209cd57a42011-10-31T13:01:13-06:00<p>Thanks pete. I enjoy the vids, this is usually the same process I follow to hack stuff apart.. where were you when I was 15 and a budding hacker?</p>
cSu7xFSE on According to Pete, Special Halloween EditioncSu7xFSEurn:uuid:18b2f783-adc6-7691-b9d9-1c729b154a612011-10-31T12:34:31-06:00<p>You should try delayMicroseconds(uS);</p>
brennen on According to Pete, Special Halloween Editionbrennenurn:uuid:87448d8c-4a0b-3fc2-5bb5-501db877d8372011-10-31T12:19:23-06:00<p>You may have discerned a wee bit of a sort-order bug.</p>
IllogicGate on According to Pete, Special Halloween EditionIllogicGateurn:uuid:d9bc3df6-5f07-468a-6c70-475c2d0c4b392011-10-31T11:58:49-06:00<p>Wait, why is this at the top? It's 0'd!</p>
Pete-O on According to Pete, Special Halloween EditionPete-Ourn:uuid:38019ae2-8e81-810f-6c15-a00854a8f47d2011-10-31T11:54:28-06:00<p>The schematic is right, but my thinking may have been wrong. I don't like to tie stuff to VCC directly, so I'd do it through a resistor. But in retrospect, it should prolly have something pulling it down when you're not on the trigger. In practice, it hasn't been a problem, but there you are.</p>
IllogicGate on According to Pete, Special Halloween EditionIllogicGateurn:uuid:39a02a13-9044-7d3c-4f50-ff20b39fd3cf2011-10-31T11:46:38-06:00<p>AAAAaaaahh!! !@#$^%<em>I$%^&^#$^^</em>^&(^<em>$^#</em>&(***)^()^!@#! You shot a hole in my comment!!!</p>
noworries on According to Pete, Special Halloween Editionnoworriesurn:uuid:c7aeb1f4-24d8-16d9-18c1-967a9b276e3e2011-10-31T11:34:49-06:00<p>Pete: I think you made a small mistake in your schematic. Didn't you want to have the resistor on the A3 input connected as a pulldown resistor to ground instead of being in series with the microcontroller input?</p>
Pete-O on According to Pete, Special Halloween EditionPete-Ourn:uuid:7bd6e03d-1006-b1c4-f06d-c2ea7c2a55592011-10-31T11:33:50-06:00<p>OK, I lied. It is essentially written in Arduino. I tend to shy away from that descriptor since I'm not the most Arduino library savvy guy. But you look at that code... and yeah, that's more-or-less Arduino.<br>
Also, the SKU for the trigger switch is COM-00098 (http://www.sparkfun.com/products/98).</p>
nagmier on According to Pete, Special Halloween Editionnagmierurn:uuid:2a070b00-e14f-ea2a-4557-a596e00d8dbc2011-10-31T11:14:31-06:00<p>Great Halloween Hack! That's classic!!! One of my favorite things is juicing up cheap toys. There is nothing like a journey to the dollar store to get those creative ideas flowing! Great vid Pete!</p>