Skip to content

Instantly share code, notes, and snippets.

@t-kashima
t-kashima / Sketch.ino
Created May 28, 2015 13:19
RTC8564 for Arduino
// http://arms22.blog91.fc2.com/blog-entry-232.html
#include <Wire.h>
#include <RTC8564.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Rtc.begin();
}
@t-kashima
t-kashima / ApplicationActivity.java
Created May 27, 2015 09:47
ButterKnife and RxAndroid for Android
package com.example.kashima.myapplication;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.TextView;
import butterknife.ButterKnife;
@t-kashima
t-kashima / Sketch.ino
Created May 25, 2015 10:18
LED display timer for Arduino
// 参考: http://garretlab.web.fc2.com/arduino/introduction/beginning_with_7segment_led/
int num[10][8] = {
{0, 0, 1, 0, 1, 0, 0, 0}, // 0
{1, 1, 1, 0, 1, 0, 1, 1}, // 1
{0, 0, 1, 1, 0, 0, 1, 0}, // 2
{1, 0, 1, 0, 0, 0, 1, 0}, // 3
{1, 1, 1, 0, 0, 0, 0, 1}, // 4
{1, 0, 1, 0, 0, 1, 0, 0}, // 5
{0, 0, 1, 0, 0, 1, 0, 0}, // 6
@t-kashima
t-kashima / Sketch.c
Last active August 29, 2015 14:21
LED display stop watch for Arduino
// アソードコモンのため0の場所が光る
int num[10][8] = {
{0, 0, 1, 0, 1, 0, 0, 0}, // 0
{1, 1, 1, 0, 1, 0, 1, 1}, // 1
{0, 0, 1, 1, 0, 0, 1, 0}, // 2
{1, 0, 1, 0, 0, 0, 1, 0}, // 3
{1, 1, 1, 0, 0, 0, 0, 1}, // 4
{1, 0, 1, 0, 1, 1, 0, 0}, // 5
{0, 0, 1, 0, 1, 1, 0, 0}, // 6
{1, 1, 1, 0, 1, 0, 0, 0}, // 7
@t-kashima
t-kashima / Sketch.java
Created May 21, 2015 16:24
Alarm clock for Arduino
// Now time
#define START_HOUR 1
#define START_MINUTES 21
// Alarm
#define ALARM_HOUR 1
#define ALARM_MINUTES 22
bool isRing = false;
int nowHour = START_HOUR;
@t-kashima
t-kashima / Sketch.java
Created May 21, 2015 14:52
Red-rays distance sensor for Android
void setup() {
Serial.begin(9600);
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
@t-kashima
t-kashima / Sketch.java
Created May 21, 2015 14:27
Slide swith and speaker for Arduino
void setup() {
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, INPUT);
digitalWrite(12, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
@t-kashima
t-kashima / Sketch.java
Last active August 29, 2015 14:21
Slide switch and LED for Arduino
void setup() {
// put your setup code here, to run once:
pinMode(12, OUTPUT);
pinMode(13, INPUT);
pinMode(11, OUTPUT);
digitalWrite(12, HIGH);
}
void loop() {
@t-kashima
t-kashima / Sketch.java
Created May 21, 2015 06:05
LED Input/Output for Arduino
bool isHigh = true;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(12, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
@t-kashima
t-kashima / ViewController.swift
Created May 14, 2015 14:19
ReactiveCocoa for swift
import UIKit
import ReactiveCocoa
class ViewController: UIViewController {
@IBOutlet var textInput: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.