Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:48 02 Sep 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 : big ben clock problems

Author Message
oldtimer
Newbie

Joined: 02/12/2016
Location: Australia
Posts: 18
Posted: 06:19pm 04 Feb 2017
Copy link to clipboard 
Print this post

Hi to all

I have recently been trying to get Matherp,s Big Ben clock running on an explore 100 with the 5 inch lcd backpack - I have cut and pasted the associated code -which was attached to the post -"the impossible takes a little longer"- into MM EDIT- and also resized the bitmap image to 480 by 480 pixels on the SD card- when I run the program I first get a nice ,screen filling picture of the bitmap followed - a few seconds later - by a small red circle at the centre of the image - this also remains for a few seconds at which point the display degenerates into random horizontal and vertical lines and colours - the error message "read buffer is 93.12 -or 116.5- or some other random number - used" followed by "pin 30 is invalid"

is anyone able to suggest a possible fix to allow the beautiful Big Ben clock shown in the post -to display - complete with moving hands

Im new to this forum so not sure if my thanks to Panky and lew 247 for their help was directed to them

many thanks
 
oldtimer
Newbie

Joined: 02/12/2016
Location: Australia
Posts: 18
Posted: 08:27pm 04 Feb 2017
Copy link to clipboard 
Print this post

figured out the pin 30 problem- I didnd realise that the program was for the 64 pin chip - ive now changed the RD pin to 27 but still get the same error message "read buffer is 90 something % used" and the screen dissolving into a mass of horizontal and vertical lines after the bitmap display

would appreciate any helpful advice


 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10379
Posted: 10:30pm 04 Feb 2017
Copy link to clipboard 
Print this post

Are you using the 100-pin version of the CFunction which is on page 2 of the post?

This effect can actually now be done without a CFunction using the new BLIT and TRIANGLE commands in 5.3

Have a look at this code which does the Photo-realistic gauge demo without needing to use a CFunction

option explicit
option default none
'
const Y_top = 0 'Y coordinate of top of the image file on the screen
const X_left = 160 'X coordinate of left of the image file on the screen
const Y_point = 320 'Y coordinate of the centre of the pointer relative to the image top
const X_point = 240 'X coordinate of the centre of the pointer relative to the image left
'
const buffersize = 1000 'used to store the image data behind the pointer
dim integer buff(buffersize)
'
'
' Now we define the pointer as the X,Y coordinates of a number of triangles with the rotation point at 0,0
' It is simplest to define this in the 12-oclock position which means the Y-coordinates at the top of the pointer will be negative
' The order of data elements in the array is:
' t1x1,t1y1,t1x2,t1y2,t1x3,t1y3, t2x1,t2y1,t2x2,t2y2,t2x3,t2y3,...tntx1,tnty1,tntx2,tnty2,tntx3,tnty3
'
dim integer nt=4 'Number of triangles used to define the pointer
dim integer ptr(5,nt-1)=(-4,-35, -4,-130, 4,-35, -4,-130, 4,-130, 4,-35, -4,-35,-8,-35,-4,-130, 4,-35,8,-35,4,-130)
DIM INTEGER pcolour=rgb(171,52,32) 'define the colour of the pointer
const pivot=35 'diameter in pixels of the fulcrum of the pointer
'
dim integer xx0(nt-1),yy0(nt-1),xx1(nt-1),yy1(nt-1),xx2(nt-1),yy2(nt-1),tcol(nt-1)
dim integer i
dim integer x,y,w,h
'
cls
load image "rtecop8.bmp",X_left,Y_top
'
' demo code moving the pointer
dim float demoangle=-45
for i=0 to nt-1 'load the coordinate arrays
rotatetriangle(i,pcolour,demoangle,X_point+X_left,Y_point+Y_top,ptr(0,i),ptr(1,i),ptr(2,i),ptr(3,i),ptr(4,i),ptr(5,i)) 'rotate the pointer into the drawing array
next i
getlimits(x, y, w, h)
blit read #1, x, y, w, h
for i=0 to nt-1
triangle xx0(i), yy0(i), xx1(i), yy1(i), xx2(i), yy2(i), tcol(i),tcol(i)
next i


