First test with the solenoids and compass assembly.
The Sketch is incorrect (actual code in arduining web page).
A circular sequence of ON and OFF of the solenoids was used.
Working to use an instance of the stepper class.
Enjoy the music at less.
More info: http://arduining.com/2012/03/04/arduino-compass-stepper-test/
, https://i.ytimg.com/vi/tDp2mOzVbtQ/hqdefault.jpg
source
The solenoids are coils extracted from 24 Volts relays with 1600 ohms of impedance. They drain 3 milliams when 5 Vols are used. The ATMEGA328 (Arduino) can sink or source 40 milliamps. Thanks for asking.
Can't you burn a pin having the solenoids connected directly to the arduino?