Module ESP32-8048S070C

If doesn't fit into any other category ....
Post Reply
User avatar
cicciocb
Site Admin
Posts: 2063
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1360 times
Contact:

Re: Module ESP32-8048S070C

Post by cicciocb »

Is a development version, it changes all the time.

Many things inside but I've no time to document
BeanieBots
Posts: 348
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 184 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Understood. I'll carry on playing and post any code I think might help/interest others in this thread.
BeanieBots
Posts: 348
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 184 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

VGAclock.png
Just a little bit of fun with this new display :D
The code is very scrappy because it's a mash-up of my old analogue clock code and weather from cicciocb's vga demo1 code.
I've included two columns which can show weather now, 3hr forcast or 6hr forcast.
It is possible to change what is displayed by changing the value of variables Col0 and Col1 which can be done using immediate command in the editor.
Col0=0 will show weather now in the first column
Col0=1 will show the 3hr forecast and Col0=2 will show the 6hr forecast.
The second column can be changed in a similar way changing the value of Col1.
Obviously, this can also be done in code. The intent is to have a touch button to allow selection.
The clock can be resized and and positioned. Hopefully, the code/comments are obvious.
The same is true for the weather columns, so it should be easy to re-code with a small clock on the left and two weather columns on the right.
Hope it's useful to someone. Enjoy!

Code: [Local Link Removed for Guests]

'****************************************************************************
'*                                                                          *
'*    Ported from original analogue clock to work on 800*480 VGA LCD        *
'*    Firmware Annex32-S3 CAN DMT VGA HID 1.52.1 qio opi LFS                *
'*    Heavily simplified after using VGA and GUI commands                   *
'*    Added Open Weather code from Francesco's demo code.                   *
'*                                                                          *
'*    TO DO:                                                                *
'*       Auto adjust display brightness based on sunrise/sunset times       *
'*       Investigate use of bmp image and page swap for clock face.         *
'*       Modify fonts to include custom symbols for measurement units       * 
'*       Fix flicker when icons update                                      * 
'*       Add trend indicators.                                              *
'*                                                                          *
'*    V1.0.0 17/01/2024  First working code.                                *
'*    V1.0.1 19/01/2024  Added forcast data                                 *
'*    V1.0.2 20/01/2024  Added wind speed/direction indicator               *
'*    V1.0.3 21/01/2024  Changed firmware from 1.50.8 to 1.52.1             *
'*                       Added wind direction indication                    *
'*    V1.0.4 23/01/2024  A little tidy up                                   *
'*                                                                          *
'****************************************************************************

appid$ = "your api code here"
city$ = "Hove,uk"

Gosub Init_LCD             'Setup pins for LCD,touch & load fonts
vgagui.init 10             'Reserve space for gui objects
Gosub Options              'Set colours, size & locations
Gosub Init_Clock           'Setup the clock & draw the face
Gosub Init_Weather         'Print headings, windspeed indicator etc.

T_Old$=""                  'Used by timer routine
Timer0 1000, Update        'Print & draw current values every second
wait
'####################################################################
Update:
  T_Now$ = left$(Time$,5)
  Gosub Update_Clock
  If T_Old$ <> T_Now$ then 'Only update every minute
    T_Old$ = T_Now$
    Gosub Update_Weather
  EndIf
