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
 
@@ -26,15 +26,15 @@
 
#define DATATYPES_SENSOR 8
 
#define DATATYPES_GEIGER 4
 
#define DATATYPES_CAMERA 3
 
 
//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
 
 #define BOARDTEMP_ADDR 0x90	// Read 0x91 - Write 0x90
 
 #define PRESSURE_ADDR 0xEE		// Read 0xEF - Write 0xEE
 
 #define HUMID_ADDR 0x27		// Read 0x28 - Write 0x27
slave/slave/modules.c
Show inline comments
 
@@ -148,24 +148,24 @@
 
 void modules_cameras()
 
 {
 
	// Gathers data and performs functions for cameras daughter board
 
		
 
		//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
 
@@ -34,12 +34,14 @@
 
#include "lib/cameras.h"
 
#include "lib/loopTimer.h"
 
#include "lib/masterComm.h"
 
#include "lib/watchdog.h"
 

	
 
bool WDTreset = false;
 
 uint32_t lastPicture;
 
 uint8_t pulseOn;
 

	
 
void micro_setup()
 
{
 
	// Generic microcontroller config options
 
	WDTreset = ((MCUSR & 0b00001000) > 0);	// Check if WDT reset occured
 
	MCUSR = 0;		// Clear reset flags
 
@@ -103,12 +105,31 @@ int main(void)
 
// Writes ID to EEPROM, change for all modules and delete after programming
 
// 0 is for generic setup,	 1 is for sensors,	 2 is for Geiger,	3 is for cameras
 
//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();
 
			}
 
		}
 

	
 
    }
 
	
 
	return 0;
 
}
 

	
 

	
0 comments (0 inline, 0 general)