change to new raum 2 configuration

This commit is contained in:
interfisch 2018-06-10 19:23:11 +02:00
parent c271982416
commit af8b86a0c0
2 changed files with 37 additions and 33 deletions

View File

@ -1,3 +1,5 @@
//flash as Wemos D1 R2 & mini
#include <Adafruit_NeoPixel.h> #include <Adafruit_NeoPixel.h>
#ifdef __AVR__ #ifdef __AVR__
#include <avr/power.h> #include <avr/power.h>
@ -54,36 +56,36 @@ void setup() {
resetHeightmap(); resetHeightmap();
//fixed heightmap //fixed heightmap
heightraw[0]=199; heightraw[0]=254;
heightraw[38]=198; heightraw[20]=253;
heightraw[45]=192; heightraw[40]=254;
heightraw[60]=180; heightraw[67]=241;
heightraw[78]=168; heightraw[79]=240;
heightraw[117]=167; heightraw[90]=237;
heightraw[160]=115; heightraw[130]=218;
heightraw[178]=100; heightraw[144]=217;
heightraw[194]=96; heightraw[159]=218;
heightraw[215]=105; heightraw[196]=232;
heightraw[239]=128; heightraw[228]=197;
heightraw[250]=139; heightraw[236]=191;
heightraw[266]=127; heightraw[245]=197;
heightraw[276]=122; heightraw[275]=235;
heightraw[287]=128; heightraw[300]=210;
heightraw[299]=117; heightraw[345]=178;
heightraw[358]=28; heightraw[362]=176;
heightraw[379]=5; heightraw[369]=176;
heightraw[388]=1; heightraw[381]=169;
heightraw[401]=1; heightraw[421]=112;
heightraw[409]=6; heightraw[460]=80;
heightraw[425]=20; heightraw[474]=78;
heightraw[492]=120; heightraw[489]=80;
heightraw[500]=124; heightraw[524]=112;
heightraw[531]=120; heightraw[534]=121;
heightraw[561]=122; heightraw[542]=122;
heightraw[571]=126; heightraw[561]=123;
heightraw[578]=136; heightraw[580]=145;
heightraw[588]=148; heightraw[599]=172;
heightraw[599]=151;
@ -222,7 +224,9 @@ void spawnWagon(){
//Wagon tmpr = Wagon(maxid++,NUMPIXELS,&strip, height, random(0, 20), random(3,20), random(0.2, 50)/10.0, 0 , random(5,100) , Wheel(random(0,256))); //spawn new wagon //Wagon tmpr = Wagon(maxid++,NUMPIXELS,&strip, height, random(0, 20), random(3,20), random(0.2, 50)/10.0, 0 , random(5,100) , Wheel(random(0,256))); //spawn new wagon
int _randomlength=random(3,40); //Zelt: 3-> minimum vel 10, 40 -> minium vel 30 int _randomlength=random(3,40); //Zelt: 3-> minimum vel 10, 40 -> minium vel 30
// pos, wagonlength, startvel , startacc, trainmass, wagoncolor // pos, wagonlength, startvel , startacc, trainmass, wagoncolor
Wagon tmpr = Wagon(maxid++,NUMPIXELS,&strip, height, random(0, 20), _randomlength, random(map(_randomlength,3,40,1,1), map(_randomlength,3,40, 13,40))/10.0 , 0 , 5 , Wheel((uint8_t)random(0,255))); //spawn new wagon //Wagon tmpr = Wagon(maxid++,NUMPIXELS,&strip, height, random(0, 20), _randomlength, random(map(_randomlength,3,40,1,1), map(_randomlength,3,40, 13,40))/10.0 , 0 , 5 , Wheel((uint8_t)random(0,255))); //spawn new wagon
Wagon tmpr = Wagon(maxid++,NUMPIXELS,&strip, height, NUMPIXELS+_randomlength, _randomlength, -random(map(_randomlength,3,40,10,20), map(_randomlength,3,40, 22,60))/10.0 , 0 , 5 , Wheel((uint8_t)random(0,255))); //spawn new wagon
wagon_arr.push_back(tmpr); wagon_arr.push_back(tmpr);
Serial.println("Spawned Wagon"); Serial.println("Spawned Wagon");

View File

@ -102,10 +102,10 @@ void setup() {
.setSize(maxspawnlength,10); .setSize(maxspawnlength,10);
slSpawnStartvel = cp5.addSlider("spawnstartvel") slSpawnStartvel = cp5.addSlider("spawnstartvel")
.setRange(0,maxspawnstartvel) .setRange(-maxspawnstartvel,maxspawnstartvel)
.setValue(70) .setValue(70)
.setPosition(220,80+15*2) .setPosition(220,80+15*2)
.setSize(maxspawnstartvel,10); .setSize(maxspawnstartvel*2,10);
slSpawnStartacc = cp5.addSlider("spawnstartacc") slSpawnStartacc = cp5.addSlider("spawnstartacc")
.setRange(0,maxspawnstartacc) .setRange(0,maxspawnstartacc)