Using ATWINC1500 WiFi Breakout and TTL Serial Camera

Hey all,

I’m trying to use both my Adafruit TTL Serial JPEG Camera with NTSC Video and Adafruit ATWINC1500 WiFi Breakout in the same circuit with my official Arduino MEGA 256. I have my camera connected to TX RX (18, 19) and my wifi breakout connected properly. I can use my camera to take a picture successfully and I can use the wifi module to run the examples in Wifi101 successfully (independently). But, then when I go to run the code below (testing both in same circuit), the wifi module never responds but the camera succeeds setupCamera(). In fact, I get sporadic behavior after I run this code because after I upload it, sometimes the wifi module fails to do even the Example sketches of Wifi101 after. Any idea whats causing this conflict?

#include <Adafruit_VC0706.h>
#include <SPI.h>
#include <WiFi101.h>

#define WLAN_SSID "TEST"        // cannot be longer than 32 characters!
#define WLAN_PASS "PASSWORD"

Adafruit_VC0706 cam = Adafruit_VC0706(&Serial1);
WiFiClient client;
int status = WL_IDLE_STATUS;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  setupCamera();
  setupWifi();
}

void setupCamera() {
  if (cam.begin()) {
    Serial.println("Camera found:");
  } else {
    Serial.println("Camera not found !");
    return;
  }
  cam.setImageSize(VC0706_640x480);
  delay(3000);
  if (!cam.takePicture()) {
    Serial.println("Failed to snap!");
  } else {
    Serial.println("Picture taken!");
  }
}

void setupWifi() {
  WiFi.setPins(8, 7, 4);
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    // don't continue:
    while (true);
  }

  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(WLAN_SSID);
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(WLAN_SSID);

    // wait 10 seconds for connection:
    delay(10000);
  }
  Serial.println("Connected to wifi");
  printWifiStatus();

  // Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

void loop() {
  // put your main code here, to run repeatedly:
}

I am basically trying to follow this guide:

https://openhomeautomation.net/wireless-camera/

with the parts listed above.

I can post pictures if requested. I really need help with this for a school project!!!

with my official Arduino MEGA 256.

Does that have 1/10th the memory of a 2560?

Why does taking a picture happen in setupCamera()?

You need to post links to the hardware (camera and wifi shield) along with links to the libraries you are using. I can't begin to guess what pins 8, 7, and 4 are supposed to be used for.

and my wifi breakout connected properly.

Says who?