Return
'####################################################################
Init_Clock:

  Dim Day$(6)
  Day$(0)="Thursday"    
  Day$(1)="Wednesday"
  Day$(2)="Tuesday" 
  Day$(3)="Monday"
  Day$(4)="Sunday"  
  Day$(5)="Saturday"    
  Day$(6)="Friday"    

  Dim Month$(12)
  Month$(0) = "Err"
  Month$(1) = "Jan"
  Month$(2) = "Feb"
  Month$(3) = "Mar"
  Month$(4) = "Apr"
  Month$(5) = "May"
  Month$(6) = "Jun"
  Month$(7) = "Jul"
  Month$(8) = "Aug"
  Month$(9) = "Sep"
  Month$(10)= "Oct"
  Month$(11)= "Nov"
  Month$(12)= "Dec"
  
  Length_S = FaceSize*0.95 - 30 - TickLength
  Length_M = Length_S * 0.93 
  Length_H = Length_M * 0.85 '

  Hand_H = vgaGUI.Gauge(Clock_X, Clock_Y, 0, 0, 0 ,Col_Hand_H ,Col_Face) 
  Hand_M = vgaGUI.Gauge(Clock_X, Clock_Y, 0, 0, 0 ,Col_Hand_M ,Col_Face) 
  Hand_S = vgaGUI.Gauge(Clock_X, Clock_Y, 0, 0, 0 ,Col_Hand_S ,Col_Face)
 
  vgagui.setrange Hand_H, 0, 60
  vgagui.setrange Hand_M, 0, 60
  vgagui.setrange Hand_S, 0, 60
  vgagui.setstyle Hand_H, Length_H,Width_H
  vgagui.setstyle Hand_M, Length_M,Width_M
  vgagui.setstyle Hand_S, Length_S,Width_S
   
  If Filename$ <> "" then 'See options
    Filename$ = "/Clock" & Filename$ 'Load face if requested.
    vga.image FileName$, Clock_X-FaceSize,Clock_Y-FaceSize
   Else  'It needs to be drawn the old fashioned way!
    vga.text.font FaceFont
    S_Arc = FaceSize * 0.88-TickLength
    vga.circle Clock_X, Clock_Y , FaceSize,Col_ring,1
    vga.circle Clock_X, Clock_Y , (FaceSize-TickLength-2),col_Face,1
  
    For N = 0 to 59 step 5 'Draw the large ticks
      A=2*Pi*N/60
      X1=cos(A) * S_Arc+Clock_X
      Y1=sin(A) * S_Arc+Clock_Y  
      H$=str$(int((n/5)+2) MOD 12 + 1)
      vga.text.align 4
      vga.text.color Col_Digit   
      vga.text.draw H$, X1,Y1    
    Next N
  
    S_Arc = FaceSize * 0.99
    TS=0.005  'Small tick size
  
    For Z = -TS to TS step 0.002
      For N = 0 to 59 step 1
        A=2*Pi*N/60
        X1=cos(A+Z) * (S_Arc)+Clock_X
        Y1=sin(A+Z) * (S_Arc)+Clock_Y
        X2=cos(A+Z) * (S_Arc-TickLength)+Clock_X
        Y2=sin(A+Z) * (S_Arc-TickLength)+Clock_Y
        vga.Line X1, Y1, X2, Y2, Col_Tick_Small
      Next N
    Next Z

    TS=0.02  'Large tick size
  
    For Z = -TS to TS step 0.002
      For N = 0 to 59 step 5
        A=2*Pi*N/60
        X1=cos(A+Z)  * (S_Arc)+Clock_X
        Y1=sin(A+Z)  * (S_Arc)+Clock_Y
        X2=cos(A+Z)  * (S_Arc-TickLength)+Clock_X
        Y2=sin(A+Z)  * (S_Arc-TickLength)+Clock_Y
        vga.Line X1, Y1, X2, Y2, Col_Tick_Large
      Next N
    Next Z
   
  EndIF
  
