arduino-appleii/APPLEII/ghettovga.ino
Damian Peckett 2798ae6d16 First Commit
Uploading Current Source To Github
2015-04-08 17:14:01 +10:00

30 lines
694 B
C++

void writeCharacter(unsigned char row, unsigned char col, unsigned char val) {
unsigned char buf[4] = {0xFD, 0, 0, 0};
buf[1] = col;
buf[2] = row;
buf[3] = val;
Serial.write(buf, 4);
}
unsigned char readCharacter(unsigned char row, unsigned char col) {
unsigned long transaction_begin;
unsigned char buf[4] = {0xFA, 0, 0};
buf[1] = col;
buf[2] = row;
Serial.write(buf, 3);
for(transaction_begin = millis(); !Serial.available(); millis() < (transaction_begin+50));
return Serial.read();
}
void clearScreen() {
unsigned char cmd = 0xFC;
Serial.write(&cmd, 1);
delay(20);
}
void screenScroll() {
unsigned char cmd = 0xFB;
Serial.write(&cmd, 1);
delay(20);
}