Skip to content

Commit 9c13d60

Browse files
committed
ffs
1 parent 52f6766 commit 9c13d60

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

pkg/sensehat/sensehat.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -714,30 +714,30 @@ func (s *SenseHat) FlashLED(x, y int, r, g, b uint8, duration time.Duration) err
714714
return s.SetPixel(x, y, 0, 0, 0)
715715
}
716716

717-
// SetNavLights turns on the navigation lights.
718-
// Row 0: Strobe(x=0), Green(x=1) on HDMI side | Red(x=6), Strobe(x=7) on GPIO side
717+
// SetNavLights turns on the navigation lights on top row (SD card side).
718+
// y=7 is furthest from GPIO (top of board when GPIO is on right)
719719
func (s *SenseHat) SetNavLights() error {
720-
// Green next to HDMI strobe (x=1, y=0)
721-
if err := s.SetPixel(1, 0, 0, 255, 0); err != nil { // Green
720+
// Green (x=1, y=7)
721+
if err := s.SetPixel(1, 7, 0, 255, 0); err != nil {
722722
return err
723723
}
724-
// Red next to GPIO strobe (x=6, y=0)
725-
return s.SetPixel(6, 0, 255, 0, 0) // Red
724+
// Red (x=6, y=7)
725+
return s.SetPixel(6, 7, 255, 0, 0)
726726
}
727727

728-
// FlashStrobes double-flashes the strobe lights.
729-
// Row 0: Strobe at x=0 (HDMI side), Strobe at x=7 (GPIO side)
728+
// FlashStrobes double-flashes the strobe lights on top row (SD card side).
729+
// y=7 is furthest from GPIO (top of board when GPIO is on right)
730730
func (s *SenseHat) FlashStrobes(duration time.Duration) error {
731731
for flash := 0; flash < 2; flash++ {
732-
// Flash on (x, y)
733-
s.SetPixel(0, 0, 255, 255, 255) // HDMI side strobe (x=0, y=0)
734-
s.SetPixel(7, 0, 255, 255, 255) // GPIO side strobe (x=7, y=0)
732+
// Flash on
733+
s.SetPixel(0, 7, 255, 255, 255) // Left strobe (x=0, y=7)
734+
s.SetPixel(7, 7, 255, 255, 255) // Right strobe (x=7, y=7)
735735

736736
time.Sleep(duration)
737737

738738
// Flash off
739-
s.SetPixel(0, 0, 0, 0, 0)
740-
s.SetPixel(7, 0, 0, 0, 0)
739+
s.SetPixel(0, 7, 0, 0, 0)
740+
s.SetPixel(7, 7, 0, 0, 0)
741741

742742
if flash == 0 {
743743
time.Sleep(duration / 2)
@@ -777,22 +777,22 @@ func (s *SenseHat) PlaneAnimation(frameDelay time.Duration) error {
777777
}
778778
}
779779

780-
// Navigation lights - all on row 0 (y=0)
781-
// Strobe(x=0), Green(x=1) on HDMI side | Red(x=6), Strobe(x=7) on GPIO side
782-
if err := s.SetPixel(1, 0, 0, 255, 0); err != nil { // Green (x=1, y=0)
780+
// Navigation lights - all on top row (y=7, SD card side)
781+
// Strobe(x=0), Green(x=1) | Red(x=6), Strobe(x=7)
782+
if err := s.SetPixel(1, 7, 0, 255, 0); err != nil { // Green
783783
return err
784784
}
785-
if err := s.SetPixel(6, 0, 255, 0, 0); err != nil { // Red (x=6, y=0)
785+
if err := s.SetPixel(6, 7, 255, 0, 0); err != nil { // Red
786786
return err
787787
}
788788

789-
// Strobe lights at corners of row 0
789+
// Strobe lights at corners of top row
790790
strobeOn := (strobeCounter % 4) < 2
791791
if strobeOn {
792-
if err := s.SetPixel(0, 0, 255, 255, 255); err != nil { // HDMI side strobe (x=0, y=0)
792+
if err := s.SetPixel(0, 7, 255, 255, 255); err != nil { // Left strobe
793793
return err
794794
}
795-
if err := s.SetPixel(7, 0, 255, 255, 255); err != nil { // GPIO side strobe (x=7, y=0)
795+
if err := s.SetPixel(7, 7, 255, 255, 255); err != nil { // Right strobe
796796
return err
797797
}
798798
}

0 commit comments

Comments
 (0)