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.
Photo

Having a problem with my adafruit ST7735 LCD


  • Please log in to reply
24 replies to this topic

#21 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 29 September 2012 - 11:42 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.


This tell u specified width and height of lcd. Ur lcd is 160x128.

#22 lanaya piper

lanaya piper

    New Member

  • Members
  • Pip
  • 3 posts

Posted 12 October 2012 - 03:04 PM

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.



This is so great! Thanks for sharing! I'm learning a lot from you! You're really a pro!

#23 Suresh Raj

Suresh Raj

    New Member

  • Members
  • Pip
  • 5 posts

Posted 17 October 2012 - 06:11 PM

I got the lovely adafruit ST7735 LCD screen for Christmas and I'm having troubles with it right out of the box.

It's wired up like so:
Reset -> D8
D/C -> D7
TFT_CS -> D9
MOSI -> D11
SCK -> D13
MISO -> D12

(See the board here.)

When I run the following code:

            AdaFruitST7735 lcd = new AdaFruitST7735(
                Pins.GPIO_PIN_D9,
                Pins.GPIO_PIN_D7,
                Pins.GPIO_PIN_D8);

            lcd.ClearScreen(color: (ushort)Colors.Blue);

My LCD looks as it does in the attached picture.

Any ideas why this isn't working?

Thanks!


Hi Rico/Supra,

I made a custom board with Adafruit 1.8" TFT displau (ST7735) with the following connections

Reset -> PA15
D/C -> PA11
TFT_CS -> PA12
MOSI -> D11
SCK -> D13
MISO -> D12


I am not able to get anything when I map rest, D/C and TFT_CS to the above pins. Can I use these alternate GPIO pins. Please help!

#24 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 20 October 2012 - 01:33 PM

Hi Rico/Supra,
I am not able to get anything when I map rest, D/C and TFT_CS to the above pins. Can I use these alternate GPIO pins. Please help!


Sorry for late reply. Btw, I'm using NGo.
There is no way to make thing work if u used alternate GPIO pins.
Double check ur wiring(some not getting signal) probably.

#25 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 21 October 2012 - 10:55 AM

@Suresh Raj

here is link:
MyLCD

Mylink




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.