
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 boardvoid 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
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)