Improve comments
This commit is contained in:
parent
7a66f55848
commit
2cd8210527
1 changed files with 3 additions and 1 deletions
|
@ -64,6 +64,8 @@ void loop () {
|
||||||
if ( Serial . available () ) {
|
if ( Serial . available () ) {
|
||||||
int input = Serial . read () ;
|
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 (
|
if (
|
||||||
seqPos == 0 && input == 188 ||
|
seqPos == 0 && input == 188 ||
|
||||||
seqPos == 1 && input == 92 ||
|
seqPos == 1 && input == 92 ||
|
||||||
|
@ -77,7 +79,7 @@ void loop () {
|
||||||
// Advance in the sequence
|
// Advance in the sequence
|
||||||
seqPos ++ ;
|
seqPos ++ ;
|
||||||
} else if ( seqPos == 8 ) {
|
} else if ( seqPos == 8 ) {
|
||||||
// `input` is the new duty cycle
|
// Sequence completed, `input` is the new duty cycle
|
||||||
OCR1AL = input ;
|
OCR1AL = input ;
|
||||||
OCR1BL = input ;
|
OCR1BL = input ;
|
||||||
Serial . write (input) ;
|
Serial . write (input) ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue