Go Down

Topic: Hook up diagram for components (Read 917 times) previous topic - next topic

Hi,
I'm new here and also a bit of an electronics and arduino novice.
I'm hoping someone can help me by working out the connections between the various components for the following circuit.
http://www.youtube.com/watch?v=w-P-2LdS6zk

The circuit is perfect for what I need, and I've been kindly given the code for the project, but I'm not sure how to wire up the various components.

If anyone can help me I would be very grateful.

Thank you in advance.

Jamie

AWOL

#1
Sep 08, 2012, 05:40 pm Last Edit: Sep 08, 2012, 06:02 pm by AWOL Reason: 1
Quote
The circuit is perfect for what I need, and I've been kindly given the code for the project,  

Have you posted either?
They're interrelated, so difficult to provide the one without seeing the other.
I'm guessing charlieplexing.
"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.

Hi AWOL,
I'm pretty sure the circuit uses charlieplexing, I don't have the circuit diagram that's the problem. I need helping sort of reverse engineering the diagram back from the video clip posted.
If someone can help I could PM them the code, which would probably be the easiest way for someone to solve this.

Thanks

AWOL

You're aware that there's a charlieplexing library available?
Have a look around the Playground.
"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.

kd7eir

You will have a 100% higher chance of getting help with this if you start by posting the code HERE IN THE FORUM.  No one in this forum is interested in helping you with some top-secret code.  We are not for-hire electrical engineers where you post a video of a product, and ask us to reverse engineer it for you.  By looking at the code we can see what the Arduino is doing to produce the result shown in the video.

It's your choice, but without the code, you will get only general references to go read a library and figure out how to make it work on your own.

Lakes

Let me Google that for you... ;)

http://www.instructables.com/id/CharliePlexed-LED-string-for-the-Arduino/?ALLSTEPS

I would suggest that as a novice, you start with the "standard" arduino and drive the LED`s (with series resistors) directly, rather than jumping in at the deep end with an AtTiny and CharlilePlexing.

http://startingelectronics.com/beginners/start-electronics-now/tut4-arduino-knight-rider/

You can add a speed control, once you get the basic circuit working.

Thanks Lakes for the links.
I didn't mean to be deliberately cryptic or awkward by not initially posting the code.
Here's the code as it was given to me.
If someone could help me out with a wiring diagram for the components based on this code that would be great.

---------------------------------------------------------------------------
int ledPORT1 = 1;
int ledPORT2 = 2;
int ledPORT3 = 0;
int ledPORT4 = 4;

int analogPin = 3;
int val = 0;

void setup()
{
}

void loop()
{
pinMode(ledPORT1, OUTPUT);
pinMode(ledPORT2, OUTPUT);
pinMode(ledPORT3, INPUT);
pinMode(ledPORT4, INPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT2, HIGH);
delay(val);
digitalWrite(ledPORT2, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT1, HIGH);
delay(val);
digitalWrite(ledPORT1, LOW);

pinMode(ledPORT1, OUTPUT);
pinMode(ledPORT2, INPUT);
pinMode(ledPORT3, INPUT);
pinMode(ledPORT4, OUTPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT4, HIGH);
delay(val);
digitalWrite(ledPORT4, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT1, HIGH);
delay(val);
digitalWrite(ledPORT1, LOW);

pinMode(ledPORT1, OUTPUT);
pinMode(ledPORT2, INPUT);
pinMode(ledPORT3, OUTPUT);
pinMode(ledPORT4, INPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT3, HIGH);
delay(val);
digitalWrite(ledPORT3, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT1, HIGH);
delay(val);
digitalWrite(ledPORT1, LOW);

//die ersten 6 LED's

pinMode(ledPORT1, INPUT);
pinMode(ledPORT2, OUTPUT);
pinMode(ledPORT3, OUTPUT);
pinMode(ledPORT4, INPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT3, HIGH);
delay(val);
digitalWrite(ledPORT3, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT2, HIGH);
delay(val);
digitalWrite(ledPORT2, LOW);

pinMode(ledPORT1, INPUT);
pinMode(ledPORT2, OUTPUT);
pinMode(ledPORT3, INPUT);
pinMode(ledPORT4, OUTPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT4, HIGH);
delay(val);
digitalWrite(ledPORT4, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT2, HIGH);
delay(val);
digitalWrite(ledPORT2, LOW);

//jetzt die gefolgten 4 LED's

pinMode(ledPORT1, INPUT);
pinMode(ledPORT2, INPUT);
pinMode(ledPORT3, OUTPUT);
pinMode(ledPORT4, OUTPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT4, HIGH);
delay(val);
digitalWrite(ledPORT4, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT3, HIGH);
delay(val);
digitalWrite(ledPORT3, LOW);

// und zurück

pinMode(ledPORT1, INPUT);
pinMode(ledPORT2, INPUT);
pinMode(ledPORT3, OUTPUT);
pinMode(ledPORT4, OUTPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT4, HIGH);
delay(val);
digitalWrite(ledPORT4, LOW);

// das waren die ersten 2 zurück

pinMode(ledPORT1, INPUT);
pinMode(ledPORT2, OUTPUT);
pinMode(ledPORT3, INPUT);
pinMode(ledPORT4, OUTPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT2, HIGH);
delay(val);
digitalWrite(ledPORT2, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT4, HIGH);
delay(val);
digitalWrite(ledPORT4, LOW);

pinMode(ledPORT1, INPUT);
pinMode(ledPORT2, OUTPUT);
pinMode(ledPORT3, OUTPUT);
pinMode(ledPORT4, INPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT2, HIGH);
delay(val);
digitalWrite(ledPORT2, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT3, HIGH);
delay(val);
digitalWrite(ledPORT3, LOW);

// das waren die nächsten 2 zurück

pinMode(ledPORT1, OUTPUT);
pinMode(ledPORT2, INPUT);
pinMode(ledPORT3, OUTPUT);
pinMode(ledPORT4, INPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT1, HIGH);
delay(val);
digitalWrite(ledPORT1, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT3, HIGH);
delay(val);
digitalWrite(ledPORT3, LOW);

pinMode(ledPORT1, OUTPUT);
pinMode(ledPORT2, INPUT);
pinMode(ledPORT3, INPUT);
pinMode(ledPORT4, OUTPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT1, HIGH);
delay(val);
digitalWrite(ledPORT1, LOW);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT4, HIGH);
delay(val);
digitalWrite(ledPORT4, LOW);

pinMode(ledPORT1, OUTPUT);
pinMode(ledPORT2, OUTPUT);
pinMode(ledPORT3, INPUT);
pinMode(ledPORT4, INPUT);

val = analogRead(analogPin);
val /=4;
digitalWrite(ledPORT1, HIGH);
delay(val);
digitalWrite(ledPORT1, LOW);
}
---------------------------------------------------------------------------


Thanks again.

Jamie

Lakes

The instructable shows you  how to wire the LED`s.

Have you used an AtTiny before?, do you know how to program it?
http://www.youtube.com/watch?v=30rPt802n1k
http://hlt.media.mit.edu/?p=1695

http://www.instructables.com/id/8-LED-Larson-Scanner-with-Arduino/
http://www.instructables.com/id/The-KITT-duino-DIY-Larson-Scanner-with-an-Arduino/

All the information is out there, do some research, buy a breadboard, experiment! :)

AWOL

Quote
do some research, buy a breadboard, experiment!
...use loops and code tags.
"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.

Go Up