     Loop function
 */
 bool dir;
-uint32_t nextcall = 1000;
+uint32_t nextcall = 0;
 const uint16_t intervalperiod = 50*64; // 100 milliseconds
 uint32_t nextcall2 = 1000;
+float vibrationfrequency = 10.0f;
+float amplitude = 1.0f;
 bool on_off = true;
 void loop() {
   // read the position in count

  } else if (fbEvent.startsWith("HitCar")) {
	//TODO rendering
  } else if (fbEvent.startsWith("Creak")) {
	static bool fb = false;
	fb = !fb;
	digitalWrite(feedbackLEDPin, fb);//XXX debug
	//TODO rendering
  } else if (fbEvent.startsWith("Smash")) {
	//TODO rendering
  } else if (fbEvent.startsWith("Wreck")) {

    
  if(millis() > nextcall2){
    nextcall2 += intervalperiod;
    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();
  
}
