Posted: Wed Jul 01, 2015 7:12 am Post subject: Shifting LCD with a switch
Hi,
I need help with programming the LCD to shift one space right when a switch is pressed, and it stays there permanently. So if i keep pressing the switch the LCD will shift more spaces to the right.
By the way, this came from this question "f.Write a program that includes a character you have created on the LCD, when 1 switch is pressed the image moves left one space, the other switch moves it right one space. "
So far this is what i have done.
'SETUP for the ports
$crystal = 1000000 'sets the frequency of the M/P
$regfile = "m48def.dat" 'tells BASCOM which M/P I am using
Config Portd = Output 'Outputs for the ports D
Config Portb = Output 'Outputs for the ports B
Config Pinb.7 = Input 'Set inputs for switch 1
Config Pinb.0 = Input 'Set inputs for switch 2
'Config for LCD
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.2 , Db7 = Portb.3 , E = Portb.1 , Rs = Portb.6
Config Lcd = 16 * 2
Set Portd.5 'sets backlight
Swy Alias Pinb.0 'Sets another name for PINB.0 to be called Switch yellow
Sww Alias Pinb.7 'Sets another name for PINB.7 to be called Switch white
Dim A As Byte 'sets a as a variable for text
Dim Message1 As String * 16 'sets a variable
Message1 = "Jaime" 'variable is used to display text
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum