From a03b1d6aefe0b81604023a3153759f3084e23c35 Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Tue, 14 Nov 2017 00:24:26 +0100 Subject: [PATCH] =?UTF-8?q?Sendekommando=20erweitert,=20so=20dass=20wieder?= =?UTF-8?q?holungen=20auch=20f=C3=BCr=20jedes=20Sendekommando=20in=20einer?= =?UTF-8?q?=20Sendekette=20angegeben=20werden=20kann.=20(#70)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Um z.B. so etwas 9 mal zu senden: SC;R=9;SR;R=4;P0=-200;P3=450;D=30;SR;R=58;P0=-200;P1=124;D=10; --- RF_Receiver/RF_Receiver.ino | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/RF_Receiver/RF_Receiver.ino b/RF_Receiver/RF_Receiver.ino index 9e63a86e..43608b3d 100644 --- a/RF_Receiver/RF_Receiver.ino +++ b/RF_Receiver/RF_Receiver.ino @@ -411,6 +411,7 @@ struct s_sendcmd { uint8_t datastart; uint16_t dataend; int16_t buckets[6]; + uint8_t repeats; } ; void send_cmd() @@ -449,6 +450,8 @@ void send_cmd() { //type=combined; //cmdNo=255; + cmdNo++; + command[cmdNo].type = combined; extraDelay = false; } else if (msg_part.charAt(1) == 'M') // send manchester @@ -476,7 +479,7 @@ void send_cmd() //MSG_PRINTLN("Adding bucket"); } else if(msg_part.charAt(0) == 'R' && msg_part.charAt(1) == '=') { - repeats= msg_part.substring(2).toInt(); + command[cmdNo].repeats = msg_part.substring(2).toInt(); //MSG_PRINTLN("Adding repeats"); } else if (msg_part.charAt(0) == 'D') { @@ -521,12 +524,15 @@ void send_cmd() if (hasCC1101) cc1101::setTransmitMode(); #endif + + if (command[0].type == combined && command[0].repeats > 0) repeats = command[0].repeats; + for (uint8_t i=0;i