Go Down

Topic: multiple solenoid valves working together ( multiple pins to be set as output ) (Read 3 times) previous topic - next topic

PaulS

Quote
that's not the issue....

OK. Clue me in, then, on what IS the issue.

retrolefty

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/PortManipulation

Not 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=0

Lefty

Hani

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..

Hani


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/PortManipulation

Not 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=0

Lefty



Thanks..... i will check them and i will let u know :)

PaulS

Quote
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.

Quote
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.

Go Up