Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:50 28 Nov 2024 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 : PicoMite demo on the Waveshare RP2040-LCD-1.28

     Page 2 of 2    
Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 05:49pm 04 Aug 2023
Copy link to clipboard 
Print this post

  lew247 said  Really stupid question (possibly)

but HOW do you load an image to the Picomite if you don't have an SD card attached?
Only the usb cable to the computer
I've been through the manual and all I can see is loading it from the SD card or xmodem send but it seems to only send to/from an sdcard

I need to send this file to the picomite  C:\Users\Lewis\Desktop\face.bmp

How can I do it?

I use MMEdit5 but I also have putty, Tera Term and so on


Type on on Picomite :  xmodem r "face.bmp"
then use Xmodem in your Terminal Program (for example TeraTerm) and send the File..



Firmware should be PicoMite MMBasic Version 5.07.07 or higher.
There the Flash is Drive A:
So you have a filesystem without SD Cars
Edited 2023-08-05 03:58 by Martin H.
'no comment
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 08:48pm 04 Aug 2023
Copy link to clipboard 
Print this post

As you use MMEdit, start the control centre (MMCC) and from there start the file manager from the 'mode' menu.
The rest should be reasonably obvious.

You will still be using XMODEM but without the hastle.

Jim
VK7JH
MMedit   MMBasic Help
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 10:29pm 04 Aug 2023
Copy link to clipboard 
Print this post

  lew247 said  HOW do you load an image to the Picomite if you don't have an SD card attached?


The PicoMite has a file system in flash (size 688KB), so you don't need an SD card unless you have more files than will fit.

XMODEM R "filename.jpg" works within teraterm. But if you're familiar with MMEdit, it may be easier for you to use that
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 06:48am 05 Aug 2023
Copy link to clipboard 
Print this post

Peter I'm getting this error:



This is the code

'PicoMite demo on the Waveshare RP2040-LCD-1.28 by Matherp

Option explicit
Option default none
'
Const Y_top = 0 'Y coordinate of top of the image file on the screen
Const X_left = 0 'X coordinate of left of the image file on the screen
Const s_Y_point = 172 'Y coordinate of the centre of the second hand relative to the image top
Const s_X_point = 119 'X coordinate of the centre of the second hand relative to the image left
Const h_Y_point = 119 'Y coordinate of the centre of the hour and minute hands relative to the image top
Const h_X_point = 120 'X coordinate of the centre of the hour and minute hands relative to the image top
Const sl=-30
Const ml=-100
Const hl=-75

'
'
'
' Now we define the pointers 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=6 'Number of triangles used to define the pointer
Dim integer x1(nt-1)=(-1,-1,-2,-2,-3,-3)
Dim integer y1(nt-1)=(0,0,0,0,0,0)
Dim integer x2(nt-1)=(-1,1,-2,2,-3,3)
Dim integer y2(nt-1)=(sl,sl,ml,ml,hl,hl)
Dim integer x3(nt-1)=(1,1,2,2,3,3)
Dim integer y3(nt-1)=(sl,0,ml,0,hl,0)
Dim INTEGER pcolour=RGB(Green) 'define the colour of the pointer
Const s_pivot=3, m_pivot=5, h_pivot=3 '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 first=1 'marker to control alternate processing on first time through the loop

'
FRAMEBUFFER create
FRAMEBUFFER layer
FRAMEBUFFER write l
CLS
Load image "face"
'
' demo code moving the pointer
Dim float secondangle=0, minuteangle=0, hourangle=0
Do
FRAMEBUFFER copy l,f
If secondangle Mod 60=0 Then Inc minuteangle,1
If (minuteangle Mod 72=0) And (secondangle Mod 60=0) Then Inc hourangle,6
drawpointer
FRAMEBUFFER copy f,n
Inc secondangle,6

Loop
'
Sub drawpointer
Local integer i,x,y
Local float angle
For i=0 To nt-1
 If i<2 Then
 x=s_X_point
 y=s_Y_point
 pcolour=RGB(green)
 angle=secondangle
 Else
 x=h_X_point
 y=h_Y_point
 pcolour=RGB(white)
 If i<4 Then
 angle=minuteangle
 Else
 angle=hourangle
 EndIf
 EndIf
 rotatetriangle(i,pcolour,angle,x+X_left,y+Y_top,x1(i),y1(i),x2(i),y2(i),x3(i),y3(i)) 'rotate the pointer into the drawing array
Next i
FRAMEBUFFER write f
Triangle xx0(), yy0(), xx1(), yy1(), xx2(), yy2(),tcol(),tcol()
drawpivot
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 in
teger, 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)=pcolour
End Sub
'
Sub drawpivot() 'put anything you like here to draw the fulcrum as you wish
Circle s_X_point+X_left,s_Y_point+Y_top,s_pivot,0,,,RGB(green)
Circle h_X_point+X_left,h_Y_point+Y_top,m_pivot,0,,,RGB(white)
Circle h_X_point+X_left,h_Y_point+Y_top,h_pivot,0,,,RGB(black)

End Sub

 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3803
Posted: 06:58am 05 Aug 2023
Copy link to clipboard 
Print this post

If the load image errors, maybe add .bmp to the name.

Line 80 looks too long.

John
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 07:49am 05 Aug 2023
Copy link to clipboard 
Print this post

  lew247 said  
but HOW do you load an image to the Picomite if you don't have an SD card attached?

The question has been answered. If you don't want to do it as described, I can't help you
'no comment
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 08:17am 05 Aug 2023
Copy link to clipboard 
Print this post

Line 80 has been split into two lines.
Join them together again and the line will be 182 characters long which is OK but not easy to LIST without setting the display nice and wide.

Jim
VK7JH
MMedit   MMBasic Help
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 11:48am 05 Aug 2023
Copy link to clipboard 
Print this post

  Martin H. said  
  lew247 said  
but HOW do you load an image to the Picomite if you don't have an SD card attached?

The question has been answered. If you don't want to do it as described, I can't help you


If you look at my screenshot you'll see I actually HAVE the image loaded
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 01:10pm 05 Aug 2023
Copy link to clipboard 
Print this post

  TassyJim said  Line 80 has been split into two lines.
Join them together again and the line will be 182 characters long which is OK but not easy to LIST without setting the display nice and wide.
Jim


Thanks Jim, I should have spotted that but didn't
 
     Page 2 of 2    
Print this page


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

© JAQ Software 2024