Skip to content

Instantly share code, notes, and snippets.

View gharis's full-sized avatar

Gami_H gharis

  • Sri Lanka Colombo
View GitHub Profile
// callback4.cpp - C++11 Lambda Callback
// To build:
// g++ -std=c++11 callback4.cpp
// Situation: A "Caller" class allows another class "Callee"
// to connect to it via callback. How to implement this?
// A C++11 lambda function can be used.
@vjames19
vjames19 / ox_sensor.c
Last active April 16, 2016 12:54
Get oxygen sensor data through UART for the msp430fr5739
#include <stdlib.h>
#include <string.h>
#include "msp430.h"
unsigned int CV = 0;
unsigned int DV = 0;
char RO = '0';
const double CRITICAL_OXYGEN_LEVEL = 1.5;
volatile double oxygenThreshold = 2;
volatile double oxygen = 15; // assign a value greater than 2