Skip to content

Instantly share code, notes, and snippets.

View toyowata's full-sized avatar

Toyomasa Watarai toyowata

View GitHub Profile
@toyowata
toyowata / shrink_sysinc.pl
Last active August 29, 2015 14:03
armccのプリプロセスファイルから展開されたシステムインクルードファイルを削除するスクリプト
#!/usr/local/bin/perl
#
# Copyright 2010-2012 ARM Limited. All Rights Reserved.
# <toyomasa.watarai@arm.com>
# shrink_sysinc.pl - tries to remove expanded system include file from preprocessed source code
#
# Usage: shrink_sysinc.pl test.ii > test.cpp
# TODO:
@toyowata
toyowata / private_settings.py
Last active March 10, 2017 00:39
My private_settings.py for mbed SDK
"""
mbed SDK
Copyright (c) 2011-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
@toyowata
toyowata / gist:607b736589520d94538c
Last active November 18, 2016 16:52
Fork/Cloneしたリポジトリを本家リポジトリに追従する
$ git remote add upstream git@github.com:mbedmicro/mbed.git
$ git fetch upstream
$ git merge upstream/master
$ git push

$ git remote add xxx_work git@github.com:mbedmicro/mbed_private_xxx.git
@toyowata
toyowata / gist:b9d3b832fc5feb65872f
Last active August 29, 2015 14:04
DS-5の表示言語を英語に切り替える方法

DS-5の表示言語を英語に切り替える方法

  • DS-5を終了させる
  • 以下のファイルをエディタで開く
C:\Users\xxxxxx\AppData\Roaming\ARM\DS-5\workbench\configuration\config.ini

上記ディレクトリ名は、私の設定です(ユーザー名はログインユーザになります)。

  • config.iniの最後の行に以下を追加する
@toyowata
toyowata / utf8_conv.py
Last active August 29, 2015 14:05
Generate UTF-8 to Kuten code conversion table - UTF-8の有効ビット位置だけ取り出し、区点コード変換テーブルを再生成する
#!/usr/bin/env python
#encoding=utf-8
# Generate UTF-8 to Kuten code conversion table
#
# You can find the UTF-8 table here:
# http://ash.jp/code/unitbl21.htm
def print_expanded_address(table):
print "const uint32_t GT20L16Y1J_address_table[] = {"
@toyowata
toyowata / img2pwmout.py
Last active August 29, 2015 14:12
Convert image file to grayscale array data - 画像ファイルをグレースケール配列に変換する
#!/usr/bin/env python
#encoding=utf-8
# Convert image to Pwmout grayscale data for dot-matrix LED
# Input image format can be JPEG, PNG etc
from PIL import Image
import sys
if __name__ == "__main__":
@toyowata
toyowata / clone_mbed_user_repo.py
Last active December 9, 2019 06:49
Create backup from mbed user code repository
#! /usr/bin/env python
# coding: utf-8
# This script creates copy from mbed user code repository
# You must install Mercurial package (pip install mercurial)
#
# Usage: python clone_mbed_user_repo.py <mbed_user_name> <password> <sessionid_developer of coockei>
# e.g. $ python clone_mbed_user_repo.py MACRUM password kjdt3hu1loppvyyxq60nhokssa1k48ul
#
# <sessionid_developer> can be found from developer tool of the web brawser
@toyowata
toyowata / lp_ticker.c
Last active January 22, 2016 00:52
LowerPower ticker implementation for LPC1768
/*
* Copyright (c) 2016 ARM Limited
* 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
*

mbed Connector REST API examples

  • リソース表示
curl -v -H "Authorization: Bearer <your_access_key>" https://api.connector.mbed.com/endpoints/06774a8c-1de8-45d5-a9ed-006c2454dc8c
  • データ取得
curl -v -H "Authorization: Bearer your_access_key Connection: keep-alive" https://api.connector.mbed.com/notification/pull
@toyowata
toyowata / main.cpp
Created March 14, 2016 12:02
Arduino M0 Proでmbedのコードを動かす ref: http://qiita.com/toyowata/items/2b2e71928b86fd829771
#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);