Return
'####################################################################
Update_Clock:

  DoW = (dateunix(Date$)) mod 7 
  Secs = val(mid$(time$,7,2))+30 mod 59
  Mins = val(mid$(time$,4,2))+30 mod 59
  Hrs = (val(mid$(time$,1,2)))*5+28 +(mins/14) mod 59
  Month = Val(mid$(date$,4,2))
  Day = Val(mid$(date$,1,2))
  
  vga.text.color Col_Text,Col_Back 
  vga.TEXT.ALIGN 5
  vga.TEXT.PADDING 210
  vga.TEXT.DRAW Day$(Dow)+"  "+Month$(Month)+" "+str$(Day),Clock_X+30,Clock_Y-FaceSize-20,11
  
  Select Case Day        'Calculate the Ordinal Suffix
    Case 1:             OS$ = "st"
    Case 2:             OS$ = "nd"
    Case 3:             OS$ = "rd"
    Case 4 to 20:       OS$ = "th"
    Case 21:            OS$ = "st"
    Case 22:            OS$ = "nd"
    Case 23:            OS$ = "rd"
    Case 24 to 30:      OS$ = "th"
    Case 31:            OS$ = "st"
    Case Else:          OS$ = "--"
  End Select
  
  vga.text.align 6
  vga.TEXT.PADDING 30
  vga.text.draw OS$,Clock_X+32,Clock_Y-FaceSize-20,10
  
  vga.text.align 3
  vga.text.padding 60
  vga.text.draw "20"+right$(date$,2),Clock_X+70,Clock_Y-FaceSize-20,11
  
  vga.text.align 4
  vga.text.padding 115
  vga.text.draw time$,Clock_X,Clock_Y+FaceSize+15,11
  
  secs = val(mid$(time$,7,2))+30 mod 59
  mins= val(mid$(time$,4,2))+30 mod 59  
  Hrs = (val(mid$(time$,1,2)))*5+28 +(mins/14) mod 59

  vgaGui.SetValue Hand_H, hrs
  vgaGui.SetValue Hand_M, mins
  vgaGui.SetValue Hand_S, secs  
  vgagui.redraw
  vgagui.redraw  '2nd redraw required to tidy up hands below second hand.
  vga.circle Clock_X,Clock_Y,9,tft.rgb(0,0,0),1
  vga.circle Clock_X,Clock_Y,5,tft.rgb(255,255,255),0
  vga.show
  
Return
'###############################################################################
Init_Weather:

  CLx1=90              'Center line for 1st data column
  CLx2=CLx1 + 205      'Center line for 2nd data column
  Lny=20               'incremental y position of next data line

  Col0 = 0             'Point each column to desired dataset
  Col1 = 2             '0 = Now, 1 = 3hr forcast, 2 = 6hr forcast
  Compass_Y = 380      'Y location of compass
  Compass_S = 80       'Size of compass

  Dim Heading$(2)      'Column headings
  Dim Temperature$(2)  'Setup arrays for weather datasets
  Dim Humidity$(2)
  Dim Pressure$(2)
  Dim Speed$(2)        'Wind speed
  Dim Direction$(2)    'Wind direction
  Dim Icon$(2)         'Icon name
  
  Heading$(0) = "Now"
  Heading$(1) = "+3Hrs"
  Heading$(2) = "+6hrs"
  
  IconZ = 100                    'Icon size
  IconX1 = CLx1-(IconZ/2)        'Location of 1st weather icon
  IconY1 = 35
  IconX2 = CLx2-(IconZ/2)        'Location of 2nd weather icon
  IconY2 = 35
  
  vga.writepage 1 'Clear background for weather icons
  VGA.RECT IconX1, IconY1, IconZ, IconZ, col_back ,1 
  VGA.RECT IconX2, IconY2, IconZ, IconZ, col_back ,1 
  vga.writepage 0 'go back to current page
  
  vga.text.align 4'Center
  vga.text.color Col_Text 'align with clock face
  vga.text.draw "Sunrise",Clock_X-130,Clock_Y+FaceSize-10 
  vga.text.draw "Sunset",Clock_X+130,Clock_Y+FaceSize-10
  
  VGA.TEXT.FONT 11
  vga.text.draw "C",CLx1 + 55,155
  VGA.CIRCLE CLx1 + 42, 150, 4, col_text
  VGA.CIRCLE CLx1 + 42, 150, 3, col_text
  
  vga.text.draw "C",CLx2 + 55,155
  VGA.CIRCLE CLx2 + 42, 150, 4, col_text
  VGA.CIRCLE CLx2 + 42, 150, 3, col_text
  
  vga.text.draw "%",CLx1+50,210
  vga.text.draw "%",CLx2+50,210
  
  vga.text.draw chr$(34)+"Hg",CLx1+60,255
  vga.text.draw chr$(34)+"Hg",CLx2+60,255
  
  LnY = Compass_Y     'y position of wind compass
  SzY = Compass_S     'Size of wind compass 
  vga.circle CLx1, LnY,SzY-10,col_text 
  
  VGA.TEXT.FONT 10 'use small letters for compass 
  vga.text.draw "N",CLx1,LnY-SzY
  vga.text.draw "S",CLx1,LnY+SzY
  vga.text.draw "W",CLx1-SzY,LnY
  vga.text.draw "E",CLx1+SzY,LnY
  
  vga.circle CLx2, LnY,SzY-10,col_text
  vga.text.draw "N",CLx2,LnY-SzY
  vga.text.draw "S",CLx2,LnY+SzY
  vga.text.draw "W",CLx2-SzY,LnY
  vga.text.draw "E",CLx2+SzY,LnY
  
