How to get events from accelerometer

Hi bjarne,

We were planning to provide coding assist in the web based frontend. For now, you have to find the functions in source code here github.com/Seeed-Studio/Grove_Drivers_for_Wio and find the class instance name with any of the following method

a) API call
curl iot.seeed.cc/v1/cotf/project?ac … 32dd8277b2

you will get a response like this

{
“./Main.h”: “#ifndef MAIN_H\r\n#define MAIN_H\r\n#include “suli2.h”\r\n#include “grove_generic_digital_in_gen.h”\r\n\r\nextern GenericDIn *GenericDInD1_ins;\r\n#endif\r\n”,
“./Main.cpp”: “#include “wio.h”\n#include “suli2.h”\n#include “Main.h”\n\nvoid setup()\n{\n}\n\nvoid loop()\n{\n\n}\n”
}

In this example, I configured Wio Link to drive the “generic digital input” device. The instance of the driver class is GenericDInD1_ins and then find member functions of this class here github.com/Seeed-Studio/Grove_D … gital_in.h

b) API reference page in app

From the API url , e.g. 192.168.31.2/v1/node/GenericDIn … 76056505c8, the section after /node/ is GenericDInD1, then add a suffix “_ins” to it, you will get the instance name GenericDInD1_ins

Having the instance name and its member functions, you can program ULB like this

[code]uint8_t input;

void loop()
{

GenericDInD1_ins-> read_input(&input);
if(input > 0) …

}[/code]

To put the Wio to sleep in ULB, you can call void system_deep_sleep(uint32 time_in_us) One thing should be noticed that there’s possibility bricking the Wio if not programed properly. Once this happened, must reflash the firmware for Wio with the esp8266 flash tool or esptool here github.com/igrr/esptool-ck. We’re study the failsafe mechanism…

Because the ULB is still in dev, any suggestion from your digging is appreciated.