# Example using PWM to fade an LED.
import time
from machine import Pin, PWM, Timer, SPI
from config import *
from led import *
from TMC2130 import TMC2130_Rotate, TMC2130_Init, rotate_motor_test
from motion import Motion_Init, Motion_Move
from comms import *

LED_OK.value(0)
LED_ERR.value(1)
time.sleep(0.5)
LED_ERR.value(0)
LED_DIR.value(1)
time.sleep(0.5)
LED_DIR.value(0)
LED_STOP.value(1)
time.sleep(0.5)
LED_STOP.value(0)
LED_OK.value(1)
time.sleep(0.5)

TMC2130_Init()
Motion_Init()
Comms_Init()

Comms_Hello()
while True:
    Comms_Read()