Skip to content

Instantly share code, notes, and snippets.

View houmei's full-sized avatar

Katunori Takesita houmei

View GitHub Profile
@houmei
houmei / PS2Keyboard.cpp
Created April 8, 2012 05:13
Arduino PS2Keyboard Library for Japanese
/*
PS2Keyboard.cpp - PS2Keyboard library
Copyright (c) 2007 Free Software Foundation. All right reserved.
Written by Christian Weichel <info@32leaves.net>
** Mostly rewritten Paul Stoffregen <paul@pjrc.com> 2010, 2011
** Modified for use beginning with Arduino 13 by L. Abraham Smith, <n3bah@microcompdesign.com> *
** Modified for easy interrup pin assignement on method begin(datapin,irq_pin). Cuningan <cuninganreset@gmail.com> **
for more information you can read the original wiki in arduino.cc
@houmei
houmei / PS2Keyboard.cpp
Created April 11, 2012 04:12
Arduino PS2Keyboard Library for Japanese - kana
/*
PS2Keyboard.cpp - PS2Keyboard library
Copyright (c) 2007 Free Software Foundation. All right reserved.
Written by Christian Weichel <info@32leaves.net>
** Mostly rewritten Paul Stoffregen <paul@pjrc.com> 2010, 2011
** Modified for use beginning with Arduino 13 by L. Abraham Smith, <n3bah@microcompdesign.com> *
** Modified for easy interrup pin assignement on method begin(datapin,irq_pin). Cuningan <cuninganreset@gmail.com> **
for more information you can read the original wiki in arduino.cc
@houmei
houmei / mouseclick.ino
Created May 10, 2012 08:39
Arduino IDE1.0 Leonardo(Davinci) Mouse.click() / Mouse.release() sample
/* Button for Keyboard (Arduino Leonardo only) */
/*
Button
Turns on and off a light emitting diode(LED) connected to digital
pin 13, when pressing a pushbutton attached to pin 2.
@houmei
houmei / LCDtest.ino
Created May 16, 2012 14:10
Arduino UNO LCD test
// include the library code:
#include <LiquidCrystal.h>
unsigned int t;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(9, 8, 7, 6, 5, 4);
void setup() {
// set up the LCD's number of columns and rows:
@houmei
houmei / spacekey.ino
Created May 23, 2012 14:57
Arduino IDE1.0.1 Leonardo USB-HID Keyboard test
/* Button for Keyboard (Arduino Leonardo only) */
/*
Button
Turns on and off a light emitting diode(LED) connected to digital
pin 13, when pressing a pushbutton attached to pin 2.
The circuit:
@houmei
houmei / ctrlaltdel.ino
Created May 23, 2012 16:38
Leonardo USB-HID Keyboard test CTRL+ALT+DELETE
/* Button for Keyboard (Arduino Leonardo only) */
/*
Button
Turns on and off a light emitting diode(LED) connected to digital
pin 13, when pressing a pushbutton attached to pin 2.
The circuit:
@houmei
houmei / ps2kybd.cpp
Created July 3, 2012 13:17
PS/2Keyboard for Arduino Uno/Leonardo 20120703 test
/*
http://arduino.cc/playground/Main/PS2Keyboard
http://arduino.cc/playground/Main/PS2KeyboardExt2
http://msdn.microsoft.com/en-us/library/windows/hardware/gg463446.aspx
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
@houmei
houmei / PS2kybd.cpp
Created July 5, 2012 22:56
PS/2Keyboard for Arduino Uno/Leonardo 20120706 test
/*
http://arduino.cc/playground/Main/PS2Keyboard
http://arduino.cc/playground/Main/PS2KeyboardExt2
http://msdn.microsoft.com/en-us/library/windows/hardware/gg463446.aspx
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
@houmei
houmei / us2jp.ino
Created August 25, 2012 11:15
Arduino Leonardo US layout Keyboard -> JP layout Keyboard (test)
#include <PS2kybd.h>
// Simple test program for new PS2Keyboard library
// Connect a PS2 keyboard to pins 3 & 4 (CLK and DATA respectively) and supply 5V to the keyboard
// For examples, see here: http://www.arduino.cc/playground/ComponentLib/Ps2mouse
// or here: http://www.beyondlogic.org/keyboard/keybrd.htm
// That second article is a great place to start if you want to understand whats going on
//
// When you've compiled the code and uploaded it to the board, start a serial monitor at
// 9600bd. Then press keys on your PS2 keyboard (the one connected to Arduino, not the one
@houmei
houmei / openPort
Created September 2, 2012 17:06
openPort (MacOSX)
#include <termios.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int openPort( const char *path, int speed, int bits, int parity, int stops, int openFlags)
24 {