using interrupts

Can you tell me how do I read all the impulses and then activate the solenoid pins.