diff --git a/slave/slave/config.h b/slave/slave/config.h --- a/slave/slave/config.h +++ b/slave/slave/config.h @@ -29,9 +29,9 @@ //Sensors and IO #define SENSOR_LOOP 200 // Frequency of sensor reads (in ms) (should be 200) -#define HEATER_THRESHOLD 77 // Temperature threshold in Fahrenheit where heater is activated -#define CAMERA_FREQ 10000 // Camera pulse frequency (Should be 30000 for 30 Secs) -#define CAMERA_PULSE 500 // Camera pulse duration +#define HEATER_THRESHOLD 0 // Temperature threshold in Fahrenheit where heater is activated +#define CAMERA_FREQ 5000 // Camera pulse frequency (Should be 30000 for 30 Secs) +#define CAMERA_PULSE 2500 // Camera pulse duration //I2C Addresses #define EEPROM_ADDR 0xA0 // Read 0xA1 - Write 0xA0 diff --git a/slave/slave/modules.c b/slave/slave/modules.c --- a/slave/slave/modules.c +++ b/slave/slave/modules.c @@ -151,21 +151,21 @@ //cameras_readAccelXYZ(); - if ((time_millis() - pulseOn) > CAMERA_PULSE) - { - PORTA &= ~(1 << PA0); // Pull pin on usb low - PORTA &= ~(1 << PA1); // Pull pin on usb low - PORTA &= ~(1 << PA2); // Pull pin on usb low - PORTA &= ~(1 << PA3); // Pull pin on usb low + //if ((time_millis() - pulseOn) > CAMERA_PULSE) + //{ + // PORTA &= ~(1 << PA0); // Pull pin on usb low + // PORTA &= ~(1 << PA1); // Pull pin on usb low + // PORTA &= ~(1 << PA2); // Pull pin on usb low + // PORTA &= ~(1 << PA3); // Pull pin on usb low - if ((time_millis() - lastPicture) > CAMERA_FREQ) // Frequency of photos - { - cameras_sendPulse(); - lastPicture = time_millis(); - } + // if ((time_millis() - lastPicture) > CAMERA_FREQ) // Frequency of photos + // { + // cameras_sendPulse(); + // lastPicture = time_millis(); + // } - pulseOn = time_millis(); - } + // pulseOn = time_millis(); + //} } \ No newline at end of file diff --git a/slave/slave/slave.c b/slave/slave/slave.c --- a/slave/slave/slave.c +++ b/slave/slave/slave.c @@ -37,6 +37,8 @@ #include "lib/watchdog.h" bool WDTreset = false; + uint32_t lastPicture; + uint8_t pulseOn; void micro_setup() { @@ -105,6 +107,25 @@ int main(void) //i2c_write(EEPROM_ADDR, 0x05, 0x03); } + + if (io_getModuleId() == 3); + { + if ((time_millis() - pulseOn) > CAMERA_PULSE) + { + PORTA &= ~(1 << PA0); // Pull pin on usb low + PORTA &= ~(1 << PA1); // Pull pin on usb low + PORTA &= ~(1 << PA2); // Pull pin on usb low + PORTA &= ~(1 << PA3); // Pull pin on usb low + + if ((time_millis() - lastPicture) > CAMERA_FREQ) // Frequency of photos + { + cameras_sendPulse(); + lastPicture = time_millis(); + } + + pulseOn = time_millis(); + } + } }