RaveShirt First Update

Well that was quick! Right after posting about the project this morning, I came home and found that all the parts had arrived. After double checking the voltages and connections with my simulation (seen below) I wired up the circuit on a breadboard and I was almost ready to go!

I wrote a quick loop on the MBED to increment the value and wait. My plan is to check that all the LED light up and can be controlled before I proceed to writing anymore code. Here’s what I have so far

#include "mbed.h"

PwmOut RED(p26);
PwmOut BLUE(p25);
PwmOut GREEN(p24);

//Setting the PWM period on any of the 
//hardware pwm pins sets it for all of them

int main() {
    while(1) {
        for(int i =0; i < 100; i++){
            RED = i;
            BLUE = i;
            GREEN = i;
            wait(0.25);
        }
    }
}

I compiled and loaded this up on the mbed and hit reset expecting an array of pretty colors but alas, nothing happened. No smoke, no overheating components no missing connections, but no lights either. Since I don’t have any test gear on hand to trouble shoot I’ll be wiring it up in the lab in the morning to see what’s going on.

While I’m there I’ll probably figure out the resistance values for the LM317 and wire it up, but it’s not a big deal at the moment since the MBED is USB powered for debugging.

Stay tuned!

###BOM ### * 3 IRF9540 P-Channel MOSFETs (1.10 each) * 3 2N4124 (NPN BJT) * 3 10k Ohm resistors (pull ups for the P-Fets) * LM317T (voltage regulator) * Other stuff I had (breadboard, mbed, power adapter, DC barrel jack)

###Resources used### http://www.datasheetdir.com/VISHAY-IRF9540+Power-MOSFETs http://www.datasheetdir.com/2N4124-J18Z+NPN-Transistors https://mbed.org/handbook/PwmOut http://www.learningaboutelectronics.com/Articles/LM317-voltage-regulator http://arduino.cc/forum/index.php?topic=130384.0