nieles said:
just fyi in "real" C turning mulitple pins on would look like this:
PORTB |= (1<<PB2) | (1<<PB3) | (1<<PB4);
Thanks
In fake Arduino it is basically the same - just OR'ing in the values
PORTB |= B1100;
And you can do it so as to not disturb the other bits too.
This rant is not directed at you in any way - but your "real" in quotes reminded me of how so many engineers that I know dont take Arduino seriously - like it is a joke programming language. I spent years writing in 8086 ASM, PIC ASM, C, C++, variants of C (for different uControllers), Java, LabView, and 5 or 10 other languages that I have forgotten about (like LISP) etc. I am a seasoned programmer who has experienced many different environments.... The best programming language by far in my opinion is LabView (a totally visual programming language) - but the easiest text language to use, to learn, and to teach is Arduino.
The "getting over the hump" factor just can not be beat.
Yes - It is not suitable for the hardcore project... but for empowering your peers to not depend on you - it is THE BEST. For instance -
Steve at Jozztek picked up Arduino (and LabView for that matter) in only a few weeks time. Like a duck to water. Had I tried to lay something like hard core C on him it probably would have taken two weeks just to get his IDE set up and working without any issues

. Lets not even talk about targeting different platforms, snatching snippets off the net, dealing with the minutia of each micro controllers hardware, etc.
Just like none of us liked Java when it first came out..... until we saw that we could write a program that would run on *anything* - apple, IBM, you name it... then we were like "ohhh...."

Arduino has the awesome quality that it works on any supported Arduino chip (which obviously will just grow and grow) and it is a very small program set - super easy to not get overwhelmed by. And lastly.. of course you can break out at any point and write efficient code if you need to - for some crazy interupt that has to happen in 3uS or less or whatever.... so it is not like you cant do anything you could do with a standard AVR chip (of which I dont have much experience - last chip I worked with was an MSP430 and before that it was PIC)
Anyway - I should know better than to invite more infighting and blathering in my thread (I am sure someone will show up to tell me that Arduino sucks and only retarded people use it
) but I did want to take this opportunity to make an Arduino service announcement.
Again - rant not directed at you in any way. I appreciate that you took the time to help out and post the code for a Port Write. I appreciate your help.
-methods