Posted: 04:53pm 25 Mar 2023 |
Copy link to clipboard |
Print this post |
|
Hello,
I am trying to understand the framebuffer and simply don't get it. All I want to do is this example Peter showed on YouTube (https://www.youtube.com/watch?v=dLk7JgB3YCY), where he has a background image and a moving sine wave on the top layer.
The manual is good, but does not help how to begin with.
I think first of all I have to load my desired image
load image "grid"
Then create a framebuffer with
framebuffer create
now (in my mind) I've created a framebuffer with my background image "grid"
Then I want to put my moving sine function on top of that with
framebuffer layer
Because the manual says: "Allocates 38400 bytes of variable memory to a second display layer. This layer sits on top of the main display." So exactly what I want. now I am drawing my moving sine wave on top, but nothing works the screen goes black.
This is always my problem with complex commands, I read the manual, but I don't know how to start at all. Is there anywhere Peters YouTube example of it? I've looked at Martins framebuffer examples with sprites but they are all too complex to begin with.
My final application is my ECG, which works good but needs some grid in the background and I thought it would be much better with framebuffer than drawing horzontal and vertical lines.
This is my ECG, which works good so far, but a background grid would be much nicer.
SetTick 10, ekg_interrupt 'Abtastrate 100Hz SetPin GP28, AIN SetPin GP25, DOUT Font 2,1 CLS c RTC gettime
'Tiefpass a0t = 0.1565712872 a1t = 0.2651425745 a2t = 0.1565712872 b1t = -0.5695259524 b2t = 0.1958111014
'Notch a0n = 0.7857841106 a1n = -8.4007020142E-16 a2n = 0.7857841106 b1n = -8.4007020142E-16 b2n = 1.1915682213
Do If x>MM.HRes Then x=-1 'Save image "bild.bmp" EndIf Loop
ekg_interrupt: 'Show Time Text 120,210,Time$ 'Increment x=x+1 ekg = Pin(GP28) 'Filter 1 sn_2 = s_n1 s_n1 = s_n s_n = ekg g_n2 = g_n1 g_n1 = g_n g_n = s_n*a0t+s_n1*a1t+s_n2*a2t+g_n1*b1t+g_n2*b2t ekg = g_n 'Filter 2 sn_2 = s_n1 s_n1 = s_n s_n = ekg g_n2 = g_n1 g_n1 = g_n g_n = s_n*a0n+s_n1*a1n+s_n2*a2n+g_n1*b1n+g_n2*b2n ekg = g_n 'Drawing Line x,0,x+1,MM.HRes,1,BF Line x-1,ekg_alt*140,x,ekg*140,1 ekg_alt = ekg IReturn
Greetings Daniel Edited 2023-03-26 03:08 by Amnesie |