Seems like the latest firmware it's quite stable so i decided to start playing with my oak.
One of the major advantages of this tiny board is the wifi connectivity and also the ability to control it through Particle's API.
I'm using documentation for Particle's photon as it seems to be very similar (actually identical).
Below is code on how to control a pin through a web request.
Flash this code with the help of arduino software:
int ledToggle(String command) {
if (command=="on") {
Particle.publish("ON","OAK3");
digitalWrite(2, HIGH);
return 1;
}
else if (command=="off") {
Particle.publish("OFF","OAK3");
digitalWrite(2, LOW);
return 0;
}
else {
return -1;
}
}
void setup(){
Particle.function("led",ledToggle);
pinMode(2, OUTPUT);
}
void loop(){
}Monitor the progress through Particle dashboard. I noticed that it takes up to 5 minutes to compile and flash OAK so be patient.
Once you see that flash status is successful you can control OAK with a REST request:
You can find your device id from from
https://dashboard.particle.io/user/devicesAccess token can be found from
https://build.particle.io at settings section (bottom left)
curl https://api.particle.io/v1/devices/[device-id]/led/?access_token=[access token] -d params=on
curl https://api.particle.io/v1/devices/[device-id]/led/?access_token=[access token] -d params=off