Changeset - 006bbb89fd70
[Not reviewed]
default
0 3 0
mkroening@CL-ENS241-07.cedarville.edu - 12 years ago 2013-03-20 17:04:51
mkroening@CL-ENS241-07.cedarville.edu
Camera control
3 files changed with 26 insertions and 3 deletions:
0 comments (0 inline, 0 general)
slave/slave/lib/cameras.c
Show inline comments
 
@@ -28,6 +28,19 @@
 
	 zmsb = i2c_read(ACCEL_ADDR, 0x05);
 
 }
 
 
 
 void cameras_sendPulse()
 
 {
 
	 PORTA |= (1 << PA0);	// Pull pin on usb high
 
	 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()
 
 {
 
	 return xmsb;
slave/slave/lib/cameras.h
Show inline comments
 
@@ -11,6 +11,7 @@
 
 
 
void cameras_readAccelXYZ(void);	// Reads acceleration values
 
void cameras_sendPulse(void);
 
 
int8_t cameras_getAccelX(void);		// Returns x-acceleration
 
int8_t cameras_getAccelY(void);		// Returns y-acceleration
slave/slave/modules.c
Show inline comments
 
@@ -106,7 +106,10 @@
 
  
 
 void modules_cameras_setup()
 
 {
 
	  	  
 
	 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
 
	 DDRA |= (1 << DDA3);	// Set PA3 to Output for Camera
 
 }
 
  
 
 
@@ -137,7 +140,13 @@
 
 void modules_cameras()
 
 {
 
	// Gathers data and performs functions for cameras daughter board
 
	cameras_readAccelXYZ();
 
  
 
	int16_t pcount;
 
	if pcount == 1000
 
	{
 
		cameras_readAccelXYZ();
 
		cameras_sendPulse();
 
		pcount = 0;
 
	}
 
	pcount	++;  
 
 } 
 
  
 
\ No newline at end of file
0 comments (0 inline, 0 general)