i have lcd display , piezo sounder, included starter kit. both work fine example sketches.
however, if try use them minute issues tone() command, lcd screen corrupted. have read on forums vpm pins 3 , 11 affected tone(). therefore not using these , have tried analoguewrite rather tone(), nothing changes.
anytime sound piezo, screen corrupted.
a simple example code fails is:
// include library code:
#include <liquidcrystal.h>
// initialize library numbers of interface pins
liquidcrystal lcd(12, 5, 6, 4, 7, 2);
void setup() {
// set lcd's number of columns , rows:
lcd.begin(16, 2);
// print message lcd.
lcd.print("hello, world!");
pinmode(8, output);
tone (8, 256, 1000);
// "hello world" corrupted , lcd shows rubbish on
}
sorry if obvious, first arduino project.
grateful help.
however, if try use them minute issues tone() command, lcd screen corrupted. have read on forums vpm pins 3 , 11 affected tone(). therefore not using these , have tried analoguewrite rather tone(), nothing changes.
anytime sound piezo, screen corrupted.
a simple example code fails is:
// include library code:
#include <liquidcrystal.h>
// initialize library numbers of interface pins
liquidcrystal lcd(12, 5, 6, 4, 7, 2);
void setup() {
// set lcd's number of columns , rows:
lcd.begin(16, 2);
// print message lcd.
lcd.print("hello, world!");
pinmode(8, output);
tone (8, 256, 1000);
// "hello world" corrupted , lcd shows rubbish on
}
sorry if obvious, first arduino project.
grateful help.
i tried code on arduino/lcd setup -- changed pins following because didn't want rewire lcd.
it works fine me, no errors. maybe picture of wiring help...
code: [select]
liquidcrystal lcd(9, 8, 7, 6, 5, 4);
pinmode(2, output);
tone (2, 256, 1000);
it works fine me, no errors. maybe picture of wiring help...
Arduino Forum > Using Arduino > Displays > LCD Panel interference with Tone()
arduino
Comments
Post a Comment