do
do
drawpointer(demoangle)
demoangle=demoangle+1
loop while demoangle <=45
do
drawpointer(demoangle)
demoangle=demoangle-1
loop while demoangle >=-45
loop
'
Sub drawpointer(angle as float)
local integer last_x=x, last_y=y, last_w=w, last_h=h, i
for i=0 to nt-1
rotatetriangle(i,pcolour,angle,X_point+X_left,Y_point+Y_top,ptr(0,i),ptr(1,i),ptr(2,i),ptr(3,i),ptr(4,i),ptr(5,i)) 'rotate the pointer into the drawing array
next i
getlimits(x, y, w, h)
do
i=getscanline()
loop while (i>409 or i<400)
blit WRITE #1, last_x, last_y, last_w, last_h
blit close #1
blit read #1, x, y, w, h
for i=0 to nt-1
triangle xx0(i), yy0(i), xx1(i), yy1(i), xx2(i), yy2(i), tcol(i),tcol(i)
next i
drawpivot
End Sub

'
' Routine to find the coordinates of the area to be saved by BLIT READ
'
sub getlimits(x as integer, y as integer, w as integer, h as integer)
Local integer i,max_x=0,min_x=MM.HRES,max_y=0,min_y=MM.VRES
for i=0 to nt-1
if(xx0(i)>max_x)then max_x=xx0(i)
if(xx1(i)>max_x)then max_x=xx1(i)
if(xx2(i)>max_x)then max_x=xx2(i)
if(xx0(i)<min_x)then min_x=xx0(i)
if(xx1(i)<min_x)then min_x=xx1(i)
if(xx2(i)<min_x)then min_x=xx2(i)
if(yy0(i)>max_y)then max_y=yy0(i)
if(yy1(i)>max_y)then max_y=yy1(i)
if(yy2(i)>max_y)then max_y=yy2(i)
if(yy0(i)<min_y)then min_y=yy0(i)
if(yy1(i)<min_y)then min_y=yy1(i)
if(yy2(i)<min_y)then min_y=yy2(i)
next i
x=min_x
y=min_y
w=max_x-min_x+1
h=max_y-min_y+1
end sub

sub rotatetriangle(n as integer, col as integer, angle as float, x as integer, y as integer, x0 as integer, y0 as integer, x1 as integer, y1 as integer, x2 as integer, y2 as integer)
local float sine=sin(rad(angle)),cosine=cos(rad(angle))
local integer x0a,y0a,x1a,y1a,x2a,y2a
x0a= x0*cosine - y0 * sine + x
y0a= y0*cosine + x0 * sine + y
x1a= x1*cosine - y1 * sine + x
y1a= y1*cosine + x1 * sine + y
x2a= x2*cosine - y2 * sine + x
y2a= y2*cosine + x2 * sine + y
xx0(n)=x0a
yy0(n)=y0a
xx1(n)=x1a
yy1(n)=y1a
xx2(n)=x2a
yy2(n)=y2a
tcol(n)=col
end sub
'
sub drawpivot() 'put anything you like here to draw the fulcrum as you wish
circle X_point+X_left,Y_point+Y_top,pivot,0,,,rgb(54,54,54)
circle X_point+X_left,Y_point+Y_top,pivot*0.9,0,,,rgb(43,43,43)
end sub


 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 12:08am 07 Feb 2017
Copy link to clipboard 
Print this post

Matherp
Is it possible to have two dials with the same centre point working independantly?

for example a thermometer dial showing both indoor and outdoor temp's at the same time but updating independantly? and with each having a different colour hand?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10379
Posted: 12:26am 07 Feb 2017
Copy link to clipboard 
Print this post

  Quote  Is it possible to have two dials with the same centre point working independantly?


Sounds like the hands of a clock Edited by matherp 2017-02-08
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 12:40am 07 Feb 2017
Copy link to clipboard 
Print this post

oh my god, how stupid am I...
Sorry I should have realised
 
TrevorH
Senior Member

Joined: 06/04/2018
Location: United Kingdom
Posts: 145
Posted: 10:53pm 09 Oct 2022
Copy link to clipboard 
Print this post

I am trying to get the above code to work on a Picomite with ssd1963 TFT.
I know this is an old topic but I wanted to create some large gauges that the pointer didn't wipe the background.
I get a "dimension" error at the line 'i=getscanline()'.
Was 'getscanline' only available on the 100+ where it works flawlessly, or is there an alternative?
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2679
Posted: 12:38am 10 Oct 2022
Copy link to clipboard 
Print this post

PicoMiteVGA manual

GETSCANLINE
This will report on the line that is currently being drawn on the VGA
monitor in the range of 0 to 525. This is irrespective of the current MODE.
Using this to time updates to the screen can avoid timing effects caused by
updates while the screen is being updated.
The first visible line will return a value of 0. Any line number above 479 is
in the frame blanking period.

But it isn't in the PicoMite LCD manual, so I guess it isn't implemented on LCDs.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 659
Posted: 08:10am 10 Oct 2022
Copy link to clipboard 
Print this post

getscanline isn't relivent to a LCD display, so won't be in that version of MMBasic, LCDs are not scanned, at least not in the sense of a monitor or TV screen, there is no update rate or frame rate, you simply send the appropriate graphics commands to the display and it displays what you or MMBasic have asked for.
Regards Kevin.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10379
Posted: 08:32am 10 Oct 2022
Copy link to clipboard 
Print this post

  Quote  getscanline isn't relivent to a LCD display, so won't be in that version of MMBasic, LCDs are not scanned, at least not in the sense of a monitor or TV screen,


Actually, they are scanned exactly like a television. Most LCD controllers have commands to allow you to read the scanline. However, this can only be done if you can read from the display in the first place. So in PicoMite terms this would be on displays that support BLIT. ILI9341, ILI9488 (possibly), and SSD1963 could be possible but this hasn't been implemented.



Edited 2022-10-10 18:39 by matherp
 
TrevorH
Senior Member

Joined: 06/04/2018
Location: United Kingdom
Posts: 145
Posted: 09:27am 10 Oct 2022
Copy link to clipboard 
Print this post

@matherp is there a way to read in the background portion without getscanline, I think when cfunctions were used the triangles functions had a read background ability.
For large gauges or clocks saving ALL the background is not possible (memory limitations).
 
TrevorH
Senior Member

Joined: 06/04/2018
Location: United Kingdom
Posts: 145
Posted: 10:37am 11 Oct 2022
Copy link to clipboard 
Print this post

My understanding of how displays work as in tv or vga regarding scanline is VERY limited, I have got the program working in a fashion by commenting out "i=getscanline" and setting "i=400". But the pointer is flickering, so I guess the scanline is fixing the time to write out the pointer and the blit background to make it smoother (it is a guess). is there another way to fix the flickering??
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 04:02pm 11 Oct 2022
Copy link to clipboard 
Print this post

Try this
I think it's when I had a clock with a weather readout on the bottom but I can't remember for sure
It was definitely using an SSD1963 display though
If it has the weather you can cut those bits out of the code and reposition/resize the hands


 '***Thanks to Matherp for his help with the hands***
 cls RGB(white)
 option explicit
 option default none
 dim integer buff(480*480*3/8-1)
 dim integer nt=4 'Number of triangles being updated
 dim integer xx0(nt-1),yy0(nt-1),xx1(nt-1),yy1(nt-1),xx2(nt-1),yy2(nt-1),tcol(nt-1),secs,mins,hours,first=1
 dim integer oldsecs,i
 DIM STRING q$=chr$(34)
 dim x$,z$,Temp$,Wind$,prob$,type$,summary$
 dim integer val1
 Dim INTEGER a(90000)
 DIM allObs$(16)
 SetTick 30000,weather,1 'every 15 minutes
 load image "4.bmp",0,0
 circle 240,240,238,3,1,RGB(black)
 blit read #1,0,0,480,480
 option autorefresh off
 FONT 4,2
 i = 0
 secs=val(right$(time$,2))
 mins=val(mid$(time$,4,2))
 hours=val(left$(time$,2)) mod 12
 Text 100,530, day$(now) , LB, 4, 2, RGB(BLACK),RGB(WHITE)      'Day
 Text 70,590, date$ , LB, 4, 2, RGB(BLACK),RGB(WHITE)           'Date
 weather
 do
   secs=val(right$(time$,2))
   mins=val(mid$(time$,4,2))
   hours=val(left$(time$,2)) mod 12
   if secs <> oldsecs then
     hands(secs,mins,hours,(MM.HRES\2-MM.HRES\12),MM.Hres\2, MM.HRES\2)
   end if mins = 0 and secs = 0
 elseif mins = 15 and secs = 0
 elseif mins = 30 and secs = 0
 elseif mins = 45 and secs = 0 then
   weather
   pause 500
 end if
 if time$ = "00:00:00" then
   Text 100,530, "          ") , LB, 4, 2, RGB(BLACK),RGB(WHITE)  'Clear Day
   Text 100,530, day$(now) , LB, 4, 2, RGB(BLACK),RGB(WHITE)      'Day
   Text 70,590, "          ", LB, 4, 2, RGB(BLACK),RGB(WHITE)     'Clear Date
   Text 70,590, date$ , LB, 4, 2, RGB(BLACK),RGB(WHITE)           'Date
   pause 950
 end if
 BOX 2, 620, 476, 175, 3, RGB(black)
 
 '    text i,650,x$
 '    text i+mm.fontwidth*len(z$),720,z$
 '    refresh
 '    i = i - 2
 '    if i < -mm.fontwidth*len(z$) then : i = 0 : endif
 '    text i,720,z$
 '    text i+mm.fontwidth*len(x$),720,x$
 '    refresh
 '    i = i - 2
 '    if i < -mm.fontwidth*len(x$) then : i = 0 : endif
 '
 
 oldsecs = secs
