I've been using the VGA library for some graphics sketches I've been working with on the Due. This has worked fine.
I decided I'd like to be able to control the VGA graphic display via WiFi. I have a official Arduino WiFi shield that I've gotten working independently. It took a bit of research in order to find out how to flash the firmware on the WiFi Shield to get it to work with IDE 1.5.3 and the Due, but it does work and transfers data back and forth across a socket connection. I wrote a Java application to test it, and seems to work fine.
However, once I try to combine the VGA library and the Wifi Library into the same sketch, nothing seems to work. No Serial output, no VGA output, no WiFi connection. I assume there's either a DMA, SPI, or timer interrupt conflict.
This simple code does not work. I'm not even accessing the WiFi or SPI libraries at all, but somehow just including them is causing the VGA library to quit working:
#include <WiFi.h>
#include <SPI.h>
#include <VGA.h>
void setup() {
//Start the serial connection.
Serial.begin(9600);
//Start the VGA library at 320x240 resolution at 8-bit color.
VGA.begin(320,240,VGA_COLOUR);
}//End setup
void loop() {
//Fill the frame buffer.
for (int y=0;y<240;y++)
{
for (int x=0;x<320;x++)
{
//Generate random color.
byte color =random(255);
//The serial calls make the VGA display very slow
//but have this here to make sure it's working.
Serial.print("(");
Serial.print(x);
Serial.print(",");
Serial.print(y);
Serial.print(") = ");
Serial.println(color,HEX);
//Draw the color on the screen.
VGA.drawPixel(x,y,color);
}
}
}//End loop
However, commenting out
#include <WiFi.h>
allows the VGA display to work correctly.
Any thoughts on what the conflict is here, or what could be done to work-around the problem?