Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

NicholasSTG

Member Since 14 Dec 2011
Offline Last Active Feb 18 2015 03:45 PM
-----

Posts I've Made

In Topic: Having a problem with my adafruit ST7735 LCD

29 September 2012 - 12:21 AM

I've got to trackdown the 'why' but changing the driver's SetPixel to

          private void SetPixel(int x, int y, ushort color) {
            if ((x < 0) || (x >= Width) || (y < 0) || (y >= Height)) return;

            var index = ((y * Width) + x) * sizeof(ushort) - y * 4;    

            if (index < 0 || index >= SpiBuffer.Length) return;
            SpiBuffer[index] = (byte) (color >> 8);
            SpiBuffer[++index] = (byte)(color);
        }

seems to have done the trick. The check on the index is just there because I was debugging.

In Topic: Having a problem with my adafruit ST7735 LCD

28 September 2012 - 11:07 PM

What abt drawline? Did u try it?


I did.

I wrote this code to sort of see what was happening

public static void Main() {
            // DisplayPicture();

            tft.ClearScreen((ushort)AdaFruitST7735.Colors.White);
            // DisplayGradient();

            // DisplayCircles();

            for (int x = 0; x < 86; x++ )
            {
                tft.DrawPixel(x, 20, (ushort)AdaFruitST7735.Colors.Red);
            }

            for (int y = 0; y < 10; y++)
            {
                tft.DrawPixel(10, y, (ushort)AdaFruitST7735.Colors.Red);
            }

            for (int x = 0; x < 100; x++)
            {
                tft.DrawPixel(x, 5, (ushort)AdaFruitST7735.Colors.Green);
            }

            tft.DrawLine(50, 50, 50,100,(ushort)AdaFruitST7735.Colors.Blue);

            tft.DrawLine(50, 50, 100,50,(ushort)AdaFruitST7735.Colors.Yellow);

            tft.Refresh();

            // tft.ClearScreen();
            // DisplayLines();

            // DisplayColorFlow();
        }

The result looked like the attachment.

It seems that the 0 point is wrong so when the it tries to calculate a horizontal line the shifts in the register get out of whack.

Attached File  2012-09-28 15.05.12.jpg   83.9KB   29 downloads

In Topic: Having a problem with my adafruit ST7735 LCD

28 September 2012 - 09:26 PM

Does ur circle changed direction?


The circles do animate when I use the appropriate method, yes.

IT almost seems as if 0,0 is in the wrong spot which throws off all of the other calculations.

In Topic: Having a problem with my adafruit ST7735 LCD

28 September 2012 - 09:03 PM

I'm guessing you did not have this issue with the skewing?

In Topic: Having a problem with my adafruit ST7735 LCD

28 September 2012 - 08:35 PM

I also downloaded that entire commit from codeplex and it did not make a change.

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.