loop

end

sub weather
system "wget -q -O- "+q$+"https://swd.weatherflow.com/swd/rest/observations/station/10170?api_key=20c70eae-e62f-4d3b-b3a4-8586e90f3ac8"+q$,a()
pause 700
on error IGNORE
JSON$(a(),"obs[0].air_temperature")'time received

Temp$ = JSON$(a(),"obs[0].air_temperature")+"`C "
Wind$ = JSON$(a(),"obs[0].wind_avg")+"MPH "
'prob$ = JSON$(a(),"obs[0].air_temperature") 'rain
'type$ = JSON$(a(),"obs[0].air_temperature") 'rain
summary$ = JSON$(a(),"obs[0].uv")
Text 60,660, "                        ",LB, 4, 1, RGB(BLACK),RGB(WHITE)
Text 60,660, "Temperature "+ Temp$  , LB, 4, 1, RGB(BLACK),RGB(WHITE)
Text 60,700, "                        ",LB, 4, 1, RGB(BLACK),RGB(WHITE)
Text 60,700, "Windspeed "+ Wind$, LB, 4, 1, RGB(BLACK),RGB(WHITE)
Text 60,740, "                                        ",LB, 4, 1, RGB(BLACK),RGB(WHITE)
Text 60,740, "UV Index "+ summary$ , LB, 4, 1, RGB(BLACK),RGB(WHITE)
'val1 = val(prob$)
'val1 = val1 * 100
'print val1, "Val1"
'if val1 >= 1 then
' print val1
'  Text 60,780, "                                  ",LB, 4, 1, RGB(BLACK),RGB(WHITE)
'  Text 60,780, STR$(val1)+ "% chance of "+type$, LB, 4, 1, RGB(BLACK),RGB(WHITE)
'  elseif val1 < 1 then
'  Text 60,780, "                                  ",LB, 4, 1, RGB(BLACK),RGB(WHITE)
'end if
'print STR$(val1), "Val"
print Wind$
end sub



Sub hands(seconds As integer, minutes as integer,  hours as integer, size as integer, x as integer, y as integer)
Local integer x1,y1,x2,y2,x0,y0,i
local float angle=seconds*6
rotatetriangle(2,RGB(RED),angle,x,y,-3,50,3,50,-3,-size) 'make up the second hand with two triangles
rotatetriangle(3,RGB(RED),angle,x,y,3,-size,3,50,-3,-size)
angle=minutes*6 + seconds/10
rotatetriangle(0,RGB(black),angle,x,y,-size/20,0,size/20,0,0,-size*1.04) ' Minute hand
angle=hours*30 + minutes/2
rotatetriangle(1,RGB(black),angle,x,y,-size/20,0,size/20,0,0,-size*0.78) ' Hour hand
blit write #1,0,0
triangle xx0(), yy0(), xx1(), yy1(), xx2(), yy2()) ,tcol() ,tcol()
Circle x,y, size\16, 0, , rgb(red), rgb(red))
Circle x,y, size\20, 0, , 0, 0
Circle x,y, size\24, 0, , RGB(red), RGB(red)
refresh
End Sub

