Skip to content

Instantly share code, notes, and snippets.

View YuuichiAkagawa's full-sized avatar

Yuuichi Akagawa YuuichiAkagawa

View GitHub Profile
@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
/* 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
// 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)
#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 <Max3421e.h>
#include <Usb.h>
#include <AndroidAccessory2.h>
#define JOYSTICK_VERT A0
#define JOYSTICK_HORZ A1
#define JOYSTICK_SEL A2
#define DIVIDER 32
#define LED1 3
@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