Changeset - f7fad1196562
[Not reviewed]
default
0 3 0
mkroening@CL-ENS241-07.cedarville.edu - 12 years ago 2013-03-21 16:56:16
mkroening@CL-ENS241-07.cedarville.edu
Camera functions
3 files changed with 21 insertions and 11 deletions:
0 comments (0 inline, 0 general)
slave/slave/lib/cameras.c
Show inline comments
 
@@ -34,11 +34,6 @@
 
	 PORTA |= (1 << PA1);	// Pull pin on usb high
 
	 PORTA |= (1 << PA2);	// Pull pin on usb high
 
	 PORTA |= (1 << PA3);	// Pull pin on usb high
 
	 _delay_ms(250);
 
	 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
 
 }
 
 
 
 int8_t cameras_getAccelX()
slave/slave/modules.c
Show inline comments
 
@@ -15,8 +15,10 @@
 
 #include "lib/i2c.h"
 
 #include "lib/sensors.h"
 
 #include "lib/loopTimer.h"
 
 #include "lib/led.h"
 
 
 
 uint32_t lastPicture;
 
 uint8_t pulseOn;
 
 
 
 void modules_setup(uint8_t id)
 
 {
 
@@ -109,6 +111,9 @@
 
  
 
 void modules_cameras_setup()
 
 {
 
	 lastPicture = time_millis();
 
	 pulseOn = time_millis();	 
 
	 
 
	 DDRA |= (1 << DDA0);	// Set PA0 to Output for Camera
 
	 DDRA |= (1 << DDA1);	// Set PA1 to Output for Camera
 
	 DDRA |= (1 << DDA2);	// Set PA2 to Output for Camera
 
@@ -143,15 +148,24 @@
 
 void modules_cameras()
 
 {
 
	// Gathers data and performs functions for cameras daughter board
 
 
		
 
		cameras_readAccelXYZ();
 
		
 
		if ((time_millis() - lastPicture) > CAMERA_FREQ)	// Frequency of photos
 
		if ((time_millis() - pulseOn) > CAMERA_PULSE)
 
		{
 
			cameras_sendPulse();
 
			lastPicture = time_millis();
 
			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();
 
		}
 
			
 
 
		
 
 } 
 
  
 
\ No newline at end of file
slave/slave/slave.c
Show inline comments
 
@@ -87,6 +87,7 @@ int main(void)
 
		if ((time_millis() - lastLoop) > SENSOR_LOOP)	// Uses program timer to run every so often. Time interval defined in config.h
 
		{
 
			led_on(0);
 
			
 
			sensors_readBatt();				// Read Battery level
 
			sensors_readBoardTemp();		// Read board temperature sensor (Common on all slaves) (Data Read)
 
			modules_run(io_getModuleId());	// Runs specific module functions (like data reading)
0 comments (0 inline, 0 general)