Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:54 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : My mind is blank

     Page 2 of 2    
Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2642
Posted: 09:34pm 03 Feb 2022
Copy link to clipboard 
Print this post

"It was indeed an ILI9488 sold as an ILI9341"

That is two now, could either of you let everyone know who the vendor is to save them the hassle you have been through?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 09:49pm 03 Feb 2022
Copy link to clipboard 
Print this post

If it says 3.2" assume ili9488
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2642
Posted: 10:03pm 03 Feb 2022
Copy link to clipboard 
Print this post

"If it says 3.2" assume ili9488"

It depends on the vendor. I have an actual 3.2" ILI9341 working perfectly with the ILI9341 options that I got from JR_E-Shop on AliExpress.
 
Glen0
Regular Member

Joined: 12/10/2014
Location: New Zealand
Posts: 95
Posted: 12:07am 04 Feb 2022
Copy link to clipboard 
Print this post

This was my purchase.

 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2642
Posted: 04:57am 04 Feb 2022
Copy link to clipboard 
Print this post

Ok! Same vendor, what you get is just a "lucky dip". Only solution is to try both drivers. At least you should have got some extra resolution (480x320) for your trouble. Are all three the same or a mixture?
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 10:51am 04 Feb 2022
Copy link to clipboard 
Print this post

I can't remember where I got mine from sorry it was ages ago
but it's a 2.8inch 240x320 display no touch
I haven't tested the sd card sorry
Edited 2022-02-04 20:52 by lew247
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:53am 04 Feb 2022
Copy link to clipboard 
Print this post

Phil99: did you measure it? Is it really 3.2"? Or have they shipped 2.8"?
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2642
Posted: 11:08am 04 Feb 2022
Copy link to clipboard 
Print this post

Yes, measured the illuminated diagonal at 81.5mm = 3.2". My MM+ has a 2.8" and it is clearly bigger than that.
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 03:09pm 08 Feb 2022
Copy link to clipboard 
Print this post

Can anyone help with this one?  I really cannot remember how it was done in teh first place
It's "python"

Ive got a compass on a screen thats  HRES = 1920 VRES = 1080

and I've now changed the orientation of the screen to portrait mode and altered the resolution
so it's now 1080x1920

What I want to do is change the compass code below so the centre of the compass is higher to the top of the screen but I can't figure out how to set the position of X, Y, WID, and CX and CY so I can heep the horizontal centre of the compass but move the vertical centre higher

this is the code if anyone is able to help
def rotateTriangle(angle_deg, pointerRelPoints):
   angle_rad = angle_deg*2*pi/360
   res = []
   for (x,y) in pointerRelPoints:
       xrot = x*cos(angle_rad) - y*sin(angle_rad)
       yrot = x*sin(angle_rad) + y*cos(angle_rad)
       res.append((xrot,yrot))
   return res    
 

def renderCompassRose(cx, cy, wid):
   """Render compass rose to screen at given coordinates and size."""

   ren = pg.transform.rotozoom(font.render("NE", 1, pg.Color(1,1,1), pg.Color(134,174,230)), -45, 0.9)
   x = cx+1.1*wid*cos(pi/4)-ren.get_width()//2
   y = cy-1.1*wid*sin(pi/4)-ren.get_height()//2
   screen.blit(ren, (x,y))

   ren = pg.transform.rotozoom(font.render("SE", 1, pg.Color(1,1,1), pg.Color(134,174,230)), -135, 0.9)
   x = cx+1.1*wid*cos(pi/4)-ren.get_width()//2
   y = cy+1.1*wid*sin(pi/4)-ren.get_height()//2
   screen.blit(ren, (x,y))

   ren = pg.transform.rotozoom(font.render("NW", 1, pg.Color(1,1,1), pg.Color(134,174,230)), 45, 0.9)
   x = cx-1.1*wid*cos(pi/4)-ren.get_width()//2
   y = cy-1.1*wid*sin(pi/4)-ren.get_height()//2
   screen.blit(ren, (x,y))

   ren = pg.transform.rotozoom(font.render("SW", 1, pg.Color(1,1,1), pg.Color(134,174,230)), 135, 0.9)
   x = cx-1.1*wid*cos(pi/4)-ren.get_width()//2
   y = cy+1.1*wid*sin(pi/4)-ren.get_height()//2
   screen.blit(ren, (x,y))

   ren = font.render("N", 1, pg.Color(1,1,1), pg.Color(134,174,230))
   screen.blit(ren, (cx-ren.get_width()//2, cy-1.15*wid-ren.get_height()//2))

   ren = font.render("S", 1, pg.Color(1,1,1), pg.Color(134,174,230))
   screen.blit(ren, (cx-ren.get_width()//2, cy+1.15*wid-ren.get_height()//2))

   ren = font.render("E", 1, pg.Color(1,1,1), pg.Color(134,174,230))
   screen.blit(ren, (cx+1.15*wid-ren.get_width()//2, cy-ren.get_height()//2))

   ren = font.render("W", 1, pg.Color(1,1,1), pg.Color(134,174,230))
   screen.blit(ren, (cx-1.15*wid-ren.get_width()//2, cy-ren.get_height()//2))

   #tick marks, every 5 degrees (360/5 = 72)
   a = 0.0
   while a<2*pi:
       x1 = cx + cos(a)*(wid-4*HRES//1600)
       y1 = cy - sin(a)*(wid-4*VRES//900)
       x2 = cx + cos(a)*(wid+1*HRES//1600)
       y2 = cy - sin(a)*(wid+1*VRES//900)
       pg.draw.line(screen, pg.Color('white'), (x1, y1), (x2, y2), 1)
       a+=2*pi/72

   #pointers to cardinal directions
   a = 0
   while a<2*pi:
       x1 = cx - sin(a)*(wid + 2*HRES//1600)
       y1 = cy - cos(a)*(wid + 2*VRES//900)
       x2 = cx + cos(a)*wid*0.11
       y2 = cy + sin(a)*wid*0.11
       x3 = cx - cos(a)*wid*0.11
       y3 = cy - sin(a)*wid*0.11
       a += pi/2

   #The compass pointer triangle
   forecastData = forecastObj.getData()  
   skyData = skyDevice.getData()
   
   pointerBase = COMPASS_POINTER_BASE_SIZE*HRES//1600
   pointerRadius = wid-4*HRES//1600
   pointerRelPoints = [(0,-pointerRadius),
       (-pointerBase/1,0),(pointerBase/2,0)]
   #coordinates translated to compass center on screen    
   pointerRelPointsRotated = rotateTriangle(skyData.wind_bearing, pointerRelPoints)
   pointerAbsPoints = [(int(x)+cx,int(y)+cy) for (x,y) in pointerRelPointsRotated]  
   if skyData.wind_speed > 0:
       pg.draw.polygon(screen, pg.Color('blue'), pointerAbsPoints)
   pg.draw.circle(screen, pg.Color(134,174,230), (cx, cy), int(wid*0.76))      
   pg.draw.circle(screen, pg.Color('white'), (cx, cy), int(wid*0.75), 1)  
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025