@korttoma
I don't know what I was doing wrong before, but I got the non-block run feature working with your code. I have my blinds controlled by XBMC as well, so if I start and stop a movie in quick succession, I want to make sure the blinds end up in the right spot. I've attached the relevant snippets of code below
void loop(){
if (gw.messageAvailable()) {
//Serial.print("New message from GW");
// ot new messsage from gw
message_s message = gw.getMessage();
setRelayStatus(message);
}
stepper1.run();
}
and then when you get the message:
if (message.header.type==V_DIMMER) { //
float IncomingControl = atoi(message.data);
//Serial.print("Message: ");
//Serial.println(IncomingControl);
//Serial.println((100-IncomingControl)/100*-1*fullOpenSteps);
delay(5);
float incomingNewPosition = (100-IncomingControl)/100*-1*fullOpenSteps;
stepper1.stop();
stepper1.runToPosition();
stepper1.moveTo(incomingNewPosition);
int IncomingControlSend = IncomingControl;
gw.sendVariable(CHILD_ID, V_DIMMER, IncomingControlSend);
}