Skip to content

Instantly share code, notes, and snippets.

View TareObjects's full-sized avatar

Koichi Kurahashi TareObjects

View GitHub Profile
@TareObjects
TareObjects / gist:cc4f2de76a0669dbb38c
Last active August 29, 2015 14:14
MSP430G2553+Large 7SegLED Digital Clock with RTC(internal oscillator)
// Digital Clock : by Akizuki's Large LED and Energia/MSP430G2553
// 秋月巨大液晶利用のデジタル時計/温度計
//
// 2015-01-27 : リリース
// 2015-01-31 : コロンの明るさをPWMで調整
#include <sRTC.h>
#include <legacymsp430.h>
RealTimeClock myRTC;
@TareObjects
TareObjects / gist:391695aacbdd9e4f4239
Last active August 29, 2015 14:15
Send e-mail from BoneScript
var b = require('bonescript');
var exec = require('child_process').exec, child;
var fs = require('fs');
var filename = '/root/test.msg';
function sendMessage(to, subject, message) {
// create message file
var msg = 'To: ' + to + '\n' + 'Subject: ' + subject + '\n' + message + '\n';
@TareObjects
TareObjects / gist:6cfe0e05c32e7c55b892
Last active August 29, 2015 14:15
dual PIR sensor logger, with email alert on Beaglebone black / BoneScript
// Read PIR, Write csv, Push to ShowSensor
//
// 2015-02-11 : add function : send email when out door sensor detect a visitor
//
var b = require('bonescript');
var fs = require('fs');
var http = require('http');
var exec = require('child_process').exec, child; // for mail
var mailfile = '/root/sendmail.msg'; // for mail
#include "mbed.h"
#include "SLCD.h"
#include "MAG3110.h"
#include "fft4g.h"
#include "aqm1248a_lcd.h"
#define NMAX 256
#define NMAXSQRT 32
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#include <EtherCard.h>
#include <Wire.h>
#include <HDC1000.h>
#include <Adafruit_MPL115A2.h>
#define USE_DHCP 0
#define USE_DNS 0
//
/*
$Id:$
ST7565 LCD library!
Copyright (C) 2010 Limor Fried, Adafruit Industries
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
/*
$Id:$
ST7565 LCD library!
Copyright (C) 2010 Limor Fried, Adafruit Industries
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
#include <ST7565.h>
#define NMAX 256
#define NMAX_HALF (NMAX/2)
#define NMAXSQRT 16
#define MAX(x,y) ((x) > (y) ? (x) : (y))
// fft buffer / workarea
float micBuffer[NMAX+1];
// pin P1.6:15 - Serial data out (MOSI)
// pin P1.5: 7 - Serial clock out (SCLK)
// pin P5.7:17 - Data/Command select (RS or A0)
// pin P2.5:19 - LCD reset (RST)
// pin P3.0:18 - LCD chip select (CS)
ST7565 lcd(15, 7, 17, 19, 18);
void setupTaskLCD() {
#include "mbed.h"
#include "rtos.h"
AnalogIn vol(dp4);
AnalogIn mea(dp11);
AnalogIn fre(dp13);
PwmOut pwm(dp18);
PwmOut led(dp1);
float prevPwm = 0.0;