mirror of
				https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
				synced 2025-11-04 09:25:13 +01:00 
			
		
		
		
	Integrate IMU into Power Management
This commit is contained in:
		@@ -6,6 +6,10 @@ MotionDetection::MotionDetection(){
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void MotionDetection::begin(void){
 | 
					void MotionDetection::begin(void){
 | 
				
			||||||
 | 
					    Power::waitForCurrentAllowance(
 | 
				
			||||||
 | 
					        PowerParameters::PowerConsumers::IMU,
 | 
				
			||||||
 | 
					        PowerParameters::CurrentConsumptions::CURRENT_IMU,
 | 
				
			||||||
 | 
					        IMU_MAX_EXECUTION_DELAY_MS, NULL);
 | 
				
			||||||
    pinMode(34,OUTPUT);
 | 
					    pinMode(34,OUTPUT);
 | 
				
			||||||
    digitalWrite(34,HIGH);
 | 
					    digitalWrite(34,HIGH);
 | 
				
			||||||
    handler->begin(36,37,35,34);
 | 
					    handler->begin(36,37,35,34);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,9 +10,13 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
#ifndef MotionDetection_h
 | 
					#ifndef MotionDetection_h
 | 
				
			||||||
#define MotionDetection_h
 | 
					#define MotionDetection_h
 | 
				
			||||||
#include <SPI.h>
 | 
					#include "../power/Power.h"
 | 
				
			||||||
#include <Arduino.h>
 | 
					 | 
				
			||||||
#include "IMU_CMDs.h"
 | 
					#include "IMU_CMDs.h"
 | 
				
			||||||
 | 
					#include <Arduino.h>
 | 
				
			||||||
 | 
					#include <SPI.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IMU_MAX_EXECUTION_DELAY_MS 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct IMUResult{
 | 
					struct IMUResult{
 | 
				
			||||||
    int16_t x;
 | 
					    int16_t x;
 | 
				
			||||||
    int16_t y;
 | 
					    int16_t y;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user