Go Down

Topic: Shift register (Read 1 time) previous topic - next topic

shawnlobo96

How can I control individual pin of a shift register by typing the output pin in the serial monitor (assuming outputs Q0 to Q7) typing 1 should turn on pin Q1 and again typing 1 should turn off pin Q1 and so on for other pins. Also more than one pin should be accessible at the same time. Example typing "123" or "1 2 3" in serial monitor should turn on or off the output pins Q1, Q2, Q3.

PaulRB

#1
Apr 13, 2016, 08:35 pm Last Edit: Apr 13, 2016, 08:38 pm by PaulRB
Hello.

The answer is: by writing a sketch to do what you just described.

What part are you struggling most with? What examples has your research come up with so far?

Paul

PS. Forgot to say: alternatively pay someone to write the sketch for you. There is a "gigs & collaborations" section in the forum where you could request that.

15yearoldnoob

is this what this open source program has come to - trying to pawn off services to buy?
So much for a help eachother community.

larryd

#3
Apr 14, 2016, 04:05 am Last Edit: Apr 15, 2016, 07:19 pm by LarryD
The OP was asked:
What part are you struggling most with? What examples has your research come up with so far?

Then the option of "gigs & collaborations" was mentioned as an alternative.
There was no "trying to pawn off services to buy"


So once again:
What part are you struggling most with?
What examples has your research come up with so far?

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

shawnlobo96

I'm not asking for the sketch. I'm asking whether it's possible to control individual output of a shift register! I saw this Video in which he controlled it by using push buttons. I was wondering whether it's possible to do the same using digital pins (to replace the buttons)?

PaulRB

I'm not asking for the sketch. I'm asking whether it's possible to control individual output of a shift register! I saw this Video in which he controlled it by using push buttons. I was wondering whether it's possible to do the same using digital pins (to replace the buttons)?
Yes, you can of course control each output of a shift register.

Not sure i understand what you meant about using digital pins to control the shift register, but my answer would be: you need 3 (for data, clock & latch).

Grumpy_Mike

#6
Apr 14, 2016, 09:36 am Last Edit: Apr 14, 2016, 09:38 am by Grumpy_Mike
First of see this post
http://forum.arduino.cc/index.php?topic=393831.0
Then you need to read the serial port, see the Arduino's IDE examples code for that.
Then you need to apply the results to setting the correct bit in the data you send to the shift register'.

septillion

I'm not asking for the sketch. I'm asking whether it's possible to control individual output of a shift register!
In ours defense, you asked how to do it, not it it was possible. Yes it is possible and not that hard.

And if you want to be able to select individual outputs via the monitor that doesn't mess with the rest you have to buffer the state on the Arduino. (Or you could read back the shift register but that's a bit over the top for this. More a because you can approach :p )
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

Paul__B

So in case it is not yet obvious, the way to do it is to have a (byte) variable in your program ("sketch") which contains the pattern which you wish to appear in the shift register.  Whenever you want to change any or all bits in the register, you perform the corresponding bit operations on that variable, then you call the function which transfers the value of that byte via the SPI or simply "bit-banging" the data and clock lines and then latching the data into the shift register.

This - maintaining in variables an "image" of what is to be sent out - is a general principle, vastly more sensible than attempting to read information back from shift registers or indeed, output devices in general.

is this what this open source program has come to - trying to pawn off services to buy?
So much for a help each other community.
As a self-declared "newbie" (5 posts) to these discussions, you really need to learn to "pull your head in" until you comprehend what you are talking about or more to this point, learn to read more carefully what people say before criticising.

shawnlobo96

I got it working. I can now control individual pins by specifying the pin number (Q0 to Q7). Also I'm able to toggle multiple pins high or low by specifying them in the serial monitor. Thanks for your suggestions!

Go Up