10PRINT for Nesso N1 (and Serial Monitor)

Updated... so it is "viewable" (was too small with text size 1)

// https://10print.org/10_PRINT_121114.pdf

#include <Arduino_Nesso_N1.h>
NessoDisplay display;

// int textSize = 1, nessoMaxX = 39, nessoMaxY = 25; // very small
int textSize = 2, nessoMaxX = 23, nessoMaxY = 12;

int x, y, serialMaxCol = 80;  // rows and columns
char charLeft = 47, charRight = 92, charWidth = 10, charHeight = 10;

int fgColor = 13 << 11 | 23 << 5 | 24 << 0;  // C64 text // https://imagecolorpicker.com/
int bgColor = 3 << 11 | 8 << 5 | 19 << 0;    // C64 screen // https://rgbcolorpicker.com/565

void setup() {
  Serial.begin(115200);
  display.begin();
  display.setRotation(3);  // KEY1 left
  display.setTextSize(textSize);
  display.setTextColor(fgColor);
  display.fillScreen(bgColor);
}

void loop() {
  nesso10PRINT();
  // serial10PRINT();
}

void nesso10PRINT() {
  // this is the 10PRINT line
  display.drawChar(random(2) ? charLeft : charRight, x * charWidth, y * charHeight);

  // this is housekeeping
  x++;
  if (x > nessoMaxX) {
    x = 0;
    y++;
    Serial.println();
    if (y > nessoMaxY) {
      y = 0;
      delay(250);
      display.fillScreen(bgColor);
    }
  }
  delay(10);  // without delay it is a blur
}

void serial10PRINT() {
  // the 10PRINT line
  Serial.write(random(2) ? charLeft : charRight);

  // housekeeping
  if (++x > serialMaxCol) {
    x = 0;
    Serial.println();
  }
  delay(50);
}
2 Likes

lol, still got my vic20..

324 pages for one line of code..

10_PRINT_121114.pdf

interesting..~q

I remember the day I got my C64 (1983) and the day I unplugged and put it on a curb (1994) with a goodbye/thank-you note... PBUH.

I think 255 characters was considered "one line."

1 Like