Return
'###############################################################################
Update_Weather:
  
  VGA.TEXT.FONT 12
  vga.text.draw Heading$(Col0),CLx1,19
  vga.text.draw Heading$(Col1),CLx2,19
  
  W_now$ = wget$("http://api.openweathermap.org/data/2.5/weather?q=" + city$ + "&appid=" + appid$ + "&units=metric")
  Pause 250
  W_fcst$ = wget$("http://api.openweathermap.org/data/2.5/forecast?q=" + city$ + "&cnt=12&appid=" + appid$ + "&units=metric")
  Pause 250
  Town$ = json$(W_now$,"name")
  
  if (Town$ <> "not found") then 'only update if we got some valid data
  
    T_rise$ = left$(unixtime$(json$(W_now$,"sunrise")),5)
    T_set$ = left$(unixtime$(json$(W_now$,"sunset")),5)
  
    Temperature$(0) = json$(W_now$,"temp")
    Temperature$(0) = STR$ (val(Temperature$(0)) ,"%2.1f") 'round to single decimal

    Pressure$(0) = json$(W_now$,"pressure")
    Pressure$(0) = str$((val(Pressure$(0))/33.864),"%2.1f") 'convert to inches of mercury
       
    Speed$(0) = json$(W_now$,"speed")
    Speed$(0) = str$((val(Speed$(0))/1.609),"%2.1f")'convert to mph
    Speed$(1) = json$(W_fcst$,"speed")
    Speed$(1) = str$((val(Speed$(1))/1.609),"%2.1f")
    Speed$(2) = json$(W_fcst$,"list.main.dt_txt.speed")
    Speed$(2) = str$((val(Speed$(2))/1.609),"%2.1f")
    
    Direction$(0) = json$(W_now$,"deg")
    Direction$(1) = json$(W_fcst$,"deg")
    Direction$(2) = json$(W_fcst$,"list.main.dt_txt.deg")
        
    Temperature$(1) = json$(W_fcst$,"temp")
    Temperature$(1) = STR$ (val(Temperature$(1)) ,"%2.1f") 'round to single decimal   
    Temperature$(2) = json$(W_fcst$,"list.main.dt_txt.temp")
    Temperature$(2) = STR$ (val(Temperature$(2)) ,"%2.1f") 'round to single decimal
    
    Humidity$(0) = json$(W_now$,"humidity")   
    Humidity$(1) = json$(W_fcst$,"humidity")
    Humidity$(2) = json$(W_fcst$,"list.main.dt_txt.humidity")
    
    Pressure$(1) = json$(W_fcst$,"pressure")
    Pressure$(1) = str$((val(Pressure$(1))/33.864),"%2.1f") 'convert to inches of mercury
    Pressure$(2) = json$(W_fcst$,"list.main.dt_txt.pressure")
    Pressure$(2) = str$((val(Pressure$(2))/33.864),"%2.1f") 'convert to inches of mercury
      
    Icon$(0) = json$(W_now$,"icon")
    Icon$(1) = json$(W_fcst$,"icon")
    Icon$(2) = json$(W_fcst$,"list.main.dt_txt.icon")
    vga.copy 1, 0 , IconX1,IconY1,IconZ,IconZ 'clear the icon area back to original
    vga.copy 1, 0 , IconX2,IconY2,IconZ,IconZ 'clear the icon area back to original
    vga.image "/LCD_RGB/icons/" + Icon$(Col0) + "@2x.bmp", IconX1, IconY1
    vga.image "/LCD_RGB/icons/" + Icon$(Col1) + "@2x.bmp", IconX2, IconY2
        
  end if
  
  vga.text.align 4'Center
  vga.text.draw T_rise$,Clock_X-130,Clock_Y+FaceSize+15,TextFont'align to clock
  vga.text.draw T_set$,Clock_X+130,Clock_Y+FaceSize+15,TextFont 'align to clock
   
  vga.text.align 2'center right
  VGA.TEXT.COLOR col_text ,col_back
  vga.text.padding 110
  vga.text.draw Temperature$(Col0),CLx1+35,150,13
  vga.text.draw Temperature$(Col1),CLx2+35,150,13
  
  vga.text.draw Humidity$(Col0),CLx1+35,200,13
  vga.text.draw Humidity$(Col1),CLx2+35,200,13
  
  vga.text.draw Pressure$(Col0),CLx1+35,245,13
  vga.text.draw Pressure$(Col1),CLx2+35,245,13

  CLx=CLx1
  Col=Col0 'Update first compass
  Gosub Update_Compass

  CLx=CLx2
  Col=Col1 'Update second compass
  Gosub Update_Compass
   
  vga.show
   
