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>
#ifdef __AVR__
#include <avr/power.h>
@ -54,36 +56,36 @@ void setup() {
resetHeightmap();
//fixed heightmap
heightraw[0]=199;
heightraw[38]=198;
heightraw[45]=192;
heightraw[60]=180;
heightraw[78]=168;
heightraw[117]=167;
heightraw[160]=115;
heightraw[178]=100;
heightraw[194]=96;
heightraw[215]=105;
heightraw[239]=128;
heightraw[250]=139;
heightraw[266]=127;
heightraw[276]=122;
heightraw[287]=128;
heightraw[299]=117;
heightraw[358]=28;
heightraw[379]=5;
heightraw[388]=1;
heightraw[401]=1;
heightraw[409]=6;
heightraw[425]=20;
heightraw[492]=120;
heightraw[500]=124;
heightraw[531]=120;
heightraw[561]=122;
heightraw[571]=126;
heightraw[578]=136;
heightraw[588]=148;
heightraw[599]=151;
heightraw[0]=254;
heightraw[20]=253;
heightraw[40]=254;
heightraw[67]=241;
heightraw[79]=240;
heightraw[90]=237;
heightraw[130]=218;
heightraw[144]=217;
heightraw[159]=218;
heightraw[196]=232;
heightraw[228]=197;
heightraw[236]=191;
heightraw[245]=197;
heightraw[275]=235;
heightraw[300]=210;
heightraw[345]=178;
heightraw[362]=176;
heightraw[369]=176;
heightraw[381]=169;
heightraw[421]=112;
heightraw[460]=80;
heightraw[474]=78;
heightraw[489]=80;
heightraw[524]=112;
heightraw[534]=121;
heightraw[542]=122;
heightraw[561]=123;
heightraw[580]=145;
heightraw[599]=172;
@ -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
int _randomlength=random(3,40); //Zelt: 3-> minimum vel 10, 40 -> minium vel 30
// 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);
Serial.println("Spawned Wagon");

View File

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