Offline
Newbie
Karma: 0
Posts: 48
|
 |
« on: January 30, 2013, 06:47:41 pm » |
Hi all.....
I have a question about how can i set multiple pins in the arduino to be set as outpout..... is there registers such as Atmega16 or what???
please help
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #1 on: January 30, 2013, 06:49:09 pm » |
I have a question about how can i set multiple pins in the arduino to be set as outpout..... is there registers such as Atmega16 or what??? Yes, there are. Now, what are you trying to do? Why don't pinMode() and digitalWrite() meet your needs? They do for nearly everyone else.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #2 on: January 30, 2013, 06:55:48 pm » |
this of for my graduation project.... i have around 100 solenoid valves therefore i was hoping to have an easy way to program it so that i don't waste time ...
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #3 on: January 30, 2013, 07:02:56 pm » |
i have around 100 solenoid valves therefore i was hoping to have an easy way to program it so that i don't waste time ... I don't seem to recall which Arduino has 100+ digital pins. Nor, do I remember you mentioning which one you are using.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #4 on: January 30, 2013, 07:05:31 pm » |
i will be using 2 mega and one uno ... that's not the issue....
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #5 on: January 30, 2013, 07:07:17 pm » |
that's not the issue.... OK. Clue me in, then, on what IS the issue.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15310
Measurement changes behavior
|
 |
« Reply #6 on: January 30, 2013, 07:16:58 pm » |
Yes you can manipulate I/O pin (set mode, read bits, write bits) by using direct port manipulations. Here is a write up that uses a 328P based board such as a Uno showing how to use port commands. http://www.arduino.cc/en/Reference/PortManipulationNot that the mega based boards have different and more pin mapping then a Uno board so you have to figure out which port names control which arduino pin names. This worksheet should help: https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #7 on: January 30, 2013, 07:17:16 pm » |
my issue is that how can i program multiple pins to be set as an output without the need of writting, pinMode function 100 times and digitalWrite function 200 times if i want the 100 solenides to be tuned on and then off..
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #8 on: January 30, 2013, 07:19:04 pm » |
Thanks..... i will check them and i will let u know
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #9 on: January 30, 2013, 07:20:56 pm » |
my issue is that how can i program multiple pins to be set as an output without the need of writting, pinMode function 100 times Perhaps a for loop would work. 4 lines of code, instead of 100. and digitalWrite function 200 times if i want the 100 solenides to be tuned on and then off.. Are you planning on banging all 100 solenoids on and off at the same time? If so, you can do that by connecting them all to the same pin, and use just two statements to turn them all on or off. If they are to be turned on and off at different times, then you will still have to write all the code to make that happen. No magic bullets.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #10 on: January 30, 2013, 07:29:28 pm » |
Perhaps a for loop would work. 4 lines of code, instead of 100.
how can i do that? is like this for( i ; i=45; i++) { pinMode( pinname , OUTPUT) } then another for loop for the second and third arduinos? Are you planning on banging all 100 solenoids on and off at the same time?
lol.... yes for example at the beginning of my graphical water show i want all the solenoids to be opened at once so that the water falls as a curtain and then i want to manipulate them so that they can give me a desired drawing or a letter etc...
|
|
|
|
|
Logged
|
|
|
|
|
Milton Keynes UK
Offline
Tesla Member
Karma: 88
Posts: 6290
-
|
 |
« Reply #11 on: January 30, 2013, 08:06:28 pm » |
then another for loop for the second and third arduinos?
lol.... yes for example at the beginning of my graphical water show i want all the solenoids to be opened at once so that the water falls as a curtain and then i want to manipulate them so that they can give me a desired drawing or a letter etc...
Nothing you're saying so far gives me any confidence that either the hardware or software required for this project is within your capabilities. For what it's worth, I would have thought that a single Arduino using shift registers to drive your large array of driver circuits would be the most practical approach, since it avoids needing to synchronise activities across multiple Arduinos. Have you designed the driver circuits yet and figured out how you're going to build and then power 100 of them?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #12 on: February 01, 2013, 03:44:41 pm » |
1. what do u mean by not within my capabilities?
2. what does "single Arduino using shift registers to drive your large array of driver circuits" mean? or how can i use a single arduino to control such number of solenoids?
|
|
|
|
|
Logged
|
|
|
|
|
Milton Keynes UK
Offline
Tesla Member
Karma: 88
Posts: 6290
-
|
 |
« Reply #13 on: February 01, 2013, 04:00:35 pm » |
1. what do u mean by not within my capabilities?
2. what does "single Arduino using shift registers to drive your large array of driver circuits" mean? or how can i use a single arduino to control such number of solenoids?
I think the second question makes my point about the first. 1/ I mean that your explanation of what you're planning to do gives me no confidence that you understand the software and hardware design issues that you would need to solve. 2/ I mean the number of Arduinos is one.The Arduino uses shift registers (probably more than one) to drive multiple outputs from a single pin. The outputs will need to be amplified via driver circuits before they would be able to power your solenoids. That means you're needing a lot of driver circuits. Which implies you need to either spend a significant amount of money buying them, or design and build your own. Given your question "what does it mean" I'm guessing that you would not find it easy to design and build your own driver circuits.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #14 on: February 01, 2013, 04:56:17 pm » |
if what u mean by the driver circuit is not the mosfets and bybass diodes which will be connected to the solenoids then i have no idea of what drivers mean.... if it is what u mean then there is no problem with the drivers ...... the problem is with the shift register stuff..... how can i program multiple outputs on one pin? that's what i meant by question number 2  and by the way maybe the use of mosfets not the best idea therefore we are planning on using solid state relays
|
|
|
|
|
Logged
|
|
|
|
|
|