Car screen display control

1. Experimental purpose

Drive the car screen to display graphics and text

2. Experimental path source code

Enter the car system, end the car program, enter "ip (ip is the car's ip): 8888" in the browser, enter the password "yahboom" image-2024112100001 Then log in Enter the path of Rider-pi_class/2.Basic Control Ooperations/1.Small car screen display and run car lcd control.ipynb.

3. Experimental phenomenon

  1. Draw an oblique straight line image-2024112100002
  2. Draw a circle image-2024112100003
  3. Draw a rectangle image-2024112100004
  4. Display text image-2024112100005
  5. Display an image image-2024112100006

4. Analysis of main source code parameters

  1. Draw a straight line lcd_line(x1,y1,x2,y2,color=(r,g,b),width=width)
Parameter nameFormatInput rangeDescription
x1,y1,x2,y2Numberx1 x2:[0,320] y1 y2:[0,240]x1,y1 are the initial point x2,y2 are the end point coordinates
color (optional) defaults to whitergb tuplergb:[0,255]color is the line color
width (optional) defaults to 2Number/width is the line width
  1. Draw a circle lcd_round(center_x, center_y, radius, color=(255, 255, 255), width=2)
Parameter nameFormatInput rangeDescription
center_x, center_yNumbercenter_x:[0,320] center_y:[0,240]center_x, center_y are the coordinates of the center of the circle
raduiusNumber/raduius is the radius
color (optional) defaults to whitergb tuplergb:[0,255]color is the color
width (optional) defaults to 2Number/width is the arc width
  1. Draw a rectangle lcd_rectangle(x1,y1,x2,y2,fill=None,outline=(255,255,255),width=2)
Parameter nameFormatInput rangeDescription
x1,y1,x2,y2Numberx1 x2:[0,320] y1 y2:[0,240]x1,y1 are the initial point x2,y2 are the end point coordinates
fill (can be omitted) defaults to nonergb tuplergb:[0,255]fill is the fill color
outline (can be omitted) defaults to whitergb tuplergb:[0,255]outline is the line color
width (can be omitted) defaults to 2Number/width is the line width
  1. Display text lcd_text(x,y,content,color=(255,255,255),fontsize=15)
Parameter nameFormatInput rangeDescription
x,yNumberx y:[0,320]x,y are the initial points
contentstring/content is the display content
color (optional) defaults to whitergb tupler g b:[0,255]color is the text color
fontsize (optional) defaults to 15Number/fontsize is the font size
  1. Display pictures lcd_picture(filename)
Parameter nameFormatDescription
filenamestringThe picture file name needs to have a jpg extension, the picture file display path is /home/pi/xgoPictures, and the picture size is 320*240

If you want to display custom pictures, you need to put the pictures in the path of home/pi/xgoPictures.