From 77d5ef1b5cfa83ec1fca40ba1b4d17ed59f067a8 Mon Sep 17 00:00:00 2001 From: Fisch Date: Fri, 12 Jan 2024 22:36:33 +0100 Subject: [PATCH] new config raum3 ctdo --- .../achterbahnconfig/achterbahnconfig.pde | 5 ++--- src/main.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/achterbahnconfig/achterbahnconfig/achterbahnconfig.pde b/achterbahnconfig/achterbahnconfig/achterbahnconfig.pde index e072e67..c0504b3 100644 --- a/achterbahnconfig/achterbahnconfig/achterbahnconfig.pde +++ b/achterbahnconfig/achterbahnconfig/achterbahnconfig.pde @@ -165,8 +165,8 @@ void setup() { - //myPort = new Serial(this, "/dev/ttyUSB0", 115200); - myPort = new Serial(this, "COM3", 115200); + myPort = new Serial(this, "/dev/ttyUSB0", 115200); + //myPort = new Serial(this, "COM3", 115200); } void Set() { @@ -192,7 +192,6 @@ void printHeightmap() { myPort.write(writeserial); } - void Debug() { String writeserial="debug\n"; myPort.write(writeserial); diff --git a/src/main.cpp b/src/main.cpp index 16b4c6d..9ff5888 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,7 +35,7 @@ void saveHeightmapRaw(); #define PIN_LDR A0 //comment if not used -#define PIN D2 +#define PIN D4 #define NUMPIXELS 600 Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); @@ -267,10 +267,10 @@ void spawnWagon(){ int side_multi=1; //start in forward direction - if (random(0,2)==0){ //spawn from other side + /*if (random(0,2)==0){ //spawn from other side side_startpos=NUMPIXELS+_randomlength; side_multi=-1; - } + }*/ //Force start from end of strip @@ -310,8 +310,8 @@ void loop() { if (millis()-last_ldrread > 10000) { int _light=analogRead(PIN_LDR); uint8_t _brightness = constrain(map(_light, LDR_MIN, LDR_MAX, BRIGHTNESS_RUN_MIN, BRIGHTNESS_RUN), BRIGHTNESS_RUN_MIN, BRIGHTNESS_RUN); - Serial.print("kilian="); Serial.println(_light); - Serial.print("ergbebinis="); Serial.println(_brightness); + //Serial.print("kilian="); Serial.println(_light); + //Serial.print("ergbebinis="); Serial.println(_brightness); strip.setBrightness(_brightness); last_ldrread=millis(); } @@ -678,6 +678,7 @@ void saveHeightmapRaw(){ c_eepromaddress++; } + Serial.println("Saved to EEPROM"); EEPROM.commit(); //write changes to eeprom. EEPROM.end() will also commit and release the ram copy of eeprom contents }