diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-19 19:02:34 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-19 19:02:34 +0100 |
commit | 0c3955b5061816da3353df8e45175b0b56624f52 (patch) | |
tree | 3797b868edb92ae5018e459443e6debb4f17737f /examples/lcd.py | |
parent | 21ca2d76a2c10935826007daec699aba97679240 (diff) | |
download | micropython-0c3955b5061816da3353df8e45175b0b56624f52.tar.gz micropython-0c3955b5061816da3353df8e45175b0b56624f52.zip |
examples: Update conwaylife to work with new LCD API.
Diffstat (limited to 'examples/lcd.py')
-rw-r--r-- | examples/lcd.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/examples/lcd.py b/examples/lcd.py deleted file mode 100644 index 3303337bfb..0000000000 --- a/examples/lcd.py +++ /dev/null @@ -1,36 +0,0 @@ -# LCD testing object for PC -# uses double buffering -class LCD: - def __init__(self, width, height): - self.width = width - self.height = height - self.buf1 = [[0 for x in range(self.width)] for y in range(self.height)] - self.buf2 = [[0 for x in range(self.width)] for y in range(self.height)] - - def clear(self): - for y in range(self.height): - for x in range(self.width): - self.buf1[y][x] = self.buf2[y][x] = 0 - - def show(self): - print('') # blank line to separate frames - for y in range(self.height): - for x in range(self.width): - self.buf1[y][x] = self.buf2[y][x] - for y in range(self.height): - row = ''.join(['*' if self.buf1[y][x] else ' ' for x in range(self.width)]) - print(row) - - def get(self, x, y): - if 0 <= x < self.width and 0 <= y < self.height: - return self.buf1[y][x] - else: - return 0 - - def reset(self, x, y): - if 0 <= x < self.width and 0 <= y < self.height: - self.buf2[y][x] = 0 - - def set(self, x, y): - if 0 <= x < self.width and 0 <= y < self.height: - self.buf2[y][x] = 1 |