|
| 1 | +import time |
| 2 | +from adafruit_magtag.magtag import MagTag |
| 3 | +import random |
| 4 | + |
| 5 | +QUOTES = [ |
| 6 | + "The more I study, the more insatiable do I feel my genius for it to be. - Ada Lovelace", |
| 7 | + "That brain of mine is something more than merely mortal; as time will show. - Ada Lovelace", |
| 8 | + "Programming is the art of algorithm design and the craft of debugging errant code. - Ellen Ullman", |
| 9 | + "The most damaging phrase in the language is: 'It's always been done that way.' - Grace Hopper", |
| 10 | + "An algorithm must be seen to be believed. - Donald Knuth", |
| 11 | + "Machines take me by surprise with great frequency. - Alan Turing", |
| 12 | + "The computer was born to solve problems that did not exist before. - Bill Gates", |
| 13 | + "The function of good software is to make the complex appear to be simple. - Grady Booch", |
| 14 | + "The best way to predict the future is to invent it. - Alan Kay", |
| 15 | + "A good programmer is someone who always looks both ways before crossing a one-way street. - Doug Linder", |
| 16 | + "The most important property of a program is whether it accomplishes the intention of its user. - C.A.R. Hoare", |
| 17 | + "The purpose of computing is insight, not numbers. - Richard Hamming", |
| 18 | + "The best thing about a boolean is even if you are wrong, you are only off by a bit. - Anonymous", |
| 19 | + "The computer is a moron. - Peter Drucker", |
| 20 | + "The computer is incredibly fast, accurate, and stupid. Man is unbelievably slow, inaccurate, and brilliant. The marriage of the two is a force beyond calculation. - Leo Cherne", |
| 21 | + "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking", |
| 22 | + "The real problem is not whether machines think but whether men do. - B.F. Skinner", |
| 23 | + "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim. - Edsger Dijkstra", |
| 24 | + "The computing scientist’s main challenge is not to get confused by the complexities of his own making. - Edsger Dijkstra", |
| 25 | + "The best performance improvement is the transition from the nonworking state to the working state. - John Ousterhout", |
| 26 | + "The trouble with programmers is that you can never tell what a programmer is doing until it’s too late. - Seymour Cray", |
| 27 | + "The best programs are the ones written when the programmer is supposed to be working on something else. - Melinda Varian", |
| 28 | + "The best way to get a project done faster is to start sooner. - Jim Highsmith", |
| 29 | + "The best way to learn is to do. - Paul Halmos", |
| 30 | + "The best way to understand recursion is to begin by understanding recursion. - Anonymous", |
| 31 | + "The best way to predict the future is to create it. - Peter Drucker", |
| 32 | + "The best way to escape from a problem is to solve it. - Alan Saporta", |
| 33 | + "The best way to have a good idea is to have a lot of ideas. - Linus Pauling" |
| 34 | +] |
| 35 | + |
| 36 | +magtag = MagTag() |
| 37 | + |
| 38 | +magtag.add_text( |
| 39 | + text_wrap=40, |
| 40 | + text_position=( |
| 41 | + (magtag.graphics.display.width // 2), |
| 42 | + (magtag.graphics.display.height // 2), |
| 43 | + ), |
| 44 | + line_spacing=1, |
| 45 | + text_anchor_point=(0.5, 0.5), # center the text on x & y |
| 46 | + text_scale=1, |
| 47 | +) |
| 48 | + |
| 49 | +quote = random.choice(QUOTES) |
| 50 | +magtag.set_text(quote) |
| 51 | + |
| 52 | +# wait 2 seconds for display to complete |
| 53 | +time.sleep(2) |
| 54 | + |
| 55 | +# sleep to save battery |
| 56 | +magtag.exit_and_deep_sleep(86400) |
0 commit comments