Skip to content

Instantly share code, notes, and snippets.

#include <SPI.h>
#define SHIFT_REGISTER_CS 5
void setup() {
// SPI
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
@tawashi5454
tawashi5454 / gist:1392678
Created November 25, 2011 02:28
USB Keyboard for Rhinoceros
#define BUTTON_1 10
#define BUTTON_2 11
#define BUTTON_3 12
#define BUTTON_4 13
#define DELAY_DURATION 300
#define NL 0x0A
@tawashi5454
tawashi5454 / gist:1366964
Created November 15, 2011 12:27
Arduino USB Keyboard
/**
* VirtualUsbKeyboard
*
* Enumerates itself as a HID (Human Interface Device) to a host
* computer using a USB shield. The Arduino then appears to the host to
* be a USB keyboard and keypress events can be sent on demand.
*
* This example watches the state of 6 push buttons and when a button
* is pressed it sends a matching keypress event to the host.
*
@tawashi5454
tawashi5454 / mainp18.c
Created May 4, 2011 10:12
Simple LED blink on PIC18F2420
#include <p18cxxx.h>
#include <delays.h>
#pragma config OSC=HS, WDT=OFF, LVP=OFF
void main(void){
// ポートAを出力に設定する
TRISA = 0;
// 永久に繰り返す