Skip to content

Instantly share code, notes, and snippets.

Toyomasa Watarai toyowata

Block or report user

Report or block toyowata

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@toyowata
toyowata / main.cpp
Created Dec 9, 2018
reboot device example for simple-mbed-cloud-client template
View main.cpp
// ----------------------------------------------------------------------------
// Copyright 2016-2018 ARM Ltd.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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
View microbit_neopixel.js
let last_value = 0
let 傾き = 0
let rainbow: neopixel.Strip = null
rainbow = neopixel.create(DigitalPin.P0, 30, NeoPixelMode.RGB)
rainbow.showRainbow(1, 360)
last_value = 0
basic.forever(() => {
傾き = input.rotation(Rotation.Pitch)
if (last_value != 傾き) {
rainbow.rotate(傾き)
@toyowata
toyowata / How-to-sync-forked-repo.md
Created Jan 24, 2017
How to sync forked repository
View How-to-sync-forked-repo.md

Do this once:

$ git remote add upstream git@github.com:armmbed/mbed-os.git

And do this when need to sync:

$ git fetch upstream
$ git merge upstream/master
$ git push
@toyowata
toyowata / gpio_irq_api.c
Created Sep 16, 2016
Fix gpio_irq_api.c for LPC11U68
View gpio_irq_api.c
/* 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
@toyowata
toyowata / How-to-add-new-DAPLink-target.MD
Last active Aug 13, 2016
DAPLink 新規ターゲットの追加
View How-to-add-new-DAPLink-target.MD
@toyowata
toyowata / esp8266_test.py
Last active Jun 26, 2018
AT command test code for the ESP8266 WiFi module
View esp8266_test.py
#! /usr/bin/env python
# codeing: utf-8
import serial
def send_normal_command(cmd):
ser.write(cmd)
rcv_buf = ""
while rcv_buf != "OK\r\n":
rcv_buf = ser.readline()
@toyowata
toyowata / pwmout_api.c
Created May 19, 2016
[mbed LPC81x] fix output conflit
View pwmout_api.c
/* 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
@toyowata
toyowata / how-to-install-yotta-os-x.md
Last active Mar 22, 2016
yotta がインストール(アップデート)できない場合の対処方法(OS X)
View how-to-install-yotta-os-x.md

yotta がインストール(アップデート)できない場合の対処方法(OS X)

OS X版で yotta をアップデートしようとしたのですが、以下のようなエラーが出て、インストールできませんでした。

$ sudo pip install yotta
# snip
Requirement already satisfied (use --upgrade to upgrade): Cython in /Library/Python/2.7/site-packages (from hidapi->pyOCD<1.0,>=0.3->valinor<1.0,>=0.0.0->yotta)
Installing collected packages: setuptools, enum34, ipaddress, idna, pycparser, cffi, cryptography, PyJWT, pathlib, functools32, jsonschema, argcomplete, mbed-test-wrapper, pyyaml, intelhex, hidapi, pyOCD, argparse, xmltodict, project-generator-definitions, project-generator, pyelftools, valinor, jsonpointer, yotta
@toyowata
toyowata / main.cpp
Created Mar 14, 2016
Arduino M0 Proでmbedのコードを動かす ref: http://qiita.com/toyowata/items/2b2e71928b86fd829771
View main.cpp
#include "mbed.h"
DigitalOut myled(PA17);
Serial pc(PB22, PB23);
int main() {
pc.printf("hello, mbed world.\n");
while(1) {
myled = 1;
wait(0.2);
You can’t perform that action at this time.