Changeset - 9a399fff43f2
[Not reviewed]
default
0 4 0
mkroening@CL-ENS241-07.cedarville.edu - 12 years ago 2013-03-14 16:28:30
mkroening@CL-ENS241-07.cedarville.edu
Accelerometer firmware
4 files changed with 34 insertions and 2 deletions:
0 comments (0 inline, 0 general)
slave/slave/config.h
Show inline comments
 
@@ -37,6 +37,7 @@
 
 #define PRESSURE_ADDR 0xEE		// Read 0xEF - Write 0xEE
 
 #define HUMID_ADDR 0x26		// Read 0x27 - Write 0x26
 
 #define LIGHT_ADDR 0x94		// Read 0x95 - Write 0x94
 
 #define ACCEL_ADDR	0x38		// Read 0x39 - Write 0x38
 
 #define RTC_ADDR 0xB2			//DEBUG [Used for testing]      // Read 0xA3 - Write 0xA2
 
 
slave/slave/lib/cameras.c
Show inline comments
 
@@ -13,5 +13,32 @@
 
 #include <util/delay.h>
 
 #include "cameras.h"
 
 
 
 #include "i2c.h"
 
 
 
 
 
\ No newline at end of file
 
 int8_t xmsb;	// Acceleration data in x-direction (MSB)
 
 int8_t ymsb;	// Acceleration data in y-direction (MSB)
 
 int8_t zmsb;	// Acceleration data in z-direction (MSB)
 
 
 
 
 
 
 
 void cameras_readAccelXYZ()
 
 {
 
	 xmsb = i2c_read(ACCEL_ADDR, 0x01);
 
	 ymsb = i2c_read(ACCEL_ADDR, 0x03);
 
	 zmsb = i2c_read(ACCEL_ADDR, 0x05);
 
 }
 
 
 
 int8_t cameras_getAccelX()
 
 {
 
	 return xmsb;
 
 }
 
 
 
 int8_t cameras_getAccelY()
 
 {
 
	 return ymsb;
 
 }
 
 
 
 int8_t cameras_getAccelZ()
 
 {
 
	 return zmsb;
 
 }
 
\ No newline at end of file
slave/slave/lib/cameras.h
Show inline comments
 
@@ -10,7 +10,10 @@
 
#define CAMERAS_H_
 
 
 
void cameras_readAccelXYZ(void);	// Reads acceleration values
 
 
 
int8_t cameras_getAccelX(void);		// Returns x-acceleration
 
int8_t cameras_getAccelY(void);		// Returns y-acceleration
 
int8_t cameras_getAccelZ(void);		// Returns z-acceleration
 
 
#endif /* CAMERAS_H_ */
 
\ No newline at end of file
slave/slave/modules.c
Show inline comments
 
@@ -139,6 +139,7 @@
 
 void modules_cameras()
 
 {
 
	// Gathers data and performs functions for cameras daughter board
 
	cameras_readAccelXYZ();
 
  
 
 } 
 
  
 
\ No newline at end of file
0 comments (0 inline, 0 general)