CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 tiles = vga#xtiles * vga#ytiles tiles32 = tiles * 32 SerRxPin = 0 ' Serial interface connect to Sout on LRF SerTxPin = 1 ' connect to Sin on LRF OBJ vga : "vga_512x384_bitmap" ser : "JDCogSerial" ' Full-duplex serial communication (Carl Jacobs, http://obex.parallax.com/objects/398/) VAR long sync, pixels[tiles32] word colors[tiles] PUB start | h, i, j, k, x, y ser.Start(| 128 plot(x, y) else unplot(x, y) ser.Rx ' Skip "U" and "V" bytes PRI plot(x,y) if x => 0 and x < 512 and y => 0 and y < 384 pixels[y << 4 + x >> 5] |= |< x PRI UnPlot(x,y) if x => 0 and x < 512 and y => 0 and y < 384 pixels[y << 4 + x >> 5] |= |< x pixels[y << 4 + x >> 5] ^= |< x