diff --git a/M4_Eyes/M4_Eyes.ino b/M4_Eyes/M4_Eyes.ino index 6f47c49d4..6ee69d1bc 100644 --- a/M4_Eyes/M4_Eyes.ino +++ b/M4_Eyes/M4_Eyes.ino @@ -201,7 +201,6 @@ void setup() { // Initialize DMAs for(e=0; esetRotation(3); eye[e].display->fillScreen(0); eye[e].dma.allocate(); eye[e].dma.setTrigger(eye[e].spi->getDMAC_ID_TX()); @@ -247,6 +246,7 @@ void setup() { eye[e].sclera.mirror = 0; eye[e].sclera.spin = 0.0; eye[e].sclera.iSpin = 0; + eye[e].rotation = 3; // Uncanny eyes carryover stuff for now, all messy: eye[e].blink.state = NOBLINK; @@ -400,7 +400,9 @@ void setup() { randomSeed(SysTick->VAL + analogRead(A2)); eyeOldX = eyeNewX = eyeOldY = eyeNewY = mapRadius; // Start in center for(e=0; esetRotation(eye[e].rotation); + eye[e].eyeX = eyeOldX; // Set up initial position eye[e].eyeY = eyeOldY; } lastLightReadTime = micros() + 2000000; // Delay initial light reading diff --git a/M4_Eyes/file.cpp b/M4_Eyes/file.cpp index 7aafc1906..0369de50d 100644 --- a/M4_Eyes/file.cpp +++ b/M4_Eyes/file.cpp @@ -184,7 +184,8 @@ static void getFilename(JsonVariant v, char **ptr) { } void loadConfig(char *filename) { - File file; + File file; + uint8_t rotation = 3; if(file = filesys.open(filename, FILE_READ)) { StaticJsonDocument<2048> doc; @@ -266,6 +267,9 @@ void loadConfig(char *filename) { JsonVariant iristv = doc["irisTexture"], scleratv = doc["scleraTexture"]; + rotation = doc["rotate"] | rotation; // Screen rotation (GFX lib) + rotation &= 3; + v = doc["tracking"]; if(v.is()) tracking = v.as(); v = doc["squint"]; @@ -361,6 +365,8 @@ void loadConfig(char *filename) { if(eye[e].sclera.filename) free(eye[e].sclera.filename); eye[e].sclera.filename = strdup(v); } + eye[e].rotation = doc[eye[e].name]["rotate"] | rotation; + eye[e].rotation &= 3; } #endif } diff --git a/M4_Eyes/globals.h b/M4_Eyes/globals.h index 12533a607..99b8e5702 100644 --- a/M4_Eyes/globals.h +++ b/M4_Eyes/globals.h @@ -162,6 +162,7 @@ typedef struct { uint16_t backColor; // 16-bit 565 RGB, big-endian texture iris; // iris texture map texture sclera; // sclera texture map + uint8_t rotation; // Screen rotation (GFX lib) // Stuff carried over from Uncanny Eyes code. It now needs to be // independent per-eye because we interleave between drawing the diff --git a/MonsterMaskVoiceChanger/MonsterMaskVoiceChanger.ino b/MonsterMaskVoiceChanger/MonsterMaskVoiceChanger.ino index 8ea1aa160..668eefe75 100644 --- a/MonsterMaskVoiceChanger/MonsterMaskVoiceChanger.ino +++ b/MonsterMaskVoiceChanger/MonsterMaskVoiceChanger.ino @@ -30,7 +30,7 @@ static void fatal(const char *message, uint16_t blinkDelay) { void setup() { pinMode(SPEAKER_ENABLE_PIN, OUTPUT); - digitalWrite(SPEAKER_ENABLE_PIN, HIGH); // Speaker OFF + digitalWrite(SPEAKER_ENABLE_PIN, LOW); // Speaker OFF Serial.begin(115200); //while(!Serial);