sub rotatetriangle(n as integer, col as integer, angle as float, x as integer, y as integer, x0 as integer, y0 as integer, x1 as integer, y1 as integer, x2 as integer, y2 as integer)
local float sine=sin(rad(angle)),cosine=cos(rad(angle))
local integer x0a,y0a,x1a,y1a,x2a,y2a
x0a= x0*cosine - y0 * sine + x
y0a= y0*cosine + x0 * sine + y
x1a= x1*cosine - y1 * sine + x
y1a= y1*cosine + x1 * sine + y
x2a= x2*cosine - y2 * sine + x
y2a= y2*cosine + x2 * sine + y
xx0(n)=x0a
yy0(n)=y0a
xx1(n)=x1a
yy1(n)=y1a
xx2(n)=x2a
yy2(n)=y2a
tcol(n)=col
end sub
[/q]
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 04:17pm 11 Oct 2022
Copy link to clipboard 
Print this post

This is Peter's post for an E100 with the clock working
from this thread

  matherp said  The attached definitely works on a E100 running latest firmware.
Load the code, then reset the CPU to execute the MM.STARTUP. Then RUN.
Alternatively save the CSUBS and MM.STARTUP in the library.

Either way setrd must be called from MM.startup before running the program and it can only be called once.

NB calls to RTC GETTIME are patched out as I don't have a clock attached



option explicit
option default none
const buffersize = 2500
dim integer buff(buffersize)
dim integer small,nt=4 'Number of triangles being updated
dim integer xx0(nt*2-1),yy0(nt*2-1),xx1(nt*2-1),yy1(nt*2-1),xx2(nt*2-1),yy2(nt*2-1),tcol(nt*2-1),secs,mins,hours,first=1
cls
small=mm.hres:if MM.VRES < small then small=mm.vres
'rtc gettime
settick 600000,timecorrect
load image "bigben.bmp",0,0
secs=val(right$(time$,2))
mins=val(mid$(time$,4,2))
hours=val(left$(time$,2))
do
 secs=val(right$(time$,2))
 mins=val(mid$(time$,4,2))
 hours=val(left$(time$,2))
 hands(secs,mins,hours,(small\2-small\12),small\2, small\2)
 do
 loop while val(right$(time$,2))=secs
loop
end
'
sub timecorrect
'  RTC gettime
end sub

Sub hands(seconds As integer, minutes as integer,  hours as integer, size as integer, x as integer, y as integer)  
   Local integer x1,y1,x2,y2,x0,y0,i
   local float angle=seconds*6
   rotatetriangle(2,RGB(RED),angle,x,y,-3,50,3,50,-3,-size) 'make up the second hand with two triangles
   rotatetriangle(3,RGB(RED),angle,x,y,3,-size,3,50,-3,-size)    
   angle=minutes*6 + seconds/10
   rotatetriangle(0,RGB(BLACK),angle,x,y,-size/15,0,size/15,0,0,-size*0.8)
   angle=hours*30 + minutes/2
   rotatetriangle(1,RGB(80,80,80),angle,x,y,-size/12,0,size/12,0,0,-size*0.5)
   if first then  
     i=triangles(nt, buff() , tcol(nt), xx0(nt), yy0(nt), xx1(nt), yy1(nt), xx2(nt), yy2(nt))  
     print "Read buffer is ",i/buffersize*100,"% used"
     first=0
   else
     i=triangles(nt*2, buff() , tcol(), xx0(), yy0(), xx1(), yy1(), xx2(), yy2())  
   endif
   Circle x,y, size\12, 0, , rgb(red), rgb(red))  
   Circle x,y, size\15, 0, , 0, 0  
   Circle x,y, size\20, 0, , RGB(gray), RGB(gray)  
End Sub    

sub rotatetriangle(n as integer, col as integer, angle as float, x as integer, y as integer, x0 as integer, y0 as integer, x1 as integer, y1 as integer, x2 as integer, y2 as integer)
  local float sine=sin(rad(angle)),cosine=cos(rad(angle))
  local integer x0a,y0a,x1a,y1a,x2a,y2a
  x0a= x0*cosine - y0 * sine + x
  y0a= y0*cosine + x0 * sine + y
  x1a= x1*cosine - y1 * sine + x
  y1a= y1*cosine + x1 * sine + y
  x2a= x2*cosine - y2 * sine + x
  y2a= y2*cosine + x2 * sine + y
  xx0(n)=xx0(n+nt)
  yy0(n)=yy0(n+nt)
  xx1(n)=xx1(n+nt)
  yy1(n)=yy1(n+nt)
  xx2(n)=xx2(n+nt)
  yy2(n)=yy2(n+nt)
  xx0(n+nt)=x0a  
  yy0(n+nt)=y0a
  xx1(n+nt)=x1a  
  yy1(n+nt)=y1a  
  xx2(n+nt)=x2a  
  yy2(n+nt)=y2a  
  tcol(n)=-1  
  tcol(n+nt)=col
