I am a noob in arduino. I have a ProMicro 5V board which is supposed to be similar to arduino.
I followed the initial set-up in the sparkfun ProMicro 5V page and went through the examples.
My application is simple. I need to send 5V digital signals to a circuit that will turn on a relay (through a Darlington ckt) which will power a solenoid valve.
I have done this before in LabView. However, Labview is really simple. I want to learn the coding way of sending signals through a board.
Could you guys please guide me to a demo code or any pointers for me to write a code that activates individual digital IO ports on the board. I would like to send a signal in patterns of 1 0 0 1 1 0 … to the individual digital IO ports (configured as outputs) to each of the circuits that will be connected to individual solenoid valves.
for example , a 1 will be 5V signal to DIO 1
0 to DIO 2
1 to DIO 3
thus wanting to send 101 to the respective ports to activate the valves simultaneously.
Remember that in C/C++, array indexes always start at zero, not one as in other languages like BASIC.
Although in theory there will be a tiny delay between setting the pins, this will happen thousands of times faster than a solenoid can operate, so it will appear simultaneous.
I assume your next question will be how to make a “Pianola”, “Jaquard loom” or “Fairground Organ” style timed sequence of 0 and 1 signals to the solenoids? How many will solenoids will there be, and how long will the sequence be (number of steps) and what will the times between the steps be?
You could directly manipulate the ports, keeping in mind that you’re using the 32U4 so mapping is slightly different but the toggling the port is mostly the same.