Skip to content

Instantly share code, notes, and snippets.

View YuuichiAkagawa's full-sized avatar

Yuuichi Akagawa YuuichiAkagawa

View GitHub Profile
/* 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
/*
* A piezo transducer is wired to pins 19 and 18 to trigger
* cycling through the Record/Play/Stop modes. The code can
* be altered to also work with a simple push button.
*/
#include <usbh_midi.h>
#include <usbhub.h>
#ifdef dobogusinclude
#include <spi4teensy3.h>
#include <usbh_midi.h>
#include <usbhub.h>
#ifdef dobogusinclude
#include <spi4teensy3.h>
#include <SPI.h>
#endif
USB Usb;
USBH_MIDI Midi(&Usb);
void USB::initialise()
{
/* Configure the USB0 host pins(USB0_OVRCURA and USB0_VBUSEN) needed */
// protection got turned off in hardware setup
// MPC.PWPR.BIT.B0WI = 0; // Enable write to PFSWE bit
// MPC.PWPR.BIT.PFSWE = 1; // Disable write protection to PFS registers
/* Use this for GR-Sakura and RSK */
PORT1.PDR.BIT.B6 = 1; // P16 is an output pin
PORT1.PCR.BIT.B6 = 1; // P16 is an output pin
MPC.P16PFS.BIT.PSEL = 0x12; // Configure as USB0_VBUSEN pin
/* GR-SAKURA Sketch Template V2.06 */
#include <Arduino.h>
//USBDesc
#include <usbhub.h>
#define Serial Serial1
#define BUFSIZE 256 //buffer size
#define LOBYTE(x) ((char*)(&(x)))[0]
#define HIBYTE(x) ((char*)(&(x)))[1]
cat << EOT > /etc/udev/rules.d/51-usbblaster.rules
# USB-Blaster
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="666"
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="666"
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="666"
# USB-Blaster II
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="666"
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="666"
/* mbed Microcontroller Library
* Copyright (c) 2015 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