smaffer / vgax

VGA library for Arduino UNO
430 stars 81 forks source link

Was able to fix the demo for me by disabling audio #28

Open jaltekruse opened 1 year ago

jaltekruse commented 1 year ago

I don't necessarily expect a fix for this to be implemented in the library, but I just wanted to report that this was really easy to get set up, but I did experience a visual glitch I was able to isolate to the audio signal.

This small change to the example to disable the tone generation got me a stable picture. Might be worth mentioning as a potential debugging step if others might run into the same trouble and aren't concerned about running audio. I am working with a clone of the MEGA 2560 from ELEGOO.

  void loop() {
  static unsigned cnt;
  if (!(cnt % 10))
    vga.noTone();

  // add this line
  cnt++;               

  //if (!(cnt++%20))          <--- comment out these two lines
  //  vga.tone(cnt*10+11);    <--- but you still need to increment cnt if you want the picture to change

    if (cnt>=160)
    cnt=0;