#!/usr/bin/env python import MAX7219array as m7219 from MAX7219fonts import CP437_FONT, SINCLAIRS_FONT, LCD_FONT, TINY_FONT from MAX7219array import DIR_L, DIR_R, DIR_U, DIR_D import sys import time import fileinput if len(sys.argv) == 1: for line in sys.stdin: m7219.init() m7219.brightness(1) m7219.scroll_message_horiz(line.rstrip(), 1, 8, DIR_L, CP437_FONT) m7219.clear_all() #print(line) sys.exit(0) print sys.argv m7219.init() prev = '' for word in sys.argv[1:]: #print word m7219.scroll_message_vert(prev, word, direction=1) prev = word
from MAX7219array import DIR_L, DIR_R, DIR_U, DIR_D from MAX7219array import DIR_LU, DIR_RU, DIR_LD, DIR_RD from MAX7219array import DISSOLVE, GFX_ON, GFX_OFF, GFX_INVERT # Initialise the library and the MAX7219/8x8LED array m7219.init() try: # Display a stationary message m7219.static_message("Welcome!") time.sleep(2) m7219.clear_all() # Cycle through the range of brightness levels - up then down m7219.brightness(0) m7219.static_message("Bright ?") for loop in range(2): for brightness in range(15*(loop%2), 16-17*(loop%2), 1-2*(loop%2)): m7219.brightness(brightness) time.sleep(0.1) time.sleep(1) # Clear the whole display and reset brightness m7219.clear_all() m7219.brightness(3) time.sleep(1) # Random flashing lights (Hollywood's version of a computer) for loop in range(16): for matrix in range(8):
from MAX7219array import DIR_L, DIR_R, DIR_U, DIR_D from MAX7219array import DIR_LU, DIR_RU, DIR_LD, DIR_RD from MAX7219array import DISSOLVE, GFX_ON, GFX_OFF, GFX_INVERT # Initialise the library and the MAX7219/8x8LED array m7219.init() try: # Display a stationary message m7219.static_message("Welcome!") time.sleep(2) m7219.clear_all() # Cycle through the range of brightness levels - up then down m7219.brightness(0) m7219.static_message("Bright ?") for loop in range(2): for brightness in range(15 * (loop % 2), 16 - 17 * (loop % 2), 1 - 2 * (loop % 2)): m7219.brightness(brightness) time.sleep(0.1) time.sleep(1) # Clear the whole display and reset brightness m7219.clear_all() m7219.brightness(3) time.sleep(1) # Random flashing lights (Hollywood's version of a computer) for loop in range(16):