如何使用arduino提取网页中的图片并显示在自己的网页上

如何使用arduino提取网页中的图片并显示在自己的网页上,第1张

使用arduino提取网页中的图片并显示在自己的网页上的方法:

1、设置screen.image(image, xPos, yPos)的参数:

image : a named instance of PImage.

xPos : int, location on the x-axis to start drawing

yPos : int, location on the y-axis to start drawing

2、举例说明:

PImage logo

void setup() {

// initialize the screen

EsploraTFT.begin()

// initialize the SD card

SD.begin(SD_CS)

// set the background the black

EsploraTFT.background(0, 0, 0)

// load the image into the named instance of PImage

logo = EsploraTFT.loadImage("arduino.bmp")

// if it is a valid image file, turn the Esplora's LED green

if (logo.isValid()) {

Esplora.writeGreen(255)

}

else{

// if it is not valid, turn the LED red

Esplora.writeRed(255)

}

// draw the image on the screen starting at the top left corner

EsploraTFT.image(logo, 0, 0)

}

void loop() {

//循环处理另一个网页上的图片,存放到本网页的固定位置

}

// the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin 13 as an output.

pinMode(13, OUTPUT)

}

// the loop function runs over and over again forever

void loop() {

digitalWrite(13, HIGH) // turn the LED on (HIGH is the voltage level)

delay(1000) // wait for a second

digitalWrite(13, LOW) // turn the LED off by making the voltage LOW

delay(1000) // wait for a second

}


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/11340254.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-15
下一篇2023-05-15

发表评论

登录后才能评论

评论列表(0条)

    保存