'LIS2DW12 accelerometer tilt angle detection using STM32L496AG
I am using LIS2DW12 Accelerometer for tilt angle detection
I can now get a interrupt trigger from the accelerometer when it crosses the threshold value given in the WAKE_UP_THS register in one direction(either clockwise or counter clock wise).
Is it possible to detect the tilt angle in both directions and trigger the interrupt event in wakeup interrupt mode?
It is possible in 6d orientation mode, but I need wakeup interrupt mode since I have to detect the tilt angles from 10 degrees.
Please suggest a suitable solution.
Solution 1:[1]
The return values from AsyncStorage.multiGet(keys) is not a stringified JSON but an array of tuples. To get the values you need to do the following:
const viewUser = async () => {
console.log('Loading');
try {
const keys = await AsyncStorage.getAllKeys()
const items = await AsyncStorage.multiGet(keys)
// items is an array of tuples with first value as the key and second as the value
let data = {}
items.forEach(item => {
data[item[0]] = item[1]
})
} catch (error) {
console.log(error, "problem")
}
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Varun Gupta |