return
'###############################################################################
Update_Compass:

  Angle = val(Direction$(Col))
  Angle = (angle + 90 + 180) mod 360 'adjust to suit compass
  Inner=Compass_S-34                 'start of pointer location
  Outer=Compass_S-12                 'tip of pointer

  CLy=Compass_Y
  D=9                                'Angular width of triangle
  TW=D*2*Pi*1/360             
  Rad=Angle*2*Pi*1/360
  A=Rad
  B=Rad+TW
  C=Rad-TW    
  X1=cos(a) * Outer+CLx              'Calculate coordinates for pointer
  Y1=sin(a) * Outer+CLy      
  X2=cos(b) * Inner+CLx
  Y2=sin(b) * Inner+CLy      
  X3=cos(c) * Inner+CLx
  Y3=sin(c) * Inner+CLy  
  
  VGA.CIRCLE CLx, Cly, Compass_S-12, col_Back ,1 'clear area
  vga.text.align 4
  vga.text.draw Speed$(Col),CLx,Compass_Y-12,12
  vga.text.draw "mph",CLx,Compass_Y+13,11
  VGA.TRIANGLE x1, y1, x2, y2, x3, y3, col_text ,1'draw the pointer

Return
'###################################################################################
Options:                                 'Set colours, size & locations
  Col_Back = tft.rgb(0,32,0)             'Background colour
  Col_Text = tft.rgb(255,255,128)        'Text colour
  Clock_X=595                            'Location for clock face center
  Clock_Y=245
  Filename$ = ""                         'If set, will load clockface image
  FaceSize = 190                         'Valid range 100 - 200
  TickLength = 12                        'Size of clock rim.
  FaceFont = 11                          'Font used for digits on dial
  TextFont = 11                          'Clock text font
  Width_S = 3                            'Second hand needle width
  Width_M = 5                            'Minute hand needle width
  Width_H = 7                            'Hour hand needle width
  Col_Face = tft.rgb(16,16,32)           'The dial colour
  Col_Digit = tft.rgb(255,255,255)       'colour of numbers around face
  Col_Ring = tft.rgb(0,0,255)            'Clock rim colour
  Col_Hand_H = tft.rgb(32,128,32)        'Hour hand colour
  Col_Hand_M = tft.rgb(240,240,32)       'Minute hand colour
  Col_Hand_S = tft.rgb(255,64,0)         'Second hand colour
  Col_Tick_Large = tft.rgb(255,255,255)  'Small tick colour
  Col_Tick_Small = tft.rgb(128,128,128)  'Large tick colour  
  vga.fill Col_Back                      'Clear the screen
