![]() Script is run when a command is issued, so it can be anytime. Script 4 - a feedback line showing last home automation feature used and display on line 4. Script is run from cron, writes to LCD and exits. Script 3 - RSS feed tracking my favorite NHL team score updated every 3 minutes and displays on line 3. Script 2 - outside temp and inside temp checked every minute displayed on line 2. Script 1 - python - real time date and time with seconds displayed on line 1 - script is always running and updates line one once a second. Mylcd.lcd_display_string_pos("this string here",2,0) Mylcd.lcd_display_string("string here",1) What I am trying to do is have 4 independent scripts, each write to one single line.Īll text is being printed from each script is 20 or less characters.Įach script writes to one line directly using either: I also experience it writing the strange characters to the wrong lines. I have the RPi_I2C_driver working fine for basic use, but when I try to use it how I want, strange things happen similar to what raphaelyancey and Machacator mention about strange characters. # define precise positioning (addition from the forum)ĭef lcd_display_string_pos( self, string, line, pos): write_cmd( LCD_NOBACKLIGHT)ĭef lcd_load_custom_chars( self, fontdata): # define backlight on/off (lcd.backlight(1) off= lcd.backlight(0)ĭef backlight( self, state): # for state, 1 = on, 0 = off lcd_write_four_bits( mode | (( charvalue << 4) & 0xF0))ĭef lcd_display_string( self, string, line): lcd_write_four_bits( mode | ( charvalue & 0xF0)) ![]() # write a character to lcd (or character rom) 0x09: backlight | RS=DR<ĭef lcd_write_char( self, charvalue, mode = 1): lcd_write_four_bits( mode | ( cmd & 0xF0)) write_cmd((( data & ~ En) | LCD_BACKLIGHT)) lcd_write( LCD_ENTRYMODESET | LCD_ENTRYLEFT) lcd_write( LCD_DISPLAYCONTROL | LCD_DISPLAYON) lcd_write( LCD_FUNCTIONSET | LCD_2LINE | LCD_5x8DOTS | LCD_4BITMODE) # added bits and pieces from various sources # Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library ![]() # Modified Python I2C library for Raspberry Pi #NHL 2004 REBUILT SCRIPT ERROR LICENSE#Made available under GNU GENERAL PUBLIC LICENSE lcd_display_string_pos( unichr( 5), 2, 11)Ĭompiled, mashed and generally mutilated 2014-2015 by Denis Pleic lcd_display_string_pos( unichr( 4), 2, 10) lcd_display_string_pos( unichr( 3), 2, 9) lcd_display_string_pos( unichr( 2), 1, 11) lcd_display_string_pos( unichr( 1), 1, 10) lcd_display_string_pos( unichr( 0), 1, 9) # now again load first set of custom chars - smiley lcd_display_string_pos( unichr( 1), 1, pos) # and another one, same as above, 1 char-space to the right lcd_display_string_pos( unichr( 4), 1, pos) lcd_display_string_pos( unichr( 3), 1, pos) lcd_display_string_pos( unichr( 2), 1, pos) lcd_display_string_pos( unichr( 1), 1, 6) Pauza = 0.2 # define duration of sleep(x) # first draw two blocks on 5th column (cols 5 and 6), starts from 0 # display two blocks in columns 5 and 6 (i.e. # Now let's define some more custom charactersīlock = chr( 255) # block character, built-in lcd_display_string_pos( "Testing", 2, 3) # row 2, column 3 lcd_display_string_pos( "Testing", 1, 1) # row 1, column 1 # Write next three chars to row 2 directly # Write first three chars to row 1 directly # 3 chars in the first row and 3 chars in the second row # let's define a custom icon, consisting of 6 individual characters
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |