Exemplo n.º 1
0
void loop() {
    Serial.println("printing though!");
    tft.fillScreen(ST7735_BLACK);
    // tft.setCursor(0, 0);
    tft.setTextColor(ST7735_WHITE);
    tft.setTextWrap(true);
    // tft.setTextSize(3);
    // tft.setCursor(30, 3);
    tft.setFont(HERO_10);
    tft.drawRightString("OTTAWA",  3);

    tft.setFont(HERO_16);
    tft.setTextSize(2);
    // tft.setCursor(25, 20);
    tft.drawRightString("-1  C", 20);

    tft.setTextSize(1);
    // tft.setCursor(35, 60);
    tft.drawRightString("2:35 PM", 60);

    tft.drawFastHLine(0, 90, tft.width(), ST7735_CYAN);

    tft.setTextWrap(true);
    tft.setFont(CENTURY_8);
    tft.setTextSize(1);
    // tft.setCursor(0, tft.height()-65);
    int yPos = tft.drawString("Stay Hungry, Stay Foolish!",  0,tft.height()-65);
    tft.setTextColor(ST7735_CYAN);
    tft.drawRightString(" - Steve Jobs   ", yPos);
    tft.setTextColor(ST7735_MAGENTA);
    delay(5000);
}
Exemplo n.º 2
0
void main_display(void) {
  tft.fillScreen(BLACK);
  tft.setFont(&FreeSans9pt7b);
  // Show mid screen tune position
  tft.drawFastVLine(80, 0, 60, RED);
  show_s_meter_layout();
}
Exemplo n.º 3
0
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__);
}
Exemplo n.º 4
0
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);
}
Exemplo n.º 5
0
// 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);
}
Exemplo n.º 6
0
// 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);
}
Exemplo n.º 7
0
void show_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.setFont();
  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");
}
Exemplo n.º 8
0
// show signal strength
void show_signalstrength(String s) {
  tft.setFont(&FreeSans9pt7b);
  tft.fillRect(12, 72, 40, 14, BLACK);
  tft.setCursor(0, 85);
  tft.print(s);
}