Return
'###############################################################################
Init_LCD:
Num_Pages = 2 'Reserve two pages.
'Note: Config options module must be set to custom - No TFT
'SPI Pins: MOSI=11, MISO=13, SCLK=12
'TFT pins all set to -1 SDcard CS=10
'I2S pins BCLK=0, WSEL=18, DOUT=17
  vga.pinout 14, 21, 47, 48, 45, 9, 46, 3, 8, 16, 1, 15, 7, 6, 5, 4, 39, 40, 41, 42
  vga.delete 'Reclaim memory
  option.touch 1 'setup capacitive touch
  i2c.setup 19, 20
  touch.init 'initialise the capacitive touch
  vga.init 12, Num_Pages
  pwm.setup 2, 7, 128  'set backlight brightness 0-255
  tft.loadfont "/fonts/FreeMono9pt7b.bin", 10
  tft.loadfont "/fonts/FreeSans12pt7b.bin", 11
  tft.loadfont "/fonts/FreeSans18pt7b.bin", 12
  tft.loadfont "/fonts/FreeSans24pt7b.bin", 13
Return
'###############################################################################
End
The fonts and icons required can be found in this thread in the Demo1 zip file.
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2063
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1360 times
Contact:

Re: Module ESP32-8048S070C

Post by cicciocb »

Thanks for the demo program.
Maybe you could simply draw the clock bezel as an image using a paint utility and then import as a bmp, but I understand that is more funny as you did :lol:
BeanieBots
Posts: 348
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 184 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Indeed, the original did just that.
I considered an image but doing it the hard way made it scaleable which would not be easy with an image. Maybe a bunch of images of different sizes.
Besides, I had fun doing it the way I did. Just about everything is configurable which I thought would be more useful (if not confusing) for others.
It also sets the groundwork for a general purpose gauge.
(in reality I could not make mind up what size or where!)

Thinking of what to do next?
Maybe a game or a graphing routine?

Any chance of having:-
VGA.LINE x1, y1, x2, y2, color [,thickness=1]
VGA.TRIANGLE x1, y1, x2, y2, x3, y3, color [,fill=1]
VGA.NEEDLE x, y, length, angle, color [,thickness=1]
for the regular TFT screens?

Does ONTOUCH work with this display? Every time I try it, the screen just has a hissy fit!
User avatar
cicciocb
Site Admin
Posts: 2063
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1360 times
Contact:

Re: Module ESP32-8048S070C

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Jan 23, 2024 6:13 pm Indeed, the original did just that.
I considered an image but doing it the hard way made it scaleable which would not be easy with an image. Maybe a bunch of images of different sizes.
Besides, I had fun doing it the way I did. Just about everything is configurable which I thought would be more useful (if not confusing) for others.
It also sets the groundwork for a general purpose gauge.
(in reality I could not make mind up what size or where!)

Thinking of what to do next?
Maybe a game or a graphing routine?

Any chance of having:-
VGA.LINE x1, y1, x2, y2, color [,thickness=1]
VGA.TRIANGLE x1, y1, x2, y2, x3, y3, color [,fill=1]
VGA.NEEDLE x, y, length, angle, color [,thickness=1]
for the regular TFT screens?

Does ONTOUCH work with this display? Every time I try it, the screen just has a hissy fit!
Yes, I'll try to do a global homogenization in the near future, having the same functions available for all the devices.
Can do a favor for me, resuming in a single post all the pending requests for the VGA (and TFT) ?

