From 2cd8210527fc6ab9f7572a01656dba9f675b4759 Mon Sep 17 00:00:00 2001 From: Reinout Meliesie Date: Sat, 23 Aug 2025 21:16:18 +0200 Subject: [PATCH] Improve comments --- kulifuli-arduino.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kulifuli-arduino.ino b/kulifuli-arduino.ino index e2ed9d5..8fd4563 100644 --- a/kulifuli-arduino.ino +++ b/kulifuli-arduino.ino @@ -64,6 +64,8 @@ void loop () { if ( Serial . available () ) { int input = Serial . read () ; + // In order to avoid serial writes by software other than kulifuli-host messing things up, + // we check for a specific sequence of 8 bytes before the byte that contains the new duty cycle if ( seqPos == 0 && input == 188 || seqPos == 1 && input == 92 || @@ -77,7 +79,7 @@ void loop () { // Advance in the sequence seqPos ++ ; } else if ( seqPos == 8 ) { - // `input` is the new duty cycle + // Sequence completed, `input` is the new duty cycle OCR1AL = input ; OCR1BL = input ; Serial . write (input) ;