Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcus Linderoth msloth

View GitHub Profile
@msloth
msloth / client-lighting-example.c
Last active Dec 6, 2018
When light is on, also turns on a GPIO (DIO7). Light output via PWM on DIO5. Has a default schedule (see code).
View client-lighting-example.c
#include "thsq.h"
#include "ti-lib.h"
#include "gpio-interrupt.h"
#include "lib/sensors.h"
#include "batmon-sensor.h"
#include "dev/leds-arch.h"
#include "dev/cc26xx-uart.h"
/*---------------------------------------------------------------------------*/
View lighting-client-with-motion-sensor.c
#include "thsq.h"
#include "ti-lib.h"
#include "gpio-interrupt.h"
#include "lib/sensors.h"
#include "batmon-sensor.h"
#include "dev/leds-arch.h"
#include "dev/cc26xx-uart.h"
/*---------------------------------------------------------------------------*/
@msloth
msloth / client-launchpad.c
Last active Dec 12, 2017
The client file for the Thingsquare firmware SDK used for the demo binaries.
View client-launchpad.c
#include "thsq.h"
#include "ti-lib.h"
#include "gpio-interrupt.h"
#include "lib/sensors.h"
#include "batmon-sensor.h"
#include "dev/leds-arch.h"
#include "dev/cc26xx-uart.h"
/*---------------------------------------------------------------------------*/
void
init_leds(void)
View lighting-switch.c
#include "thsq.h"
#include "ti-lib.h"
/*---------------------------------------------------------------------------*/
/*
* Thingsquare lighting switch with slider.
*
* This client uses a linear potentiometer to set the dim level of the lights
* in the network. To save power, we only power the potentiometer when we will
* sample it, and we only send light control if it has moved enough.
*
You can’t perform that action at this time.