mrt-prodz / ATmega328-Flappy-Bird-Clone

Flappy Bird clone made for the ATmega328 and Sainsmart 1.8" TFT screen (ST7735)
30 stars 16 forks source link

I don't know what is wrong #3

Open shawnm07 opened 5 years ago

shawnm07 commented 5 years ago

'class Adafruit_ST7735' has no member named 'Color565'

mrt-prodz commented 5 years ago

Sorry I just noticed your issue. Someone asked a similar question on the YouTube video of this project, here is the answer I replied :

Not sure exactly why this method is not part of the Adafruit_ST7735 class anymore. The function was simply converting rgb values to a 16bit packed color. You could just add this function to your main ino file and replace all calls to TFT.Color565 to Color565 :

uint16_t Color565(uint8_t r, uint8_t g, uint8_t b) {
    return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
 }
shawnm07 commented 5 years ago

where do I put this in the sketch?

On Wed, May 15, 2019 at 12:03 PM Themistokle Benetatos < notifications@github.com> wrote:

Sorry I just noticed your issue. Someone asked a similar question on the YouTube video of this project, here is the answer I replied :

Not sure exactly why this method is not part of the Adafruit_ST7735 class anymore. The function was simply converting rgb values to a 16bit packed color. You could just add this function to your main ino file and replace all calls to TFT.Color565 to Color565 :

uint16_t Color565(uint8_t r, uint8_t g, uint8_t b) {

return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);

}

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mrt-prodz/ATmega328-Flappy-Bird-Clone/issues/3?email_source=notifications&email_token=ALXZMTB2WWUBZXEHYU5QC4DPVRNBXA5CNFSM4HHI4JV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVPUNRI#issuecomment-492783301, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXZMTETHEPTPVW45MBEXN3PVRNBXANCNFSM4HHI4JVQ .