Skip to content

Instantly share code, notes, and snippets.

View YuuichiAkagawa's full-sized avatar

Yuuichi Akagawa YuuichiAkagawa

View GitHub Profile
@YuuichiAkagawa
YuuichiAkagawa / gist:1816195
Created February 13, 2012 11:30
lsusb output
Bus 002 Device 002: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0403 Future Technology Devices International, Ltd
//*****************************************************************************
//
// avrpindef.h - AVR pin definition template
//
// Copyright(C) 2012 Yuuichi Akagawa
//
/* This code was inspired by the Konstantin Chizhov's AVR port templates */
@YuuichiAkagawa
YuuichiAkagawa / gist:2635426
Created May 8, 2012 14:13
nanoKEY configuration descriptor
nanoKEY configuration descriptor
0000: 09 02 53 00 01 01 00 80 32 09 04 00 00 02 01 03
0010: 00 00 07 24 01 00 01 41 00 06 24 02 01 01 03 06
0020: 24 02 02 02 00 09 24 03 01 03 01 02 01 04 09 24
0030: 03 02 04 01 01 01 00 09 05 82 02 40 00 01 00 00
0040: 05 25 01 01 03 09 05 02 02 40 00 00 00 00 05 25
0050: 01 01 01
Configuratin 09 02 53 00 01 01 00 80 32
Interface 09 04 00 00 02 01 03 00 00
package org.ammlab.android.delonkun;
import android.app.Activity;
import android.media.*;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
public class DelonkunActivity extends Activity {
ToneGenerator toneGenerator;
@YuuichiAkagawa
YuuichiAkagawa / gist:2769515
Created May 22, 2012 14:45
Arduino Leonard with HID lsusb
Bus 002 Device 005: ID 2341:8036
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
@YuuichiAkagawa
YuuichiAkagawa / gist:2851004
Created June 1, 2012 10:22
FileInputStream.available() on Android Accessory read thread
W/System.err( 3981): java.io.IOException: Invalid argument
W/System.err( 3981): at org.apache.harmony.luni.platform.OSFileSystem.ioctlAvailable(Native Method)
W/System.err( 3981): at dalvik.system.BlockGuard$WrappedFileSystem.ioctlAvailable(BlockGuard.java:241)
W/System.err( 3981): at java.io.FileInputStream.available(FileInputStream.java:138)
W/System.err( 3981): at org.ammlab.android.helloadk.HelloADKActivity.run(HelloADKActivity.java:261)
W/System.err( 3981): at java.lang.Thread.run(Thread.java:1019)
@YuuichiAkagawa
YuuichiAkagawa / gist:3187576
Created July 27, 2012 11:54
USBH_MIDI send MIDI message sample
/*
*******************************************************************************
* USB-MIDI to Legacy Serial MIDI converter
* Copyright 2012 Yuuichi Akagawa
*
* Idea from LPK25 USB-MIDI to Serial MIDI converter
* by Collin Cunningham - makezine.com, narbotic.com
*
* for use with USB Host Shield 2.0 from Circuitsathome.com
* https://github.com/felis/USB_Host_Shield_2.0
@YuuichiAkagawa
YuuichiAkagawa / gist:3474852
Created August 26, 2012 06:08
GR-SAKURA Serial parity check enable
#include <rxduino.h>
#include <iodefine_gcc63n.h>
void setup()
{
Serial.begin( 115200, SCI_SCI0P2x );
//SCI0 偶数パリティ有効
SCI0.SCR.BIT.TE = 0;
SCI0.SCR.BIT.RE = 0;
SCI0.SMR.BIT.PE = 1;
SCI0.SMR.BIT.PM = 0;
@YuuichiAkagawa
YuuichiAkagawa / gr_sketch.cpp
Last active October 10, 2015 11:17
Kondo's SerialServo(ICS3.5) control sample for GR-SAKURA
#include <rxduino.h>
#include <iodefine_gcc63n.h>
void sendCommand(unsigned char *data, unsigned short len)
{
Serial.write((const unsigned char*)data, len);
delay(2);
}
void setServoPos(unsigned char ServoID, unsigned short pos)
@YuuichiAkagawa
YuuichiAkagawa / FTDriver_PO_S2
Created December 18, 2012 09:25
FTDriver 9600bps, Data:8bit, Parity:ODD, StopBit:2
mSerial.begin(FTDriver.BAUD19200);
mSerial.setSerialPropertyParity(FTDriver.FTDI_SET_DATA_PARITY_ODD, FTDriver.CH_A);
mSerial.setSerialPropertyStopBits(FTDriver.FTDI_SET_DATA_STOP_BITS_2, FTDriver.CH_A);
mSerial.setSerialPropertyToChip(FTDriver.CH_A);