November 23, 2024, 05:52:56 AM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Hooking it up- what am I missing here?

Started by Specter, May 19, 2009, 12:49:34 PM

Previous topic - Next topic

Specter

May 19, 2009, 12:49:34 PM Last Edit: May 19, 2009, 12:56:00 PM by Specter
I have a prop-1 to run some LEDs, I am using the code posted below (Thanks Jon!)

When I run the code with the trainer, it runs perfectly. I then take the trainer off, put the 'chip' back on the prop-1 board.
Question- does that chip have to face a specific direction?

I'm using the 12v plugin from efx-tek.

I then wire up my LEDs to the board. I have a 1k resistor hooked up to the V+ port. All my + wires from my LEDs hook up to that resistor. The - wires all go to ports OUT0 to OUT5. I then flip the switch to '1', nothing happens. I flip the switch to '2', and the V+ LED on the board lights solid- my LEDs light up solid (but are dim), but they don't fade or run the program. I hit the reset button- nothing.

I tried it the other way around- put the resistor on the GND port, all the - wires to the LEDs on that resistor, and the + wires on the LEDs to the OUT0- OUT5 ports. Nothing happens at all when I turn it to 1 or 2.

What am I doing wrong here?  Again, the code works great with the trainer, I don't believe it's a code issue. I must be hooking it up wrong?
Thanks!




' =========================================================================
'
' File...... Firefly2.BS1
' Purpose...
' Author.... Jon Williams, EFX-TEK
' E-mail.... jwilliams@efx-tek.com
' Started...
' Updated...
'
' {$STAMP BS1}
' {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


' -----[ Variables ]-------------------------------------------------------

SYMBOL idx = B2 ' loop controller
SYMBOL theBug = B3 ' pin to light
SYMBOL last = B4 ' last pin lit
SYMBOL stpSize = B5 ' to control PWM speed
SYMBOL level = B6 ' brightness level
SYMBOL delay = W4
SYMBOL lottery = W5 ' random value


' -----[ Program Code ]----------------------------------------------------

Main:
FOR idx = 1 TO 3
RANDOM lottery ' stir random number
NEXT

theBug = lottery // 6 ' select pin, 0 to 5
IF theBug = last THEN Main ' don't repeat
last = theBug ' save for next cycle

Bug_On:
RANDOM lottery
stpSize = lottery // 20 + 1 ' randomize loop speed
FOR level = 0 TO 255 STEP stpSize ' brighten
PWM theBug, level, 1
NEXT
HIGH theBug

On_Time:
RANDOM lottery
delay = lottery // 100 + 25 ' 150 to 300 ms
PAUSE delay

Bug_Off:
RANDOM lottery
stpSize = lottery // stpSize + 1 ' off no slower than on
FOR level = 255 TO 0 STEP -stpSize
PWM theBug, level, 1
NEXT
LOW theBug

Off_Time:
RANDOM lottery
delay = lottery // 250 + 500
PAUSE delay
GOTO Main

' -------------------------------------------------------------------------

livinlowe

May 19, 2009, 02:46:29 PM #1 Last Edit: May 19, 2009, 02:57:52 PM by livinlowe
Yes, the uln goes in a certain way.

There should be an indentation on one end of the chip. This goes towards the top of the prop-1.

Shawn
Scaring someone with a prop you built -- priceless!

EricTheMannn

You're ULN should look like the picture below



the arc on one side determines the placement of the ULN for further information look at this thread http://www.efx-tek.com/php/smf/index.php?topic=130.0 It go's into more detail.

You're wiring sounds fine all led + to V+ with a 1k resistor and each ground or the LED's to go to there designated OUTX spots.

-Eric
WooHoo

Specter

Yep! That did it! Thanks for the help guys!