Skip to content

Instantly share code, notes, and snippets.

View YuuichiAkagawa's full-sized avatar

Yuuichi Akagawa YuuichiAkagawa

View GitHub Profile
#include "FluentLogger.h"
FluentLogger logger("192.168.10.100");
// for fluentd
void send_fluentd()
{
uMP mp(64);
mp.init();
mp.set_map(3); // 3 items
// Include ---------------------------------------------------------------------------------------
#include "mbed.h"
#include "rtos.h"
#define BAUD(x) pcx.baud(x)
#define GETC(x) pcx.getc(x)
#define PUTC(x) pcx.putc(x)
#define PRINTF(...) pcx.printf(__VA_ARGS__)
#define READABLE(x) pcx.readable(x)
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@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
#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
//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 <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
@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;
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;