Thanks
BeanieBots
Posts: 348
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 184 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Having had considerable fun with this display, I got another one!
Sparked it up and the pre-installed demo all ran OK.
Loaded 1.52.1 CAN_DMT_VGA_HID_qio_opi_LFS plus the analogue code posted in this thread.
and.... nothing :cry:
The code appeared to be running OK, but no display.
Fiddled a lot, playing with IO and eventually found that the display would only work with pin(2)=1 and NO pwm.
On the first display, I can use pwm.out 7,N with N anything between 0 and 255 with the expected result.
With the second display, any value below 234 gives backlight off. It can only be on or off. Nothing between.
Also, on the config page, I can select ESP32-8048S070C as a module. This is not an option on the first module.
I have tried loading 1.51.9 but get the same results.
Any help would be appreciated because being able to dim the backlight is a really nice feature.
So far, I think everything else is as the first module. Including the salmon-pink red.

EDIT:
Knowing that changing the state of pin2 turned the display on and off, I figured it must be related to PWM.
Putting pin2 state in a tight loop of on and off gave the expected result but obviously, with flicker.
Tried lowering the frequency of pwm right down to 500Hz 8-bit and it works but anything below 64 is Off. 64-255 as expected.
This will have to be my workaround unless there is something I've missed.
User avatar
cicciocb
Site Admin
Posts: 2063
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1360 times
Contact:

Re: Module ESP32-8048S070C

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Feb 19, 2024 6:24 pm Having had considerable fun with this display, I got another one!
Sparked it up and the pre-installed demo all ran OK.
Loaded 1.52.1 CAN_DMT_VGA_HID_qio_opi_LFS plus the analogue code posted in this thread.
and.... nothing :cry:
The code appeared to be running OK, but no display.
Fiddled a lot, playing with IO and eventually found that the display would only work with pin(2)=1 and NO pwm.
On the first display, I can use pwm.out 7,N with N anything between 0 and 255 with the expected result.
With the second display, any value below 234 gives backlight off. It can only be on or off. Nothing between.
Also, on the config page, I can select ESP32-8048S070C as a module. This is not an option on the first module.
I have tried loading 1.51.9 but get the same results.
Any help would be appreciated because being able to dim the backlight is a really nice feature.
So far, I think everything else is as the first module. Including the salmon-pink red.

EDIT:
Knowing that changing the state of pin2 turned the display on and off, I figured it must be related to PWM.
Putting pin2 state in a tight loop of on and off gave the expected result but obviously, with flicker.
Tried lowering the frequency of pwm right down to 500Hz 8-bit and it works but anything below 64 is Off. 64-255 as expected.
This will have to be my workaround unless there is something I've missed.
I suppose that there is an H/W issue into your module.
Have you tried to lower more the PWM frequency ? (probably you must increase the resolution to reduce the frequency)
BeanieBots
Posts: 348
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 184 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Certainly a difference in the hardware.
pwm @ 200Hz, 8-bit resolution seems to work OK, but very strange behaviour at higher frequencies.
I will try and trace the board to see if it is a component issue or something else.
Something to look out for in case there are several versions of this board.
ramante67
Posts: 6
Joined: Sun Feb 25, 2024 6:18 pm

Re: Module ESP32-8048S070C

Post by ramante67 »

Hi @cicciocb,

I purchased the module, and it seems to be very affordable. However, I haven't been successful in running it using either Arduino IDE or the ESP-IDF VSCode extension. Unfortunately, all my attempts resulted in numerous errors. It's possible that the issue lies on my end, but I haven't been able to identify it yet.

On the other hand, Annex proved to be the most efficient and straightforward method for flashing the device. I truly appreciate both the well-organized structure and the ease of use that allowed me to run the demo applications successfully. My congratulations on your work!

However, I'm facing a challenge: the demo disappears from the screen after disconnecting the device from the USB port. What steps do I need to take to ensure the application continues to run even after disconnecting it from the computer? I apologize if this question seems obvious, but I'm new to this environment. Thank you so much for your assistance.
Post Reply