end sub

CFunction triangles
   00000267
   'defineregion
   3C029D00 8C420090 24080100 3C03BF88 AC686434 80420015 2488FFFF 24A3FFFF
   01064021 24060001 10460004 00671821 24060003 14460005 3C029D00 00805821
   01005021 10000008 00602021 8C420094 00605821 00A05021 8C430000 2463FFFF
   00682823 00642023 000B6202 000A4202 3C02BF88 24060200 24090100 00053A02
   00041A02 35080300 358C0300 356B0300 240D022A AC4D6430 354A0300 AC466434
   34E70300 AC466438 34A50300 AC496438 34630300 AC4C6430 34840300 AC466434
   AC466438 AC4B6430 AC466434 AC466438 AC486430 2408022B AC466434 AC466438
   AC4A6430 AC466434 AC466438 AC496434 AC486430 AC466434 AC466438 AC496438
   AC476430 AC466434 AC466438 AC456430 AC466434 AC466438 AC436430 AC466434
   AC466438 AC446430 AC466434 AC466438 03E00008 00000000
   'writeRectangle
   27BDFFD8 AFB40020 AFB3001C 00C0A021 00E09821 72749802 AFB00010 8FB00038
   AFB20018 AFB10014 00109403 00108A03 AFBF0024 0411FFA4 00000000 3C02BF88
   24030100 24040200 2405022C AC436434 36520300 AC456430 36310300 AC446434
   36100300 AC446438 AC436438 1260000F 2673FFFF 24030200 2404FFFF 2673FFFF
   AC526430 AC436434 AC436438 AC516430 AC436434 AC436438 AC506430 AC436434
   AC436438 1664FFF6 2673FFFF 8FBF0024 8FB40020 8FB3001C 8FB20018 8FB10014
   8FB00010 03E00008 27BD0028
   'ReadRectangle
   27BDFFC8 AFBF0034 AFBE0030 AFB7002C AFB60028 AFB50024 AFB40020 AFB3001C
   AFB20018 3C139D00 AFB10014 AFB00010 8E630090 0080B021 8E620028 8064002D
   00C0A821 00E0F021 00A0B821 0040F809 8FB10048 8E640090 8E630024 24050006
   8084002D 24100001 0060F809 00508004 8E630090 00409021 8E620024 8064002D
   24050005 0040F809 0015A040 0295A021 00409821 729E1002 02C02021 02E02821
   02A03021 03C03821 0051A021 0411FF53 00000000 3C05BF88 24060100 ACA66434
   8FA3004C 24070200 2402022E ACA26430 ACA76434 ACA76438 ACA66438 240600FF
   00711821 3C02BF81 3C04BF88 ACA6641C AE700000 8C45F220 8C45F220 8C45F220
   AE500000 8C866420 26310003 0234282B A0660000 AE700000 8C46F220 8C46F220
   8C46F220 AE500000 8C866420 A0660001 AE700000 8C46F220 8C46F220 8C46F220
   AE500000 8C866420 A0660002 14A0FFE8 24630003 3C02BF88 240300FF AC43641C
   8FBF0034 02201021 8FBE0030 8FB7002C 8FB60028 8FB50024 8FB40020 8FB3001C
   8FB20018 8FB10014 8FB00010 03E00008 27BD0038
   'RestoreRectangle
   27BDFFE0 AFB20018 AFB10014 00C09021 00E08821 72328802 AFB00010 AFBF001C
   8FB00030 0411FF10 00000000 3C02BF88 24030100 24040200 2405022C AC436434
   AC456430 AC446434 AC446438 AC436438 1220001D 2631FFFF 8FA40034 02202821
   00902021 24030200 2407FFFF 80860000 24A5FFFF 34C60300 AC466430 AC436434
   AC436438 80860001 34C60300 AC466430 AC436434 AC436438 80860002 24840003
   34C60300 AC466430 AC436434 AC436438 54A7FFEF 80860000 00111040 26100003
   00518821 02118021 8FBF001C 02001021 8FB20018 8FB10014 8FB00010 03E00008
   27BD0020
   'triangles
   27BDFFA8 AFB20038 8FA3006C 00809021 8FA40074 AFBE0050 AFB7004C 0083102A
   AFB3003C AFB10034 AFBF0054 AFB60048 AFB50044 AFB40040 AFB00030 00A09821
   00C0B821 AFA70064 8FB10068 10400006 8FBE007C 02201021 AFA4006C 8FB10070
   AFA30074 AFA20070 8FA30074 03C3102A 10400009 8FA6006C 8FA20070 8FA40078
   AFBE0074 AFA20078 AFA40070 0060F021 8FA6006C 8FA30074 0066102A 50400008
   8FA6006C 8FA40074 02201021 AFA60074 8FB10070 AFA4006C AFA20070 8FA6006C
   14DE0036 8FA30074 8FA30070 0071102A 14400006 02203821 0223102A 10400005
   8FA40078 10000002 8FA70070 8FB10070 8FA40078 0091102A 54400003 8FB10078
   00E4102A 0082380B 1640000C 24020001 8FA5006C 24E70001 02202021 24060001
   00F13823 AFB30010 AFB70014 0411FF16 00000000 100000B0 00409821 1642000C
   8FA20064 8FA5006C 24E70001 02202021 24060001 00F13823 AFB30010 AFB70014
   0411FF6E 00000000 100000A3 00409821 8FA5006C 24E70001 02202021 24060001
   00F13823 AFA20010 AFB70014 0411FECB 00000000 10000099 8FBF0054 8FA4006C
   007E1026 0002102B 00621023 AFA20020 0044102A 14400044 00808021 8FA60070
   8FA20078 00641823 00D13023 00511023 03C42023 AFA60024 AFA20028 0000A021
   0000A821 AFA30018 AFA4001C 24160001 8FA40018 8FA6001C 02002821 02A4001A
   008001F4 02C03821 00001012 00511021 0286001A 00C001F4 00001812 00711821
   0062302A 10C00003 00402021 00601021 00801821 24660001 00402021 16400009
   00C23023 02002821 02C03821 AFB30010 AFB70014 0411FECC 00000000 10000012
   00409821 5656000C 8FA20064 24630001 00402021 02002821 00623023 02C03821
   AFB30010 AFB70014 0411FF24 00000000 10000005 00409821 AFB70014 AFA20010
   0411FE86 00000000 8FA30020 8FA40024 8FA60028 26100001 0070102A 02A4A821
   1040FFCB 0286A021 03D0102A 1440004A 8FA30070 8FA20078 8FA40074 8FA60078
   00431023 AFA20024 8FA2006C 0204A023 00D13023 0202A823 8FA20024 70D5A802
   03C41823 8FA4006C AFA60020 AFA30018 03C42023 AFA4001C 24160001 7054A002
   8FA40018 8FA6001C 02002821 0284001A 008001F4 8FA40070 02C03821 00001012
   00441021 02A6001A 00C001F4 00001812 00711821 0062202A 10800003 00403021
   00601021 00C01821 24660001 00402021 16400009 00C23023 02002821 02C03821
   AFB30010 AFB70014 0411FE7F 00000000 10000012 00409821 5656000C 8FA20064
   24630001 00402021 02002821 00623023 02C03821 AFB30010 AFB70014 0411FED7
   00000000 10000005 00409821 AFB70014 AFA20010 0411FE39 00000000 8FA30024
   8FA40020 26100001 03D0102A 0283A021 1040FFCB 02A4A821 8FBF0054 02601021
   8FBE0050 8FB7004C 8FB60048 8FB50044 8FB40040 8FB3003C 8FB20038 8FB10034
   8FB00030 03E00008 27BD0058
   'gettearscanline
   27BDFFE0 AFBF001C AFB20018 AFB10014 AFB00010 3C109D00 8E030090 8E020028
   0040F809 8064002D 8E030090 00409021 8E020024 8064002D 0040F809 24050006
   8E030090 00408821 8E020024 8064002D 0040F809 24050005 24040001 3C03BF88
   02449004 24060100 24070200 240500FF 24080245 AC666434 3C04BF81 AC686430
   AC676434 AC676438 AC666438 AC65641C AC520000 8C86F220 8C86F220 8C86F220
   8C86F220 AE320000 8C666420 AC520000 8C82F220 8C82F220 8C82F220 8C82F220
   AE320000 8C626420 AC65641C 8FBF001C 30C400FF 00042200 304200FF 00821025
   8FB20018 8FB10014 8FB00010 03E00008 27BD0020
   'main
   27BDFFB0 AFBE0048 AFB70044 AFB60040 8FBE0068 8FB7006C 8FB60070 AFB5003C
   AFB40038 AFB1002C AFBF004C AFB30034 AFB20030 AFB00028 00808821 00A0A821
   AFA60058 00E0A021 0411FFB0 00000000 2442FE70 2C42000A 1040FFFB 00000000
   8E220000 184000A0 00008021 8FA20058 8C440004 04810025 8C470000 8FB20058
   00001821 00001021 00008021 8FA40060 8FA50064 02834821 00834021 00A33021
   02E32021 03C32821 02C31821 8D2C0000 8D0B0000 8CCA0000 8CA90000 8C880000
   8C630000 24040001 00402821 02A03021 AFA30024 AFAC0010 AFAB0014 AFAA0018
   AFA9001C AFA80020 0411FE7D 00000000 8E240000 26100001 0204202A 1480000E
   001018C0 1000006A 00001021 8FA40058 001018C0 00831021 8C440004 8C470000
   0480002A 00001021 26120001 001290C0 10000007 02009821 8E44000C 8E470008
   0480FFD2 26520008 1000FFF1 8FA40058 8FA50060 8FA40064 02834821 00A34021
   00833021 03C32821 02E32021 02C31821 8D2C0000 8D0B0000 8CCA0000 8CA90000
   8C880000 8C630000 00002021 00402821 02A03021 AFA30024 AFAC0010 AFAB0014
   AFAA0018 AFA9001C AFA80020 0411FE4C 00000000 8E240000 8FA50058 26730001
   0264202A 1480000D 00B21821 8E230000 0203182A 10600036 8FA40058 001018C0
   00832821 8CA40004 04800031 8CA70000 26120001 10000008 001290C0 8C640004
   26450008 0480FFF1 8C670000 02401821 1000FFCF 00A09021 8FA50060 8FA40064
   02834821 00A34021 00833021 03C32821 02E32021 02C31821 8D2C0000 8D0B0000
   8CCA0000 8CA90000 8C880000 8C630000 24040002 00402821 02A03021 AFA30024
   AFAC0010 AFAB0014 AFAA0018 AFA9001C AFA80020 0411FE1A 00000000 8E240000
   8FA50058 26100001 0204202A 10800008 00B21821 8C640004 26450008 04800004
   8C670000 02401821 1000FFDB 00A09021 8FBF004C 00021FC3 8FBE0048 000210C3
   8FB70044 8FB60040 8FB5003C 8FB40038 8FB30034 8FB20030 8FB1002C 8FB00028
   03E00008 27BD0050 1000FFF1 00001021
