diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2021-12-10 15:55:54 -0500 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2021-12-10 15:55:54 -0500 |
commit | e4f9737e21b6489be04e43f0af23aa968dba9ac2 (patch) | |
tree | 17475ccb72febde21425530eddce606f0176e23a /apps/Sensor Watch Accelerometer Test | |
parent | 8571bfa74f4de75fbb55b37e97de80351f5e92fe (diff) | |
parent | 762af872d2f2c977e51d6e51b8c3ad622485cc05 (diff) | |
download | Sensor-Watch-e4f9737e21b6489be04e43f0af23aa968dba9ac2.tar.gz Sensor-Watch-e4f9737e21b6489be04e43f0af23aa968dba9ac2.tar.bz2 Sensor-Watch-e4f9737e21b6489be04e43f0af23aa968dba9ac2.zip |
Merge branch 'main' into movement-timer-stuff
Diffstat (limited to 'apps/Sensor Watch Accelerometer Test')
-rw-r--r-- | apps/Sensor Watch Accelerometer Test/app.c | 84 | ||||
-rwxr-xr-x | apps/Sensor Watch Accelerometer Test/make/.gitignore | 1 | ||||
-rwxr-xr-x | apps/Sensor Watch Accelerometer Test/make/Makefile | 10 |
3 files changed, 0 insertions, 95 deletions
diff --git a/apps/Sensor Watch Accelerometer Test/app.c b/apps/Sensor Watch Accelerometer Test/app.c deleted file mode 100644 index bea00f6f..00000000 --- a/apps/Sensor Watch Accelerometer Test/app.c +++ /dev/null @@ -1,84 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <math.h> -#include "watch.h" -#include "lis2dh.h" - -// This application displays data from the old Sensor Watch Motion sensor board. -// Note that this board required A0 to be set high to power the sensor. -// Future accelerometer boards will be powered directly from VCC. -// Also note that this board has its INT1 pin wired to A1, which is not an external -// wake pin. Future accelerometer boards will wire interrupt pins to A2 and A4. - -void cb_light_pressed() { -} - -void cb_mode_pressed() { -} - -void cb_alarm_pressed() { -} - -uint8_t interrupts = 0; -uint8_t last_interrupts = 0; -uint8_t ticks = 0; -char buf[13] = {0}; - -void cb_interrupt_1() { - interrupts++; -} - -void cb_tick() { - if (++ticks == 30) { - last_interrupts = interrupts; - interrupts = 0; - ticks = 0; - } -} - -void app_init() { - gpio_set_pin_direction(A0, GPIO_DIRECTION_OUT); - gpio_set_pin_function(A0, GPIO_PIN_FUNCTION_OFF); - gpio_set_pin_level(A0, true); - - watch_enable_display(); - watch_display_string("IN 0 0 0", 0); - - watch_enable_external_interrupts(); - watch_register_interrupt_callback(BTN_MODE, cb_mode_pressed, INTERRUPT_TRIGGER_RISING); - watch_register_interrupt_callback(BTN_LIGHT, cb_light_pressed, INTERRUPT_TRIGGER_RISING); - watch_register_interrupt_callback(BTN_ALARM, cb_alarm_pressed, INTERRUPT_TRIGGER_RISING); - - watch_enable_i2c(); - - lis2dh_begin(); - lis2dh_set_data_rate(LIS2DH_DATA_RATE_10_HZ); - lis2dh_configure_aoi_int1( - LIS2DH_INTERRUPT_CONFIGURATION_OR | - LIS2DH_INTERRUPT_CONFIGURATION_X_HIGH_ENABLE | - LIS2DH_INTERRUPT_CONFIGURATION_Y_HIGH_ENABLE | - LIS2DH_INTERRUPT_CONFIGURATION_Z_HIGH_ENABLE, 96, 0, true); - - watch_register_interrupt_callback(A1, cb_interrupt_1, INTERRUPT_TRIGGER_RISING); - watch_rtc_register_tick_callback(cb_tick); -} - -void app_wake_from_backup() { -} - -void app_setup() { -} - -void app_prepare_for_standby() { -} - -void app_wake_from_standby() { -} - -bool app_loop() { - sprintf(buf, "IN%2d%3d%3d", ticks, interrupts, last_interrupts); - watch_display_string(buf, 0); - - return true; -} diff --git a/apps/Sensor Watch Accelerometer Test/make/.gitignore b/apps/Sensor Watch Accelerometer Test/make/.gitignore deleted file mode 100755 index 567609b1..00000000 --- a/apps/Sensor Watch Accelerometer Test/make/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build/ diff --git a/apps/Sensor Watch Accelerometer Test/make/Makefile b/apps/Sensor Watch Accelerometer Test/make/Makefile deleted file mode 100755 index c66ad20c..00000000 --- a/apps/Sensor Watch Accelerometer Test/make/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -TOP = ../../.. -include $(TOP)/make.mk - -INCLUDES += \ - -I../ - -SRCS += \ - ../app.c - -include $(TOP)/rules.mk |