“Matrix.print()”的版本间的差异
第178行: | 第178行: | ||
</source> | </source> | ||
<p style="color: #E87E05;font-size:135%">其他</p> | <p style="color: #E87E05;font-size:135%">其他</p> | ||
− | |||
*[[Matrix.getHeight()|getHeight()]] | *[[Matrix.getHeight()|getHeight()]] | ||
*[[Matrix.getWidth()|getWidth()]] | *[[Matrix.getWidth()|getWidth()]] | ||
+ | *[[Matrix.setBrightness()|setBrightness()]] | ||
*[[Matrix.setLed()|setLed()]] | *[[Matrix.setLed()|setLed()]] | ||
+ | *[[Matrix.clearDisplay()|clearDisplay()]] | ||
*[[Matrix.setColor()|setColor()]] | *[[Matrix.setColor()|setColor()]] | ||
*[[Matrix.drawLine()|drawLine()]] | *[[Matrix.drawLine()|drawLine()]] | ||
第189行: | 第190行: | ||
*[[Matrix.drawRFrame()|drawRFrame()]] | *[[Matrix.drawRFrame()|drawRFrame()]] | ||
*[[Matrix.drawCircle()|drawCircle()]] | *[[Matrix.drawCircle()|drawCircle()]] | ||
− | *[[Matrix.drawDisc()|drawDisc()]] | + | *[[Matrix.drawDisc()|drawDisc()]] |
*[[Matrix.writeString()|writeString()]] | *[[Matrix.writeString()|writeString()]] | ||
*[[Matrix.drawBMP()|drawBMP()]] | *[[Matrix.drawBMP()|drawBMP()]] |
2017年7月27日 (四) 04:59的最新版本
Matrix.print(character)
描述 用来在屏上静态显示字符。print()必须配合 参数 character:需要显示的字符,可是字符、字符串、数字。 返回值 无 示例
#include <Microduino_Matrix.h>
uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { //1x1
{64} //点阵IIC地址
};
Matrix display = Matrix(Addr, TYPE_COLOR); //TYPE_COLOR or TYPE_S2
void setup() {
Wire.begin();
display.setBrightness(255);
display.clearDisplay();
}
void loop() {
// Print
display.setColor(0, 255, 0);
display.setCursor(2, 0); //x, y
display.print("m");
delay(1000);
display.clearDisplay();
display.setColor(0, 255, 255);
display.setCursor(2, 0); //x, y
display.print("u");
delay(1000);
display.clearDisplay();
}
#include <Microduino_Matrix.h>
uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { //1x1
{64} //点阵IIC地址
};
Matrix display = Matrix(Addr, TYPE_COLOR); //TYPE_COLOR or TYPE_S2
void setup() {
Wire.begin();
display.setBrightness(255);
}
void loop() {
// Print
display.setColor(255, 0, 255);
for(int=0; i < 10; i++)
{
display.setCursor(1, 0); //x, y
display.print(i);
delay(500);
}
display.clearDisplay();
}
#include <Microduino_Matrix.h>
uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { //1x1
{64} //点阵IIC地址
};
Matrix display = Matrix(Addr, TYPE_COLOR); //TYPE_COLOR or TYPE_S2
void setup() {
Wire.begin();
display.setBrightness(255);
}
void loop() {
// Print
display.setColor(0, 255, 0);
int i = display.getStringWidth("mCookie!");
for (int a = display.getWidth() * 8; a > -i - display.getWidth() * 8; a--) {
display.setCursor(a, 0); //x, y
display.print("mCookie!");
delay(120);
}
display.clearDisplay();
}
#include <Microduino_Matrix.h>
uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { //1x1
{64} //点阵IIC地址
};
Matrix display = Matrix(Addr, TYPE_S2); //TYPE_COLOR or TYPE_S2
void setup() {
Wire.begin();
display.setBrightness(255);
display.clearDisplay();
}
void loop() {
// Print
display.setCursor(2, 0); //x, y
display.print("m");
delay(1000);
display.clearDisplay();
display.setCursor(2, 0); //x, y
display.print("u");
delay(1000);
display.clearDisplay();
}
#include <Microduino_Matrix.h>
uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { //1x1
{64} //点阵IIC地址
};
Matrix display = Matrix(Addr, TYPE_S2); //TYPE_COLOR or TYPE_S2
void setup() {
Wire.begin();
display.setBrightness(255);
}
void loop() {
// Print
for(int i=0; i < 10; i++)
{
display.setCursor(1, 0); //x, y
display.print(i);
delay(500);
}
display.clearDisplay();
}
#include <Microduino_Matrix.h>
uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { //1x1
{64} //点阵IIC地址
};
Matrix display = Matrix(Addr, TYPE_S2); //TYPE_COLOR or TYPE_S2
void setup() {
Wire.begin();
display.setBrightness(255);
}
void loop() {
// Print
int i = display.getStringWidth("mCookie!");
for (int a = display.getWidth() * 8; a > -i - display.getWidth() * 8; a--) {
display.setCursor(a, 0); //x, y
display.print("mCookie!");
delay(120);
}
display.clearDisplay();
}
其他 |