From 17e7ee95af10bf3d8ddc43c9921fbcfd27fef74a Mon Sep 17 00:00:00 2001 From: Jaana Burcu Dogan Date: Wed, 22 Jun 2016 18:48:20 -0700 Subject: [PATCH] fix the representation of the pixel bit --- ssd1306/ssd1306.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ssd1306/ssd1306.go b/ssd1306/ssd1306.go index f98e616..2900cd8 100644 --- a/ssd1306/ssd1306.go +++ b/ssd1306/ssd1306.go @@ -104,8 +104,12 @@ func (o *OLED) SetPixel(x, y int, v byte) error { if v > 1 { return fmt.Errorf("value needs to be either 0 or 1; given %v", v) } - i := x + (y/8)*o.w + 1 - o.buf[i] = o.buf[i] | v<