You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run the isolated tests, this library works ok. But if you integrate it in a node process running other stuff, then you get very erratic results. For example (using npm install sleep):
varLcd=require('lcd')varsleep=require('sleep')varlcd=newLcd({rs: 26,e: 44,data: [66,67,69,68],cols: 20,rows: 4});lcd.setCursor(0,0)lcd.print('Hello',()=>{})sleep.sleep(3)// simulate other stuff running in the node process
When you run this on a Beaglebone Black with a SHENZHEN 2004A Display, you get only the last o character printed at the 0,0 position. If you remove the sleep line, the snippet works ok.
The text was updated successfully, but these errors were encountered:
As mentioned in the documentation an Lcd object will emit a ready event when the display is ready for usage. The usage example shows how to use the ready event. An Lcd object should not be used before the ready event is emitted.
Something like this should work:
varLcd=require('lcd')varsleep=require('sleep')varlcd=newLcd({rs: 26,e: 44,data: [66,67,69,68],cols: 20,rows: 4});lcd.on('ready',()=>{lcd.setCursor(0,0)lcd.print('Hello',()=>{})sleep.sleep(3)// simulate other stuff running in the node process});
I'm going to go ahead and close this issue as it doesn't appear to be an issue with the lcd module. If it turns out that it is an issue with the lcd module the issue can be reopened.
If you run the isolated tests, this library works ok. But if you integrate it in a node process running other stuff, then you get very erratic results. For example (using
npm install sleep
):When you run this on a Beaglebone Black with a SHENZHEN 2004A Display, you get only the last
o
character printed at the 0,0 position. If you remove thesleep
line, the snippet works ok.The text was updated successfully, but these errors were encountered: