Skip to content

Commit 7de7c15

Browse files
committed
fuking robots
1 parent 0b084bc commit 7de7c15

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

pkg/sensehat/sensehat.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -714,27 +714,27 @@ 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 on the row closest to GPIO (y=0).
718-
// Red on left (x=0), Green on right (x=7).
717+
// SetNavLights turns on the navigation lights on corners of GPIO-side edge.
719718
func (s *SenseHat) SetNavLights() error {
720-
if err := s.SetPixel(0, 0, 255, 0, 0); err != nil { // Red - left
719+
// Red on one corner, Green on the other (same row)
720+
if err := s.SetPixel(0, 0, 255, 0, 0); err != nil { // Red
721721
return err
722722
}
723-
return s.SetPixel(7, 0, 0, 255, 0) // Green - right
723+
return s.SetPixel(0, 7, 0, 255, 0) // Green
724724
}
725725

726-
// FlashStrobes double-flashes the strobe lights on the row farthest from GPIO (y=7).
726+
// FlashStrobes double-flashes the strobe lights on opposite edge corners.
727727
func (s *SenseHat) FlashStrobes(duration time.Duration) error {
728-
// Double flash pattern
728+
// Double flash pattern on far edge
729729
for flash := 0; flash < 2; flash++ {
730-
// Flash on - far row corners
731-
s.SetPixel(0, 7, 255, 255, 255)
730+
// Flash on
731+
s.SetPixel(7, 0, 255, 255, 255)
732732
s.SetPixel(7, 7, 255, 255, 255)
733733

734734
time.Sleep(duration)
735735

736736
// Flash off
737-
s.SetPixel(0, 7, 0, 0, 0)
737+
s.SetPixel(7, 0, 0, 0, 0)
738738
s.SetPixel(7, 7, 0, 0, 0)
739739

740740
if flash == 0 {
@@ -775,21 +775,21 @@ func (s *SenseHat) PlaneAnimation(frameDelay time.Duration) error {
775775
}
776776
}
777777

778-
// Navigation lights: red/green on GPIO row (y=0)
779-
if err := s.SetPixel(0, 0, 255, 0, 0); err != nil { // Red - left
778+
// Navigation lights: red/green on GPIO-side edge
779+
if err := s.SetPixel(0, 0, 255, 0, 0); err != nil { // Red
780780
return err
781781
}
782-
if err := s.SetPixel(7, 0, 0, 255, 0); err != nil { // Green - right
782+
if err := s.SetPixel(0, 7, 0, 255, 0); err != nil { // Green
783783
return err
784784
}
785785

786-
// Strobe lights: white flashing on far row (y=7)
786+
// Strobe lights: white flashing on far edge
787787
strobeOn := (strobeCounter % 4) < 2
788788
if strobeOn {
789-
if err := s.SetPixel(0, 7, 255, 255, 255); err != nil { // White strobe left
789+
if err := s.SetPixel(7, 0, 255, 255, 255); err != nil {
790790
return err
791791
}
792-
if err := s.SetPixel(7, 7, 255, 255, 255); err != nil { // White strobe right
792+
if err := s.SetPixel(7, 7, 255, 255, 255); err != nil {
793793
return err
794794
}
795795
}

0 commit comments

Comments
 (0)