Update:
GUI version 1.1 with 512 sequences now available.
Finished working on Arduino side with the second array containing modifiers
It does shifting left and right, rotation left and right, blink and invert (in 8 steps).
//#define debug
#if defined(debug)
#define stepTime 250
#else
#define stepTime 50
#endif
int pinArray[] = {2, 3, 4, 5, 6, 7, 8, 9};
//copy or paste this into patOgen
//from here
const PROGMEM byte myArray[] = {0xaa, 0x01, 0x80, 0x60, 0x06, 0x55, 0xff};
const PROGMEM byte myArrayModifiers[] = {0x05, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
//to here
#define noSteps sizeof(myArray)
int currentStep = 0;
void setup() {
for (int i = 0; i < 8; i++) {
pinMode(pinArray[i], OUTPUT);
#if defined(debug)
Serial.begin(115200);
#endif
}
}
void loop() {
static long lightTime = millis();
if (millis() - lightTime > stepTime) {
static byte myLights = 0;
static byte mode = 0;
static byte subStep = 0;
if (subStep == 0) {
myLights = pgm_read_byte_near(myArray + currentStep);
mode = pgm_read_byte_near(myArrayModifiers + currentStep);
}
switch (mode) {
case 1:
//shl
if (subStep > 0)
myLights <<= 1;
break;
case 2:
//shr
if (subStep > 0)
myLights >>= 1;
break;
case 3:
//rol
if (subStep > 0)
myLights = ((myLights & 0x80) ? 0x01 : 0x00) | (myLights << 1);
break;
case 4:
//ror
if (subStep > 0)
myLights = ((myLights & 0x01) ? 0x80 : 0x00) | (myLights >> 1);
break;
case 5:
//invert
if (subStep > 0)
myLights = ~myLights;
break;
case 6:
//blink
if (subStep % 2 == 0)
myLights = pgm_read_byte_near(myArray + currentStep);
else
myLights = 0x00;
break;
default:
subStep = 7;
break;
}
subStep++;
subStep %= 8;
#if defined(debug)
Serial.println(subStep);
Serial.println(myLights, BIN);
Serial.println();
#endif
for (int i = 0; i < 8; i++) {
digitalWrite(pinArray[i], (bool)(0x01 & (myLights >> i)));
}
if (subStep == 0) currentStep++;
currentStep %= noSteps;
lightTime = millis();
}
}