Go Down

Topic: Potentiometer Controlling LED Graph and Servo (Read 2515 times) previous topic - next topic

Jeremy1998

now the only thing i need is transistors... can you guys recommend some dip packages of transistors... i would like anywhere between 5 and 10 transistors per package...

BenF

Have a look at your code again Richard. It will not compile as is, you do not declare your variables, nor do you hint on what they ought to be.

Then there is this part:

Code: [Select]
if (55 - (val / 5)) = pinnbr {
   outval = HIGH;
}


It looks as if you assign the value of "pinnbr" to an expression? This is not valid C-syntax. There may be some good intention here, but it's certainly hard to spot.

For a guy who is 11 years old, I'm pretty impressed by his skills and ability to stay focused through some "challenging" advice.

Jeremy1998

#32
Jun 15, 2010, 07:41 pm Last Edit: Jun 15, 2010, 07:46 pm by Jeremy1998 Reason: 1
Is the "protocal" the same for these? As in do I still use a 1k ohm resistor between the base and arduino?

I still haven't decided on one yet, but i want them with all normal npn transistors. I am still reading the datasheets.

AWOL

Quote
i compiled it, and it worked, but i cant test it...


Compiled != worked.

You have much to learn, my young padawan.    ;)

(Keep it up!)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

BenF

Quote
... and sometimes forget which ones use == vs. = for comparison.

If you fix that, there is still an issue with parentheses. As written, the conditional expression in your code is "(55 - (val / 5)). In "C" you need to enclose the full conditional expression in parentheses.

Jeremy1998

So I think I will get the ULN2004A's. If I am correct, the left pins (pins 1-7) are the base, the right pins (pins 10 - 16) are the collectors, and pin 9 is the common emitter? Please tell me if I am right.  

Jeremy1998

#36
Jun 16, 2010, 12:21 am Last Edit: Jun 16, 2010, 12:25 am by Jeremy1998 Reason: 1
Ok, so I found these:

http://www.st.com/stonline/books/pdf/docs/1536.pdf

They are cheap, and they look like they should work. From what I understand, the ULN2801A is for use with external ressitors, and the ULN2803A is for use with 5 volt signals? Please correct me if I am wrong.

Also, what would I hook the common load connection to? Would it be 5 volts because that's what I am driving my led's with?

Jeremy1998

#37
Jun 16, 2010, 04:09 am Last Edit: Jun 16, 2010, 04:25 am by Jeremy1998 Reason: 1
Yay! I am finally understanding! LOL!

It's a website called Newark, I'm sure you have heard of it?

And as far as FINDING then, i just Google searched "transistor array" and went into images. Then i found a schematic that I liked, and looked up the corresponding IC in google shopping. http://computerchristmas.com/tmp/myimages/7-2803.jpg

Jeremy1998

i searched it in gogle shopping, and thay actually ahve it cheapest... but i know what you mean... i wanted some crystal oacillators, and they had em super cheap! the catch was that they were going to charge me a $25 fee just to get them off of the stupid shelf! i said forget that!

Jeremy1998

Alright, so I finished the Fritzing design... It took me 2 dsya and a total of over 12 hours!

Can someone tell me how i pulpad the JPG image? I am prety sure that I have to upload it to photobucket or flickr or some other photo server?

Go Up