Hala Shiekh Mummo
Published

Fall Detector Alarm using Hexabitz

This project implements a safe, wearable alarm system in combination with a necklace to detect falls for young walking babies.

IntermediateFull instructions provided16 hours298
Fall Detector Alarm using Hexabitz

Things used in this project

Story

Read more

Schematics

Hexabitz Fall Detection Android app

Install this app to your phone to test the project

Code

Fall Detector Alarm using Hexabitz

C/C++
Use Hexabitz 0.2.5 release firmware and build this code
https://github.com/HexabitzPlatform/H0BR4x-Firmware
https://github.com/HexabitzPlatform/H01R0x-Firmware
https://github.com/HexabitzPlatform/H23Rxx-Firmware
/*
 BitzOS (BOS) V0.2.5 - Copyright (C) 2017-2021 Hexabitz
 All rights reserved

 File Name     : main.c
 Description   : Main program body.
 */
/* Includes ------------------------------------------------------------------*/
#include "BOS.h"

/* Private variables ---------------------------------------------------------*/

float ax = 0.0f;
float ay = 0.0f;
float az = 0.0f;


/* Private function prototypes -----------------------------------------------*/

/* Main function ------------------------------------------------------------*/

int main(void){
	
	Module_Init();		//Initialize Module &  BitzOS
	
	//Don't place your code here.
	for(;;){
	}
}

/*-----------------------------------------------------------*/

/* User Task */
void UserTask(void *argument){

	
	// put your code here, to run repeatedly.
	while(1){
         SampleAccG(&ax, &ay, &az);
          if(ax<=0.99){
                      messageParams[0] = 0;
                      messageParams[1] = GREEN;
                      messageParams[2] = 15;
                      SendMessageToModule(2, CODE_H01R0_COLOR, 3);
                      }
          else if(ax>1){
                      messageParams[0] = RED;
                      messageParams[1] = RGB_DIM_UP_DOWN_WAIT;
                      messageParams[2] = (uint8_t)(30000>>24);
                      messageParams[3] = (uint8_t)(30000>>16);
                      messageParams[4] = (uint8_t)(30000>>8);
                      messageParams[5] = (uint8_t)(30000);
                      messageParams[6] = (uint8_t)(1000>>24);
                      messageParams[7] = (uint8_t)(1000>>16);
                      messageParams[8] = (uint8_t)(1000>>8);
                      messageParams[9] = (uint8_t)(1000);
                      messageParams[10] = 0;
                      messageParams[11] = 0;
                      messageParams[12] = 0;
                      messageParams[13] = 1;
                      SendMessageToModule(2, CODE_H01R0_DIM, 14);
                      writePxMutex(P3, (char*)"a",1 , cmd50ms, HAL_MAX_DELAY);
                      }
          }
	}
/*-----------------------------------------------------------*/

Credits

Hala Shiekh Mummo
11 projects • 18 followers
MSc of Electronic Engineering
Contact

Comments

Please log in or sign up to comment.