End CFunction

sub mm.startup
 setrd(6) 'set up the pin connected to RD
end sub

Csub setrd
   00000000
   27BDFFE8 AFBF0014 AFB00010 3C109D00 8C830000 8E020090 24050008 00003021  
   A043002D 8E030090 8E020010 0040F809 8064002D 8E030090 8E020010 24050065  
   8064002D 0040F809 00003021 8E030090 8E02001C 24050006 0040F809 8064002D  
   8FBF0014 8FB00010 03E00008 27BD0018  
End Csub

Edited 2022-10-12 02:18 by lew247
 
TrevorH
Senior Member

Joined: 06/04/2018
Location: United Kingdom
Posts: 145
Posted: 05:05pm 11 Oct 2022
Copy link to clipboard 
Print this post

Hi lew, thanks for replying to my queries.
Your first post ie the weather program won't work as the Pico has not enough memory available in one slot for the very large buffer (unless you know how to use 2nd slot for a buffer).
The E100 has bigger memory available for one program.
Your second post is using cfunctions which are not available on the Pico (yet).

The program I was playing with was put together by Peter to use the new triangles function and NO cfunctions, it cleverly reads the background to be replaced when the pointer has moved, but does use getscanline (not implemented on Pico) to avoid flickering. I don't understand how getscanline achieves this non-flickering.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4068
Posted: 05:33pm 11 Oct 2022
Copy link to clipboard 
Print this post

  TrevorH said  Your second post is using cfunctions which are not available on the Pico (yet).

Er... I think they are.

John
 
TrevorH
Senior Member

Joined: 06/04/2018
Location: United Kingdom
Posts: 145
Posted: 11:09pm 11 Oct 2022
Copy link to clipboard 
Print this post

Hi John, thanks for your input, I'm a bit late to the Pico party and as such had not seen the thread on Csubs.
 
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