xsherlock Geschrieben April 13, 2015 at 12:05 Geschrieben April 13, 2015 at 12:05 I have an idea that you could bring large font support for the 4x20 LCD Especialy it would be nice to have 3x3 large font like this one http://hifiduino.blogspot.it/2009/05/improved-display.html At least for numbers. So I can make nice readouts that can be read from afar. I know that it can be done with 5" LCD but that requires designing UI as a webpage and is a lot of work for simple hacks. Zitieren
Loetkolben Geschrieben April 13, 2015 at 17:32 Geschrieben April 13, 2015 at 17:32 Very nice idea. But for the Moment you can help yourself: Just place some "■" at the desired Position. ;-) Der Loetkolben Zitieren
xsherlock Geschrieben April 17, 2015 at 22:21 Autor Geschrieben April 17, 2015 at 22:21 I have two litte todlers that will wake up any moment and you really made me do late in night.... Prints a 4 digit readout in a nice large font... lcd.set_custom_character(0,[31,31,31,31,31,31,31,31]) lcd.set_custom_character(1,[31,31,31,31,31,0,0,0]) lcd.set_custom_character(2,[0,0,0,31,31,31,31,31]) lcd.set_custom_character(3,[0,0,0,0,0,0,0,0]) lcd.set_custom_character(4,[31,31,31,31,31,31,0,0]) lcd.set_custom_character(5,[0,31,31,31,31,31,0,0]) lcd.set_custom_character(6,[0,31,31,31,31,31,31,31]) def print_large_digit(x,y,digit): if digit==0: lcd.write_line(x,y,chr() lcd.write_line(x,y+1,chr(9)) lcd.write_line(x,y+2,chr() lcd.write_line(x+1,y,chr() lcd.write_line(x+1,y+1,chr(11)) lcd.write_line(x+1,y+2,chr() lcd.write_line(x+2,y,chr() lcd.write_line(x+2,y+1,chr(10)) lcd.write_line(x+2,y+2,chr() elif digit==1: lcd.write_line(x,y,chr(10)) lcd.write_line(x,y+1,chr() lcd.write_line(x,y+2,chr(11)) lcd.write_line(x+1,y,chr(11)) lcd.write_line(x+1,y+1,chr() lcd.write_line(x+1,y+2,chr(11)) lcd.write_line(x+2,y,chr(10)) lcd.write_line(x+2,y+1,chr() lcd.write_line(x+2,y+2,chr(10)) elif digit==2: lcd.write_line(x,y,chr(9)) lcd.write_line(x,y+1,chr(9)) lcd.write_line(x,y+2,chr() lcd.write_line(x+1,y,chr(14)) lcd.write_line(x+1,y+1,chr(13)) lcd.write_line(x+1,y+2,chr(12)) lcd.write_line(x+2,y,chr() lcd.write_line(x+2,y+1,chr(10)) lcd.write_line(x+2,y+2,chr(10)) elif digit==3: lcd.write_line(x,y,chr(9)) lcd.write_line(x,y+1,chr(9)) lcd.write_line(x,y+2,chr() lcd.write_line(x+1,y,chr(13)) lcd.write_line(x+1,y+1,chr(13)) lcd.write_line(x+1,y+2,chr() lcd.write_line(x+2,y,chr(10)) lcd.write_line(x+2,y+1,chr(10)) lcd.write_line(x+2,y+2,chr() elif digit==4: lcd.write_line(x,y,chr() lcd.write_line(x,y+1,chr(11)) lcd.write_line(x,y+2,chr() lcd.write_line(x+1,y,chr(12)) lcd.write_line(x+1,y+1,chr(13)) lcd.write_line(x+1,y+2,chr() lcd.write_line(x+2,y,chr(11)) lcd.write_line(x+2,y+1,chr(11)) lcd.write_line(x+2,y+2,chr() elif digit==5: lcd.write_line(x,y,chr() lcd.write_line(x,y+1,chr(9)) lcd.write_line(x,y+2,chr(9)) lcd.write_line(x+1,y,chr(12)) lcd.write_line(x+1,y+1,chr(13)) lcd.write_line(x+1,y+2,chr(14)) lcd.write_line(x+2,y,chr(10)) lcd.write_line(x+2,y+1,chr(10)) lcd.write_line(x+2,y+2,chr() elif digit==6: lcd.write_line(x,y,chr() lcd.write_line(x,y+1,chr(9)) lcd.write_line(x,y+2,chr(9)) lcd.write_line(x+1,y,chr() lcd.write_line(x+1,y+1,chr(13)) lcd.write_line(x+1,y+2,chr(14)) lcd.write_line(x+2,y,chr() lcd.write_line(x+2,y+1,chr(10)) lcd.write_line(x+2,y+2,chr() elif digit==7: lcd.write_line(x,y,chr(9)) lcd.write_line(x,y+1,chr(9)) lcd.write_line(x,y+2,chr() lcd.write_line(x+1,y,chr(11)) lcd.write_line(x+1,y+1,chr(11)) lcd.write_line(x+1,y+2,chr() lcd.write_line(x+2,y,chr(11)) lcd.write_line(x+2,y+1,chr(11)) lcd.write_line(x+2,y+2,chr() elif digit==8: lcd.write_line(x,y,chr() lcd.write_line(x,y+1,chr(9)) lcd.write_line(x,y+2,chr() lcd.write_line(x+1,y,chr() lcd.write_line(x+1,y+1,chr(13)) lcd.write_line(x+1,y+2,chr() lcd.write_line(x+2,y,chr() lcd.write_line(x+2,y+1,chr(10)) lcd.write_line(x+2,y+2,chr() elif digit==9: lcd.write_line(x,y,chr() lcd.write_line(x,y+1,chr(9)) lcd.write_line(x,y+2,chr() lcd.write_line(x+1,y,chr(12)) lcd.write_line(x+1,y+1,chr(13)) lcd.write_line(x+1,y+2,chr() lcd.write_line(x+2,y,chr(10)) lcd.write_line(x+2,y+1,chr(10)) lcd.write_line(x+2,y+2,chr() elif digit==99: lcd.write_line(x,y,chr(11)) lcd.write_line(x,y+1,chr(11)) lcd.write_line(x,y+2,chr(11)) lcd.write_line(x+1,y,chr(11)) lcd.write_line(x+1,y+1,chr(11)) lcd.write_line(x+1,y+2,chr(11)) lcd.write_line(x+2,y,chr(11)) lcd.write_line(x+2,y+1,chr(11)) lcd.write_line(x+2,y+2,chr(11)) def print_large_4(x,y,number ): number_str = str(number) if number < 1000: if number < 100: print_large_digit(x,y,99) print_large_digit(x,y+4,99) digit_3 = int(number_str[0]) digit_4 = int(number_str[1]) else: print_large_digit(x,y,99) digit_2 = int(number_str[0]) digit_3 = int(number_str[1]) digit_4 = int(number_str[2]) print_large_digit(x,y+4,digit_2) else: digit_1 = int(number_str[0]) digit_2 = int(number_str[1]) digit_3 = int(number_str[2]) digit_4 = int(number_str[3]) print_large_digit(x,y,digit_1) print_large_digit(x,y+4,digit_2) print_large_digit(x,y+8,digit_3) print_large_digit(x,y+12,digit_4) Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.