Skip to content

Instantly share code, notes, and snippets.

View YuuichiAkagawa's full-sized avatar

Yuuichi Akagawa YuuichiAkagawa

View GitHub Profile
@YuuichiAkagawa
YuuichiAkagawa / gr_sketch.cpp
Created January 22, 2013 14:49
HelloADK sketch for RLduino78
/*
* HelloADK
* Android ADK(AOA1.0) sample sketch for RLduino78
* Copyright (C) 2013 Yuuichi Akagawa
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@YuuichiAkagawa
YuuichiAkagawa / gist:6326737
Created August 24, 2013 07:52
Physicaloid UART config sample
UartConfig paramUart = new UartConfig(115200, UartConfig.DATA_BITS8, UartConfig.STOP_BITS1, UartConfig.PARITY_NONE, false, false);
if(mPhysicaloid.open(paramUart)) {
//...
} else {
//...
}
@YuuichiAkagawa
YuuichiAkagawa / MainActivity.java
Created November 13, 2013 15:58
SBBLE(Konashi) sample program
/*
* SBBLE(Konashi) sample program
* Copyright (C) 2013 Yuuichi Akagawa
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
package org.ammlab.android.usbmiditest;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.LinkedList;
import android.hardware.usb.UsbConstants;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbEndpoint;
@YuuichiAkagawa
YuuichiAkagawa / MainActivity.java
Created February 16, 2014 15:04
konashi-android-sdkでSBBLEのLチカサンプル
package org.ammlab.android.konashitest;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.RelativeLayout;
import android.widget.ToggleButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
#include <stdio.h>
#include <libusb-1.0/libusb.h>
#include <unistd.h>
#define MBED_VENDOR_ID 0x1f00
#define MBED_PRODUCT_ID 0x2012
#define IF_CDCACM 0
#define IF_CDCDATA 1
#define BUFFER 1024
#define EPIN 0x82
//gcc -o test_ez_read test_ez_read.c -lusb
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <usb.h>
//Define
#define USB_VENDOR 0x1f00
#include "stdio.h"
#include "stdio.h"
#include <unistd.h>
#include "mraa.h"
int main(int argc, char **argv)
{
mraa_gpio_context gpio;
gpio = mraa_gpio_init(13); //Edison Arduino Expansion Board D13
@YuuichiAkagawa
YuuichiAkagawa / usbh_midi.cpp
Created October 29, 2014 11:50
work around for several midi keyborads.
/*
*******************************************************************************
* USB-MIDI class driver for USB Host Shield 2.0 Library
* Copyright 2012-2013 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