Skip to content

Instantly share code, notes, and snippets.

View msloth's full-sized avatar

Marcus Linderoth msloth

View GitHub Profile
#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.
*
@msloth
msloth / client-launchpad.c
Last active December 12, 2017 17:20
The client file for the Thingsquare firmware SDK used for the demo binaries.
#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)
@msloth
msloth / lighting-client-with-motion-sensor.c
Created June 29, 2018 17:24
Modified client launchpad
#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-lighting-example.c
Last active December 6, 2018 19:49
When light is on, also turns on a GPIO (DIO7). Light output via PWM on DIO5. Has a default schedule (see code).
#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 / ttag.sh
Created April 5, 2022 11:09
Simple time-tracking utility
#------------------------------------------------------------------------------
# time-tag utility
#
# This below goes into your ~/.bashrc
#
# simple utility that appends to a log, to be able to check for how
# long time an activity lasted
#
# usage
# ttag PROJECT ACTIVITY