Can be found for less than $5 which seems like good value.
the unique thing it has 6 key switches to get your project up and running quickly.
there seem to be a lot of different makes but all seem to work identically.
Unlike older LCD's these new 1's work happily at 4v you just need to adjust the contrast to suit.
when you power up you will also find the backlight led will be at full brightness.
If you want to reduce this send a low signal to D.10 the transistors base which controls it.
If your using the RST switch it needs to have a pullup resistor.
The code example shows the pinouts and how we can connect to a 20m2
- dim the backlight using hpwm
-display keyvalues on the LCD from O to 6 depending on the key pressed
if you press multiple keys the lower valued or reset takes priority.
the unique thing it has 6 key switches to get your project up and running quickly.
there seem to be a lot of different makes but all seem to work identically.
Unlike older LCD's these new 1's work happily at 4v you just need to adjust the contrast to suit.
when you power up you will also find the backlight led will be at full brightness.
If you want to reduce this send a low signal to D.10 the transistors base which controls it.
If your using the RST switch it needs to have a pullup resistor.
The code example shows the pinouts and how we can connect to a 20m2
- dim the backlight using hpwm
-display keyvalues on the LCD from O to 6 depending on the key pressed
if you press multiple keys the lower valued or reset takes priority.
Code:
'#Picaxe 20m2 .------------------------.
' | LCD KeypadShield |
SETFREQ M32 ' | _ _ _ _ Aref |
' | | | GND |
dirsB = %00001111 ' | | | D.13 | B.7 Hi2C SCL
dirsC = %10111111 ' | | | D.12 | B.5 Hi2C SDA
' %-------- C.6 -->| RST | | D.11 |
'(requires pullup) | 3V3 | 16 | D.10 |<-- C.4 SwitchLED(optional)
' RST Sw 5 -->| 5V | 2 6 | D.9 |<-- C.3 Enable
' -->| GND | 1 4 | D.8 |<-- C.2 RS
' | GND | | |
' | VIN | | |
' | |VDD 15 | |
' | | 14 | D.7 |<-- B.3 DB7
' | | 13 | D.6 |<-- B.2 DB6
' %-%-%-%-%- C.7 -->| A.0 | 12 | D.5 |<-- B.1 DB5
' SELEC Sw 4 | A.1 | 11 | D.4 |<-- B.0 DB4
' LEFT Sw 3 | A.2 | | D.3 |
' DOWN Sw 2 | A.3 |_ _ _ _| D.2 |
' UP Sw 1 | A.4 TX / D.1 |
' RIGHT Sw 0 | A.5 RX / D.0 |
' |___ ______|
' \_____________/
SYMBOL RS = C.2
SYMBOL E = C.3
SYMBOL RSTswitch = pinC.6
SYMBOL Switches = C.7
SYMBOL senddata = b0
SYMBOL index = b1
SYMBOL pushbutton = b2
TABLE 0, ($33,$32,$28,$0C,$01,$02,$06) '(4Bit)(2line/5x8)(Display On)(Clear Display)(Return Home)(Entry Mode Set)
IntialiseDisplay:
hpwm 0,0,%0010,240,120 ' mode,polarity,B,period,duty (diM lcd LED C.4) @5v duty 000 16ma / 120 21ma / 35ma not connected
FOR index = 0 to 6 ' total current includes 20m2 (about5ma) @4v duty 000 12ma / 120 16ma / 23ma not connected
READTABLE index, senddata : pinsB = senddata /16 : PULSOUT E,1 : pinsB = senddata : PULSOUT E,1' Initialise LCD/OLED
NEXT index : PAUSE 10
Menu:
ReadADC Switches,pushbutton : pushbutton = pushbutton *6 + 293 /300 'check pushbutton status 0 to 4
IF RSTswitch = 0 THEN : pushbutton = 5 : ENDIF 'check reset 5 overide
'value 6 no button pressed
pushbutton = pushbutton + "0" 'convert to ASCII for display
Display:
LOW RS ' commandmode
senddata = 128 : pinsB = senddata /16 : PULSOUT E,1 : pinsB = senddata : PULSOUT E,1' (128-147) Line 1 Cursor Position
HIGH RS ' charactermode
FOR index = 0 TO 14
LOOKUP index,("20M2 KEYvalue ",pushbutton) ,senddata
pinsB = senddata /16 : PULSOUT E,1 : pinsB = senddata : PULSOUT E,1' sending characters
NEXT index
goto menu
Attachments
-
348.5 KB Views: 71
-
88.2 KB Views: 51
Last edited: