     
   if(millis() > nextcall2){
     nextcall2 += intervalperiod;
-    Serial.println(readJoystick());
-  }
-  on_off ? set_position = xh + sin(10.0f*2.0f*M_PI*millis()/64000.0f) : force = 0;
+    Serial.print(readJoystick());
+    Serial.print(" ");
+    Serial.println(xh);
+  }
+  on_off ? set_position = xh + amplitude * sin(vibrationfrequency*2.0f*M_PI*millis()/64000.0f) : force = 0;
   motorControl();
   
 }

    Loop function
*/
bool dir;
uint32_t nextcall = 1000;
const uint16_t intervalperiod = 50*64; // 100 milliseconds
uint32_t nextcall2 = 1000;
bool on_off = true;
void loop() {
  // read the position in count

  } else if (fbEvent.startsWith("HitCar")) {
	//TODO rendering
  } else if (fbEvent.startsWith("Creak")) {
    vibrationfrequency = 100.0f;
    nextcall = millis() + 500UL*64UL;
    amplitude = 2.0f;
    on_off = true;
  } else if (fbEvent.startsWith("Smash")) {
	//TODO rendering
  } else if (fbEvent.startsWith("Wreck")) {
