Skip to content

Commit c11a2f6

Browse files
committed
fixes
1 parent b3339b8 commit c11a2f6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/sensehat/sensehat.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ func (s *SenseHat) PlaneAnimation(frameDelay time.Duration) error {
739739
textWidth := xOffset - spacing
740740

741741
// Scroll text from right to left with airplane nav lights
742-
strobeOn := false
742+
strobeCounter := 0
743743
for scroll := 0; scroll <= textWidth+8; scroll++ {
744744
if err := s.ClearLEDs(); err != nil {
745745
return err
@@ -765,7 +765,8 @@ func (s *SenseHat) PlaneAnimation(frameDelay time.Duration) error {
765765
return err
766766
}
767767

768-
// Strobe lights: white flashing adjacent to nav lights
768+
// Strobe lights: white flashing every 4 frames (slower flash)
769+
strobeOn := (strobeCounter % 4) < 2
769770
if strobeOn {
770771
if err := s.SetPixel(1, 7, 255, 255, 255); err != nil { // White strobe near red
771772
return err
@@ -774,7 +775,7 @@ func (s *SenseHat) PlaneAnimation(frameDelay time.Duration) error {
774775
return err
775776
}
776777
}
777-
strobeOn = !strobeOn
778+
strobeCounter++
778779

779780
time.Sleep(frameDelay)
780781
}

0 commit comments

Comments
 (0)