This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.o | |
*.elf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set XTAL 32768 Hz on the board | |
void main(void) { | |
// Stop Watchdog | |
WDTCTL = WDTPW + WDTHOLD; | |
// MCLK:LFXT1CLK/8 | |
// SMCLK:LFXT1CLK | |
BCSCTL2 = 0xF8; | |
// IO setup | |
P1DIR = 0xFF; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <msp430g2211.h> | |
#define I2C_SDA BIT0 // Serial Data line | |
#define I2C_SCL BIT6 // Serial Clock line | |
/* A crude delay function. Tune by changing the counter value. */ | |
void delay( unsigned int n ) { | |
volatile int i; | |
for( ; n; n-- ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An ATmega328P on a breadboard powered under 3.3v (2x AA battery) | |
Arduino bootloader at 8 MHz internal RC clock. | |
This example code is in the public domain. | |
Share it's happiness !!! | |
*/ | |
#include <SPI.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# ping a list of host with threads for increase speed | |
# use standard linux /bin/ping utility | |
from threading import Thread | |
import subprocess | |
try: | |
import queue | |
except ImportError: | |
import Queue as queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Relay: | |
def __init__(self): | |
self.value = False | |
self._value = False | |
@property | |
def state(self): | |
"""Get the current relay state.""" | |
return self.value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rrdtool | |
import datetime | |
# retrieve RRD data (3 days past from now) | |
rrd = rrdtool.fetch('/home/pi/rrd/flow.rrd', 'AVERAGE', '-s -3d') | |
# timestamp start/end | |
start = rrd[0][0] | |
end = rrd[0][1] | |
step = rrd[0][2] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Automatic install of Thingspeak server on Debian jessie | |
# Updated to use ruby 2.1.4 | |
## check root level | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def get_frost_point_c(t_air_c, dew_point_c): | |
"""Compute the frost point in degrees Celsius | |
:param t_air_c: current ambient temperature in degrees Celsius | |
:type t_air_c: float | |
:param dew_point_c: current dew point in degrees Celsius | |
:type dew_point_c: float |
OlderNewer