本文整理汇总了C++中Adafruit_ST7735::setCursor方法的典型用法代码示例。如果您正苦于以下问题:C++ Adafruit_ST7735::setCursor方法的具体用法?C++ Adafruit_ST7735::setCursor怎么用?C++ Adafruit_ST7735::setCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adafruit_ST7735
的用法示例。
在下文中一共展示了Adafruit_ST7735::setCursor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show_tunestep
void show_tunestep(String S) { // show band
char string[80];
tft.fillRect(pos_x_tunestep, pos_y_tunestep, 60, 8, BLACK); // erase old string
tft.setTextColor(WHITE);
tft.setCursor(pos_x_tunestep, pos_y_tunestep);
tft.print(S);
}
示例2: drawGUI
void drawGUI() {
tft.fillScreen(ST7735_BLACK);
tft.setCursor(0,70);
dualPrint("Play a game?");
dualPrint("<Press Joystick>");
lcd_image_draw(&logoImage, &tft, 0, 0, 30, 10, 100, 50);
}
示例3: intro_display
void intro_display(void) {
tft.setFont(&FreeSans12pt7b);
tft.setTextColor(WHITE);
tft.setTextWrap(true);
tft.setCursor(0, 30);
tft.print("Teensy SDR");
tft.setFont(&FreeSans9pt7b);
tft.setCursor(0, 50);
tft.print("by VE3MKC");
tft.setCursor(0, 80);
tft.print("PA3BYA");
tft.setCursor(0, 100);
tft.print("version: ");
tft.print(MAIN_VERSION_NUMBER);
tft.setCursor(0, 120);
tft.print("build: ");
tft.print(__DATE__);
}
示例4: displayGrid
void displayGrid() {
tft.fillScreen(0x0000); // clear the screen with black
tft.setCursor(0,0); // set the cursor, indicates where to display
tft.setTextWrap(false); // no wrap
tft.print("\n THREES! PUZZLE GAME \n\n");
tft.print(" SCORE: ");
tft.print(score);
tft.print("\n");
if (plus) {
tft.print(" +");
tft.print(plus);
tft.print("\n\n");
}
else {
tft.print(" ");
tft.print("\n\n");
}
for(int i=0;i<4;i++) {
tft.print(" |");
for(int j=0;j<4;j++) {
if(grid[i][j]) {
// use sapce " " to make the interface clear since a number with more digits occupies more space
if(grid[i][j] < 10) {
tft.print(" ");
tft.print(grid[i][j]);
tft.print(" |");
}
else if (grid[i][j] >= 10 && grid[i][j] < 100) {
tft.print("");
tft.print(grid[i][j]);
tft.print(" |");
}
else {
tft.print("");
tft.print(grid[i][j]);
tft.print("|");
}
}
else {
tft.print(" ");
tft.print(" ");
tft.print(" |");
}
}
tft.print("\n\n");
}
}
示例5: initialize_screen
void initialize_screen() {
tft.initR(INITR_REDTAB);
tft.setRotation(0);
tft.setCursor(0, 0);
tft.setTextColor(0x0000);
tft.setTextSize(1);
tft.fillScreen(BLUE);
}
示例6: show_radiomode
// show radio mode
void show_radiomode(String mode, boolean highlight) {
tft.fillRect(106, 108, 54, 18, BLACK); // erase old string
tft.setFont(&FreeSans9pt7b);
if (highlight) {
tft.setTextColor(YELLOW);
} else {
tft.setTextColor(WHITE);
}
tft.setCursor(106, 125);
tft.print(mode);
}
示例7: show_bandfilter
void show_bandfilter(String bandfiltername, boolean highlight) { // show band
tft.fillRect(0, 108, 40, 18, BLACK); // erase old string
tft.setFont(&FreeSans9pt7b);
if (highlight) {
tft.setTextColor(YELLOW);
} else {
tft.setTextColor(WHITE);
}
tft.setCursor(0, 125);
tft.print(bandfiltername);
}
示例8: snake
// Printing
// To print snake main display
void snake() {
// printing to the screen
tft.fillScreen(BLACK);
tft.fillRoundRect(14,20,100,40,5,CYAN);
// where the characters will be displayed
tft.setCursor(20, 30);
tft.setTextColor(BLACK);
tft.setTextSize(3);
tft.setTextWrap(true);
tft.print("SNAKE");
}
示例9: countdown
// shows a countdown on the screen to the start of the game
void countdown()
{
for(int i=0;i<5;i++)
{
tft.fillScreen(BLACK);
tft.setTextSize(4);
tft.setCursor(srcWidth/2 - 10, srcHeight/2-10);
tft.print(5-i);
delay(1000);
}
tft.setTextSize(1);
}
示例10: setup_display
void setup_display(void) {
// initialize the LCD display
// tft.init();
// tft.initR(INITR_BLACKTAB); // initialize a S6D02A1S chip, black tab
tft.setRotation(1);
tft.fillScreen(BLACK); //BLACK);
//tft.fillRect(0, pos, 160, 128-pos, BLACK); // erase old string
tft.setCursor(0, 119);
tft.setTextColor(WHITE);
tft.setTextWrap(true);
// tft.print("DD4WH SDR 5.00");
// Show mid screen tune position
tft.drawFastVLine(pos_centre_f, 0,pos+1, RED); //WHITE);
// tft.drawFastHLine(0, pos,79, YELLOW);// WHITE);
//tft.drawFastHLine(81, pos,79, YELLOW);
// draw S-Meter layout
tft.drawFastHLine (pos_x_smeter, pos_y_smeter-1, 9*s_w, WHITE);
tft.drawFastHLine (pos_x_smeter, pos_y_smeter+3, 9*s_w, WHITE);
tft.fillRect(pos_x_smeter, pos_y_smeter-3, 2, 2, WHITE);
tft.fillRect(pos_x_smeter+8*s_w, pos_y_smeter-3, 2, 2, WHITE);
tft.fillRect(pos_x_smeter+2*s_w, pos_y_smeter-3, 2, 2, WHITE);
tft.fillRect(pos_x_smeter+4*s_w, pos_y_smeter-3, 2, 2, WHITE);
tft.fillRect(pos_x_smeter+6*s_w, pos_y_smeter-3, 2, 2, WHITE);
tft.fillRect(pos_x_smeter+7*s_w, pos_y_smeter-4, 2, 3, WHITE);
tft.fillRect(pos_x_smeter+3*s_w, pos_y_smeter-4, 2, 3, WHITE);
tft.fillRect(pos_x_smeter+5*s_w, pos_y_smeter-4, 2, 3, WHITE);
tft.fillRect(pos_x_smeter+s_w, pos_y_smeter-4, 2, 3, WHITE);
tft.fillRect(pos_x_smeter+9*s_w, pos_y_smeter-4, 2, 3, WHITE);
tft.drawFastHLine (pos_x_smeter+9*s_w, pos_y_smeter-1, 3*s_w*2+2, GREEN);
tft.drawFastHLine (pos_x_smeter+9*s_w, pos_y_smeter+3, 3*s_w*2+2, GREEN);
tft.fillRect(pos_x_smeter+11*s_w, pos_y_smeter-4, 2, 3, GREEN);
tft.fillRect(pos_x_smeter+13*s_w, pos_y_smeter-4, 2, 3, GREEN);
tft.fillRect(pos_x_smeter+15*s_w, pos_y_smeter-4, 2, 3, GREEN);
tft.drawFastVLine (pos_x_smeter-1, pos_y_smeter-1, 5, WHITE);
tft.drawFastVLine (pos_x_smeter+15*s_w+2, pos_y_smeter-1, 5, GREEN);
tft.setCursor(pos_x_smeter - 4, pos_y_smeter - 13);
tft.setTextColor(WHITE);
tft.setTextWrap(true);
tft.print("S 1");
tft.setCursor(pos_x_smeter + 28, pos_y_smeter - 13);
tft.print("3");
tft.setCursor(pos_x_smeter + 48, pos_y_smeter - 13);
tft.print("5");
tft.setCursor(pos_x_smeter + 68, pos_y_smeter - 13);
tft.print("7");
tft.setCursor(pos_x_smeter + 88, pos_y_smeter - 13);
tft.print("9");
tft.setCursor(pos_x_smeter + 120, pos_y_smeter - 13);
tft.print("+20dB");
} // end void setupdisplay
示例11: tftPrintTest
void tftPrintTest() {
tft.setTextWrap(false);
tft.fillScreen(ST7735_BLACK);
tft.setCursor(0, 30);
tft.setTextColor(ST7735_RED);
tft.setTextSize(1);
tft.println("Hello World!");
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(2);
tft.println("Hello World!");
tft.setTextColor(ST7735_GREEN);
tft.setTextSize(3);
tft.println("Hello World!");
tft.setTextColor(ST7735_BLUE);
tft.setTextSize(4);
tft.print(1234.567);
delay(1500);
tft.setCursor(0, 0);
tft.fillScreen(ST7735_BLACK);
tft.setTextColor(ST7735_WHITE);
tft.setTextSize(0);
tft.println("Hello World!");
tft.setTextSize(1);
tft.setTextColor(ST7735_GREEN);
tft.print(p, 6);
tft.println(" Want pi?");
tft.println(" ");
tft.print(8675309, HEX); // print 8,675,309 out in HEX!
tft.println(" Print HEX!");
tft.println(" ");
tft.setTextColor(ST7735_WHITE);
tft.println("Sketch has been");
tft.println("running for: ");
tft.setTextColor(ST7735_MAGENTA);
tft.print(millis() / 1000);
tft.setTextColor(ST7735_WHITE);
tft.print(" seconds.");
}
示例12: displayGameOver
void displayGameOver() {
tft.fillScreen(0x0000); // clear the screen with black
tft.setCursor(0,0); // set the cursor, indicates where to display
tft.setTextWrap(false); // no wrap
tft.setTextSize(3);
tft.print("\n GAME \n\n");
tft.print(" OVER\n\n");
tft.setTextSize(1);
tft.print(" SCORE: ");
tft.print(score);
//~ tft.print("\n TOP 5 OF THE SCORE LIST ");
// TO_DO: print out the score list, which needs to be saved in SD cardc
}
示例13: setup
void setup()
{
Serial.begin(9600);
menuState = TESTKEYPAD_MENU;
tft.initR(INITR_REDTAB);
tft.setTextSize(1);
tft.fillScreen(ST7735_BLACK);
tft.setCursor(0, 0);
tft.setTextColor(ST7735_WHITE,ST7735_BLACK);
sensNum = 0;
}
示例14: setup
void setup() {
Serial.begin(9600);
// initialise display
tft.initR(INITR_BLACKTAB);
tft.fillScreen(ST7735_BLACK);
// initialise pins
pinMode(leftPin, INPUT);
pinMode(rightPin, INPUT);
pinMode(turnPin, INPUT);
// display splashscreen
tft.setTextColor(ST7735_WHITE);
tft.setTextWrap(true);
tft.setCursor(34, 20);
tft.println("WELCOME TO");
tft.setCursor(45, 30);
tft.println("~TETRIS");
tft.setCursor(16, 50);
tft.println("PRESS THE MIDDLE");
tft.setCursor(18, 60);
tft.println("BUTTON TO START");
tft.setCursor(57, 110);
tft.println("BY:");
tft.setCursor(33, 120);
tft.println("NICHOLAS LI");
tft.setCursor(56, 130);
tft.println("AND");
tft.setCursor(24, 140);
tft.println("ARJUN KALBURGI");
// only continue if turnPin is pressed
while(digitalRead(turnPin) == LOW) {}
tft.fillScreen(ST7735_BLACK);
}
示例15: show_frequency
// show frequency
void show_frequency(long int freq, boolean highlight) {
uint8_t offsetx = 0;
tft.setFont(&FreeSans12pt7b);
char string[80]; // print format stuff
sprintf(string, "%d.%03d.%03d", freq / 1000000, (freq - freq / 1000000 * 1000000) / 1000,
freq % 1000 );
if (freq < 10000000) offsetx = 13;
tft.fillRect(pos_x_freq, pos_y_freq - 17, 120, 18, BLACK);
tft.setCursor(pos_x_freq + offsetx, pos_y_freq);
if (highlight) {
tft.setTextColor(YELLOW);
} else {
tft.setTextColor(WHITE);
}
tft.print(string);
}