 #define STEP_PIN  54  //			18			54	//step
 #define CS_PIN    40  //			17			64	//chip select
 
-bool dir = false;
+bool dir = 0;
 
 
 #include <TMC2130Stepper.h>

	delayMicroseconds(10);
	uint32_t ms = millis();
	static uint32_t last_time = 0;
	if ((ms - last_time) > 4000) {
		if (dir) {
			Serial.println("Dir -> 1");
			TMC2130.GCONF(0b10001);
			Serial.println(TMC2130.GCONF(), BIN);
			dir = false;
		} else {
			Serial.println("Dir -> 0");
			TMC2130.GCONF(0b1);
			Serial.println(TMC2130.GCONF(), BIN);
			dir = true;
		}
		last_time = ms;
	}

void setup() {
	Serial.begin(9600);
	TMC2130.begin();
	TMC2130.SilentStepStick2130(600);
	TMC2130.stealthChop(1);
	
	digitalWrite(EN_PIN, LOW);
}
