Go Down

Topic: Arduino MEGA e Adafruit serial camera (Read 2764 times) previous topic - next topic


Ho fatto un programma per fare foto e mandarle ad un webServer.
Con Arduino UNO tutto funziona.
Adesso vorrei passare al MEGA rev3.

Lasciando tutto come prima non trova la camera perchè immagino non vada qualcosa con la seriale tra la camera e Arduino.

Code: [Select]
SoftwareSerial cameraconnection = SoftwareSerial(6, 7);
Adafruit_VC0706 cam = Adafruit_VC0706(&cameraconnection);

Devo cambiare qualcosa?



nell'esempio scrivono questo

// With the Arduino Mega, the choices are a bit more involved:
// 1) You can still use SoftwareSerial and connect the camera to
// a variety of pins...BUT the selection is limited. The TX
// pin from the camera (RX on the Arduino, and the first
// argument to SoftwareSerial()) MUST be one of: 62, 63, 64,
// 65, 66, 67, 68, or 69. If MEGA_SOFT_SPI is set (and using
// a conventional Arduino SD shield), pins 50, 51, 52 and 53
// are also available. The RX pin from the camera (TX on
// Arduino, second argument to SoftwareSerial()) can be any
// pin, again excepting those used by the SD card.
// 2) You can use any of the additional three hardware UARTs on
// the Mega board (labeled as RX1/TX1, RX2/TX2, RX3,TX3),
// but must specifically use the two pins defined by that
// UART; they are not configurable. In this case, pass the
// desired Serial object (rather than a SoftwareSerial
// object) to the VC0706 constructor.

e suggeriscono questa configurazione

// On Mega: camera TX connected to pin 69 (A15), camera RX to pin 3:
SoftwareSerial cameraconnection = SoftwareSerial(69, 3);

provare non costa niente


Ho trovato, nel MEGA ci sono 3 seriali dedicate.

Code: [Select]
Adafruit_VC0706 cam = Adafruit_VC0706(&Serial1);

Serial1 è la prima seriale aggiuntiva sul MEGA e non va dichiarata.

Go Up