I2c lcd 16x2, message switch via button


#1

hi guys,

I’m new to xod and i have a a problem concerning a i2c lcd.

“project”: the lcd displays a message, when a button is pushed the message is whiped and a new message is displayed on the lcd.

How can i achieve this? i can’t find a clear screen node, the attempts i made resulted in the 2 messages blinking and overlaping eachother.

Can anyone help? thanks!


#2

Hi, can you upload a xodball with what are you doing? Insert some comments of the sequence you want.


#3

The LCD node clears any line it writes to. It sounds like you are using 2 LCD nodes and they are fighting for control. You need to rewrite your code to only use 1 LCD node and change strings being fed to it. A select node could be used to feed the lcd input.


#4

Hi gweimer,

Thanks for the reply, that’s indeed what i did and what’s happening. i don’t know if a select node will do the job.

This needs to be part of the ui, welcoming menu. So the first message for example “welcome, press next to continue” when the next button is pressed, the next message is presented and the first is never shown again until the power is turned off and on again ofcourse.

Could you help me with this if it’s not to much to ask?

thanks in advance!


#5

Sounds like a perfect use for select node. Select node defaults to displaying one message (I believe the far-right option), so that would be your welcome message. The next button would be tied to the pulse pin for the next message. You can expand the select node to add additional messages that receive pulses from other buttons, or timers, or logic code to count button presses, or…


#6

oooh i din’t see that i could expand this node, thank you so much!


#7

i’m very sorry to bother you again, would you mind drafting it up and posting it here? I’m an absolute beginner when it comes to coding and i can’t seem to figure it out :frowning:


#8

this is what i have so far… the first message is displayed, but when the button is being pressed nothing is happening…


#9

I would expect “test page 2” is always shown… I think the button is not being read at all. Do you set up its PORT correctly? Also, does it have a pull-up resistor in hardware?

Anyway, to change the message on button click, link the PRS output to S2, not DONE.


#10

hi nkrkv,

Yes, when selecting the node for the button i put in the correct port no. And i pulled it up with a 10K resistor. After changing the output to prs it still doesn’t work… Any suggestions?


#11

Could you add a watch on PRS and run with debugger to verify the button is indeed sends correct boolean signals?


#12

the debugger show’s no data, just “debug session started”


#13

try this,with DONE to s2 also works