#NEWLINE# def createGlyph( self , glyph_num , glyph ) : #NEWLINE# #INDENT# " Puts the given glyph into the the display's custom glyph RAM at \n        location glyph_num, which can be 0-7. " #NEWLINE# assert ( ( glyph_num >= 0 ) and ( glyph_num < 8 ) ) , 'only 0-7 are valid glyphs' #NEWLINE# length = len ( glyph ) #NEWLINE# assert ( ( length == 40 ) or ( length == 8 ) ) , 'a glyph must by an array of length 8' #NEWLINE# start_addr = ( glyph_num * 8 ) #NEWLINE# self . writeCommand ( ( self . COMMAND_CGRAM_ADDR | start_addr ) ) #NEWLINE# for row in range ( 8 ) : #NEWLINE# #INDENT# self . writeData ( ( glyph_num [ row ] & 31 ) ) #NEWLINE# #UNINDENT# self . _setDDRAMAddress ( self . _ddram_address )