Skip to content

Instantly share code, notes, and snippets.

@tomovwgti
tomovwgti / pub.py
Last active March 5, 2020 20:43
MQTT publish
#!/usr/bin/python
# Copyright (c) 2014 Roger Light <roger@atchoo.org>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Distribution License v1.0
# which accompanies this distribution.
#
# The Eclipse Distribution License is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
@tomovwgti
tomovwgti / sub.py
Created April 18, 2014 14:39
MQTT subscribe
#!/usr/bin/python
# Copyright (c) 2010-2013 Roger Light <roger@atchoo.org>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Distribution License v1.0
# which accompanies this distribution.
#
# The Eclipse Distribution License is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
@tomovwgti
tomovwgti / gist:8781055
Created February 3, 2014 09:43
Xively取得例
{
"auto_feed_url": "https://api.xively.com/v2/feeds/1495248008.json",
"created": "2014-01-28T01:09:26.992036Z",
"creator": "https://xively.com/users/tomo_watanabe",
"datastreams": [
{
"at": "2014-02-03T09:42:19.028303Z",
"current_value": "33",
"id": "Humidity",
"max_value": "34.0",
@tomovwgti
tomovwgti / led.js
Created December 25, 2013 06:16
きんねこさんへ
var b = require('bonescript');
b.pinMode('USR0', b.OUTPUT);
b.pinMode('USR1', b.OUTPUT);
b.pinMode('USR2', b.OUTPUT);
b.pinMode('USR3', b.OUTPUT);
b.digitalWrite('USR0', b.HIGH);
b.digitalWrite('USR1', b.HIGH);
b.digitalWrite('USR2', b.HIGH);
@tomovwgti
tomovwgti / Master.c
Last active January 1, 2016 07:09
TOCOS TWE-LiteのシリアルアプリApp_Uart の受信側のプロンプトを無くします。
if (len == 0) {
// ハンドル名なし
// vfPrintf(&sSerStream, LB"[%08X:%d] ", sSerSeqRx.u32SrcAddr, sSerSeqRx.u8ReqNum);
sSerCmdOut.u16len -= 2; // 本文の長さに設定
} else {
// ハンドル名あり
// vfPrintf(&sSerStream, LB"[%s:%d] ", &sSerCmdOut.au8data[i+1], sSerSeqRx.u8ReqNum);
sSerCmdOut.u16len = i; // 本文の長さに設定
}