1234567891011121314151617181920212223242526272829 |
- // Pin definitions
- #define DATA_PIN D5 // DS
- #define CLOCK_PIN D6 // SH_CP
- #define LATCH_PIN D7 // ST_CP
- void setup() {
- // Initialize pins
- pinMode(DATA_PIN, OUTPUT);
- pinMode(CLOCK_PIN, OUTPUT);
- pinMode(LATCH_PIN, OUTPUT);
- }
- void writeStep(byte stepByte){
- shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, stepByte);
- digitalWrite(LATCH_PIN, HIGH);
- digitalWrite(LATCH_PIN, LOW);
- delayMicroseconds(800); //780 min
- }
- void loop() {
- writeStep(0b00010001);
- writeStep(0b00110011);
- writeStep(0b00100010);
- writeStep(0b01100110);
- writeStep(0b01000100);
- writeStep(0b11001100);
- writeStep(0b10001000);
- writeStep(0b10011001);
- }
|