Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: "callback" argument must be a function #9

Open
sltmunky69 opened this issue Dec 5, 2017 · 1 comment
Open

TypeError: "callback" argument must be a function #9

sltmunky69 opened this issue Dec 5, 2017 · 1 comment

Comments

@sltmunky69
Copy link

sltmunky69 commented Dec 5, 2017

I am simply trying to run the example code to test a display. I was able to get to this point after fixing the set address error for RPi3. Node v8.9.1

var oled = require('oled-js-pi');

var opts = {
  width: 128,
  height: 64,
  address: 0x3C
};

var oled = new oled(opts);

oled.turnOnDisplay();
oled.clearDisplay();

var font = require('oled-font-5x7');
oled.setCursor(1, 1);
oled.writeString(font, 1, 'Cats and dogs are really cool animals, you know.', 1, true);
TypeError: "callback" argument must be a function
  at setTimeout (timers.js:427:11)
  at Oled._waitUntilReady (/opt/node/oledtest/node_modules/oled-js-pi/oled.js:156:3)
  at Oled._updateDirtyBytes (/opt/node/oledtest/node_modules/oled-js-pi/oled.js:428:10)
  at Oled.clearDisplay (/opt/node/oledtest/node_modules/oled-js-pi/oled.js:341:10)
  at Object.<anonymous> (/opt/node/oledtest/oled.js:12:6)
  at Module._compile (module.js:635:30)
  at Object.Module._extensions..js (module.js:646:10)
  at Module.load (module.js:554:32)
  at tryModuleLoad (module.js:497:12)
  at Function.Module._load (module.js:489:3)
  at Function.Module.runMain (module.js:676:10)
  at startup (bootstrap_node.js:187:16)
  at bootstrap_node.js:608:3

Please advise.

@sltmunky69
Copy link
Author

sltmunky69 commented Dec 5, 2017

This appears to be a fork of oled-js, so I am just taking a stab in the dark here, should setTimeout(tick(callback), 0); possibly be setTimeout(function(){tick(callback)}, 0); instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant