Changeset - b0d10bd06ea7
[Not reviewed]
default
0 3 0
mkroening@CL-ENS241-07.cedarville.edu - 12 years ago 2013-04-03 16:53:51
mkroening@CL-ENS241-07.cedarville.edu
Camera fn in while1
3 files changed with 37 insertions and 16 deletions:
0 comments (0 inline, 0 general)
slave/slave/config.h
Show inline comments
 
@@ -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
slave/slave/modules.c
Show inline comments
 
@@ -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
slave/slave/slave.c
Show inline comments
 
@@ -37,6 +37,8 @@
 
#include "lib/watchdog.h"
 

	
 
bool WDTreset = false;
 
 uint32_t lastPicture;
 
 uint8_t pulseOn;
 

	
 
void micro_setup()
 
{
 
@@ -106,6 +108,25 @@ int main(void)
 
			
 
		}
 

	
 
		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();
 
			}
 
		}
 

	
 
    }
 
	
 
	return 0;
0 comments (0 inline, 0 general)