so newish to fidgeting with arduino.
Got a stepper motor sort of running with transistors.
But its wierd.
And made it worse with each attempt. I used the same code sheet so wat i have left is a mess, and a vibrating motor. >:(
Anyways the problem.
How would one set selected pins to be....
eg: pins 2,3,4,5 to
HIGH,LOW,LOW,HIGH in one line of code.
usually it's not really needed, there are very few physical stuff that react to a few microseconds deltas. but if you really want to have the best possible synchronicity the hardware can offer then read about Port Registers
e.g. from the example there
DDRD = DDRD | B11111100; // this is safer as it sets pins 2 to 7 as outputs
// without changing the value of pins 0 & 1, which are RX & TX
PORTD = B10101000; // sets digital pins 7,5,3 HIGH and the others LOW
I don't understand. Many others have gotten stepper motors to work using separate lines of code and little consideration of the timing.
digitalWrite(...) sets a single pin and works on any Arduino. Port manipulation sets multiple pins IN THE SAME PORT simultaneously but may be specific to just a few Arduinos. I do not know anything inbetween.
There is a fastport library that may do as you asked but I am unfamiliar with it and it is unnecessary for your stepper motor.