pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT
Dependencies: mbed MMA8451Q USBDevice WakeUp vt100
Fork of afero_node_suntory_2017_06_15 by
Tilt.hpp
00001 #if defined (TARGET_TEENSY3_1) 00002 #if 0 00003 #ifndef _MARUSOL_SENSOR_MANAGER_TILT_H_ 00004 #define _MARUSOL_SENSOR_MANAGER_TILT_H_ 00005 00006 #include "mbed.h" 00007 #include "ToDoQ.h" 00008 #include "RTC_Handler.h" 00009 #include "SensorCommonMembers.hpp" 00010 #include "CommonTemplateRoutines.hpp" 00011 00012 #define BUBBLE 0 00013 #define STOP 1 00014 #define BEER 2 00015 #define EMPTY 4 00016 00017 NAMESPACE_MARUSOLSENSORMANAGER_START 00018 00019 class Tilt : public ToDo, public SensorCommonMembers 00020 { 00021 static Tilt *self; 00022 Tilt(); 00023 uint8_t Q_newVal[10]; 00024 uint8_t Q_oldVal[10]; 00025 time_t Q_time[10]; 00026 uint16_t Q_oldValDuration[10]; 00027 Ticker tilt_tick; 00028 uint16_t tlt_counter1,tlt_counter2,tlt_counter3,oldcount; 00029 const uint16_t TLT_COUNTER; 00030 uint8_t oldval,newval,val; 00031 DigitalIn tlt_beer; 00032 DigitalIn tlt_bubble; 00033 void initQ(); 00034 void _read_tilt(); 00035 void putQ(uint8_t oldVal, uint8_t newVal, uint16_t duration, time_t time); 00036 void getQ(uint8_t *oldVal, uint8_t *newVal, uint16_t *duration, time_t *time); 00037 uint32_t loopTiltDelay; 00038 public: 00039 DECL_GET_INSTANCE(Tilt); 00040 virtual void toJSON(char*); 00041 virtual void getBytes(uint8_t*); 00042 static void read_tilt(); 00043 static void onLoop(); 00044 }; 00045 00046 NAMESPACE_MARUSOLSENSORMANAGER_END 00047 00048 #endif //_MARUSOL_SENSOR_MANAGER_TILT_H_ 00049 #endif 00050 #endif //TARGET_TEENSY3_1
Generated on Thu Jul 14 2022 06:24:36 by 1.7.2