福野泰介の一日一創 - create every day

お菓子IoT 重量センサーと32x16ドットマトリクスで食べ過ぎ防止 / Diet IoT with pressure sensor and 32x16 matrix LED by IchigoJam x sakura.io

2017/05/03
#IchigoJam #maker #IoT #english 

食べ過ぎて困る!?圧力センサーで測った重さを大きく表示しつつ、重量の変化をサーバーに送る「お菓子IoT」をつくってみました。
Use pressure sensor to diet!


お菓子の量を重さで監視して、変化があったら sakura.io で送信!
Send the number if the weight change.


肝はこの圧力センサーFSR402(500円@秋月電子)
Pressure sensor!


圧力センサーの片方に1kΩの抵抗を介してVCCとアナログ入力へのワイヤー、もう片方をGNDに接続。
Pressure sensor (terminal A, B)
A: --+-- 1kΩ -- VCC
      +-- BTN(ANA)
B: -- GND


32x16ドットマトリクス(500円@共立デジット)はダイナミック点灯が必要。BASICでは速度がでないのでマシン語化!
Machine language is so fast!

32x16 dot matrix LED
VCC - VCC(IchigoJam)
SIN_1 - OUT1
SIN_2 - OUT2
SIN_3 - OUT3
CLOCK - OUT4
LATCH - OUT5
/ENABLE - OUT6
VLED - 5V
GND - GND

こちらお菓子IoTのプログラム (source of Diet IoT) *for IchigoJam 1.2b46

1 '32x16 MATLED driver 100 POKE#700,240,181,10,38,5,0,31,0,0,36,137,176,0,146,118,66,40,0,10,33,184,71,51,0,67,67,93,25,237,0,0,155,129,53,255,53,93,25,4,171,229,80,4,52,5,0,16,44 110 POKE#730,238,209,100,32,5,155,0,147,4,155,1,147,7,155,2,147,6,155,3,147,4,34,82,66,1,33,19,29,153,64,0,37,140,70,128,35,97,70,35,76,27,2,25,64,35,0,0,41 120 POKE#760,0,209,11,0,32,73,33,79,11,128,7,42,52,216,0,155,128,33,155,92,9,2,27,2,30,0,1,155,41,65,155,92,30,67,51,0,11,64,0,208,22,75,59,128,2,155,3,159 130 POKE#790,155,92,191,92,27,2,59,67,11,64,0,208,17,75,20,73,11,128,0,33,19,75,1,53,25,128,28,128,99,70,91,0,156,70,16,45,205,209,0,37,15,73,16,75,1,50,28,128 140 POKE#7C0,12,128,13,128,0,33,25,128,12,42,189,209,1,56,0,40,184,209,28,128,9,176,240,189,0,35,0,33,59,128,4,75,25,128,222,231,255,15,0,0,4,0,1,80,8,0,1,80 150 POKE#7F0,16,0,1,80,32,0,1,80,0,8,1,80,0,4,1,80 RUN:SAVE0 NEW:'Main program 200 N=0:C=100 210 A=1023-ANA() 220 U=USR(#700,A) 230 C=C-1:IF C=0 C=100:IF ABS(N-A)>2 N=A:GSB@SEND:?"SEND";N 240 GOTO210 300 @SEND:POKE#800,32,10,1,76,N,N>>8,0,0,0,0,0,0,103^(N&#FF)^(N>>8),36,0,36:R=I2CR(79,#800,13,#820,3):R=I2CR(79,#80D,3,#820,3):RTN SAVE1 LRUN0

links
- 【共立エレショップ】>> 32×16ドットマトリクスLEDモジュール■限定特価品■
- IchigoJamで32x16ドットマトリクスLEDを制御する - ※個人の感想です (マシン語編)
- さくらインターネットが提供するIoTプラットフォームサービス、sakura.io

大きなLEDをIchigoJamで制御する / Big 7 Seg LED controlled by IchigoJam

2017/05/02
#IchigoJam #maker #KidsIT #english 

まちなかに見る大きな電光掲示板、つくってみたくない?
Do not you want to make a big LED sign at the town?

信号機づくりの次のステップ、大型LEDの制御をしよう!
Let's control a big LED as next step after making a traffic signal.

気をつけて!電圧が高くなると危険度も増すよ!
Be careful! Higher voltage has higher risk of you.

超大型赤色7セグメントLED表示器のデータシートを見ると、光らせるには7.2V(ドット部分だけは3.6V)が必要みたいです(VF)。 12VのACアダプターと抵抗をつないで、光らせてテストしてみましょう。抵抗なしや、抵抗が小さすぎると電流が流れすぎてLEDを壊してしまうので注意!データシートのIFに20mAとあるので (12V-7.2V)/0.02A=240Ω と計算したあたりの抵抗を使います(ドット部分DPは、(12V-3.6V)/0.02A=420Ω)。
You need 7.2V VF to light big 7 seg LED according to the data sheet. Use about 240Ω and 420Ω with a 12V AC adapter.

大きなLEDを制御するにはトランジスタを使います。トランジスタアレイ(TD62004APG)を使うと便利!
Use a transistor to control a LED. Transistor array(TD62004APG) is useful to control many LEDs!

IchigoJamのOUT1〜6とLEDを、7セグLEDのA〜Gへとつなぎます。
Connect OUT1-6 and LED to A-G of 7 seg LED.

OUT1 OK OUT2 OK

ついた? Is it OK?

10 LET[0],#3F,6,#5B,#4F,#66,#6D,#7D,#27,#7F,#6F RUN OK OUT[5] OK

5とついた? Did you get a '5'?

20 OUT RND(64) 30 IF BTN() OUT[RND(10)]:WAIT60 40 WAIT 2 50 GOTO 20

0-9までのサイコロプログラム 10 dice program

20 C=0 30 OUT[C] 40 WAIT 20 50 C=C+1 60 IF C=10 C=0 70 GOTO 30

自動カウンター auto counter


鯖江商工会議所オープンデータ活用、ブログ紹介アプリ / Open Data App of The Sabae Chamber of Commerce and Industry

2017/05/01
#sabae #opendata #english 

単独では日本初!商工会議所によるオープンデータ、鯖江商工会議所からスタート!
The Sabae Chamber of Commerce and Industry (JCCI member) started Open Data, !

鯖江の産業に関する3つのブログとRSSがオープンデータを使って、オープンデータアプリ「AKIJIKAN」をベースに、アプリ「さばえ商工ブログ」を公開。
I created an app based on AKIJIKAN using HTML and RSS of 3 blogs as Open Data.

"さばえ商工ブログ" - http://sabae.cc/i/

links
- 鯖江商工会議所オープンデータをはじめました | 鯖江商工会議所
- 「オープンデータ」での検索結果 - 日本商工会議所
- 日本商工会議所

Signal Gacha controlled by IchigoJam / 信号ガチャ改造法

2017/04/30
#maker #KidsIT #english 

Let's show the real world to kids! (こどもに社会を魅せよう!)
PCN showed programmer's work with IchigoJam at the event "Hatara Kids (はたらキッズ@ja)" in Fukui Lpa (エルパ@ja).

For instance do you know how the traffic signal works? (例えば信号機の仕事)
I found the signal toy Gacha (信号ガチャ) in Village Vanguard at Fukui Lpa.

There are steps to modify it to controll by IchigoJam BASIC.


Disassemble by the cutter and the minus driver (カッターとマイナスドライバーでバラす)


Remove contents (中身を取り除く)


3 3mm LEDs green, yellow and red (3つの3mm LED緑黄赤を準備)


Drill holes to put LEDs (LEDを差し込むための穴を空ける)


Glue LEDs (LEDをホットボンドで固める)


Wire 3 long legs and GND all short soldered legs (長い足と、はんだづけしてつなげた短い足GNDの4本配線する)


Program!

10 OUT1:WAIT30 20 OUT2:WAIT10 30 OUT4:WAIT50 40 GOTO10

It's not difficult to modify and program. Let's try!
改造もプログラムもそんな難しくないので、レッツトライ!

links
- Make your own Signal by IchigoJam with CutleryCard - easy way with cards!
- IchigoJam print "Pedestrian Signal" as first step of electronics
- タカラトミーアーツさんのガチャ信号 + IchigoJam - ナチュラルスタイルの工作
- the Signla Gacha where can I get? - 3 spots in Fukui! (福井にも3箇所!)

KATOKU by REKISHI / How to use the Rekishi Music Box Chip

2017/04/29
#maker #music #sabae #english 

Rekishi's *new* single CD "KATOKU" released! (KATOKU by レキシ@ja)

Ike-chan as Rekishi born in Sabae city! *Rekishi(レキシ@ja) means also "history" in Japanese
(レキシ池田貴史が福井県鯖江市「サングラス大使」第1号に就任 - 音楽ナタリー)

I've got the special music box card and disassembled. (オルゴール分解@ja)

It's a very simple electronic circuit. It's easy to desolder to get the chip.


from right upper
1. speaker out 1
2. VCC 3-5V?
3. speaker out 2
4. GND
* need some capacitors (VCC-GND 1uF?)


I added a volume controller.


Let's embed the Rekishi Music on your life!


Try it now!

links
- レキシ セカンドシングル 「KATOKU」発売! (official site)
- KATOKU(初回限定盤) Single, Limited Edition, Maxi (on Amazon)

How to divide on IchigoJam Assembly

2017/04/28
#IchigoJam #asm #Arm #english 

About the machine language on IchigoJam, you cant't find how to divide (除算/割り算@ja) on the Arm Cortex-M0 command table. It's right. Arm Cortex-M0 has no commands of division. Instead you can use the function to divide.

IchigoJam BASIC command "USR" pass an address of function to divide as the register R3 after IchigoJam 1.2b31. (IchigoJam-FAN to download the latest version 1.2b45)

asm: R1=3 → 00100 001 [num]
asm: GOTO R3 → 010001110 [R3] 000
BASIC: PRINT 100 / 3 → 33

If you want to use the number as remainder (R1), call it!

[0]=`00100 001<<8 + 3 [1]=`1011010 100000000 [2]=`010001111 0011 000 [3]=`0100011000 001 000 [4]=`1011110 100000000 ?USR(#800,100) 1

asm: R1=3 → 00100 001 [num]
asm: PUSH {LR} → 1011010 100000000
asm: GOSUB R3 → 010001111 [R3] 000
asm: R0=R1 → 0100011000 [R1] [R0]
asm: POP {PC} → 1011110 100000000
BASIC: PRINT 100 % 3 → 1

Enjoy programming with the simple machine language!

links
- Cortex-M0 Armマシン語表(抜粋)
-
はじめてのマシン語 - IchigoJamではじめるArmマシン語その1
- IchigoJam-FAN on Facebook

IZAKAYA style ideathon to make things using Open Data by Open Data Asia

2017/04/27
#OPDA #opendata #IoT #english 

Open Data Asia the first event at Shinjuku NHN Techorus.


Part 1: The first step of IoT and programming with IchigoJam x sakura.io

Challenge the first step of IoT with IchigoJam x sakura.io.



Heart LED board with IoT!
This is library for IchigoJam x sakura.io

20600 'IoT lib 20610 END 20700 @PWR:POKE#700,2,0:N=3:GSB@I2C:?PEEK(#782):RTN 20710 @ACT:POKE#700,1,0:N=3:GSB@I2C:N=PEEK(#782):RTN 20720 @GET:POKE#700,#30,0:N=#14:GSB@I2C:N=PEEK(#784):RTN 20730 @CHK:POKE#700,#32,0:N=4:GSB@I2C:N=PEEK(#783):RTN 20800 @WOUT:POKE#700,#20,10,1,76,W,W>>8,0,0,0,0,0,0:N=2:GSB@I2C:POKE#700,#24,0:N=2:GSB@I2C:RTN 20810 @WIN:W=0:GSB@CHK:IF!NRTNELSEGSB@GET:W=PEEK(#784)|PEEK(#785)<<8:RTN 20910 @I2C:M=PEEK(#701)+2 20920 C=0:FOR I=0 TO M-1:C=C^PEEK(#700+I):NEXT:POKE#700+M,C 20930 IFI2CR(79,#700,M+1,#780,N+1)'STOP 20940 C=0:FORI=0TON-1:M=PEEK(#780+I):C=C^M:NEXT 20950 IFC!=PEEK(#780+N)ORPEEK(#780)!=1'STOP 20960 RTN

Part 2: IoT and Open Data ideathon!

Past day there are no standards to connect the power, so the vacume machine connected to the light socket!


We will aim the 5 star open data.


This is load map of IMI.go.jp (vocaburary for 5 star open data from Japan).


Let's enjoy our ideathon with ISAKAYA STYLE.


The slide with 7 ideas!


The prize "Let's create!" to the stress communicater team!


The wearable girl with neoplug x VUFINE+!


Thank you to participate! See you next time!


Thank you NHN Techorus!

links
- また新宿区内でオープンデータ×IoTイベントやります! | 新宿区議会議員最年少の伊藤陽平
- オープンデータ、IoTも活用し、データシティ新宿の実現へ | 新宿区議会議員最年少の伊藤陽平

Raspberry Pi Zero mounter for neoplug glass vertical edition

2017/04/26
#megane #print3d #english 

Glass Wearable needs 3 points.
point 1: confortable
point 2: not heavy
point 3: looks good

"neoplug" solved point 1.
"Raspberry Pi Zero" solved point 2.
To improve point 3, I added attechment for it.

neoplug Vertical Attachment for Raspberry Pi (data on Thingverse)


It modeled by Blender, the open source 3D modeling application.


After 20 min printing, you can screw to your RPi Zero and just slide to attach with neoplug!

links
- neoplug
- neoplug on Forbes Japan

Kosen students will be Kids Programming Mentor!? Cutlery Card version up!

2017/04/25
#IchigoJam #KidsIT #doc #english 

To share the programming skill for all of the Kids, PCN started trials at Fukui Kosen.
I updated the first step of IchigoJam with Cutlery Card.


"Cutlery Field" to put some cards.
(download here "CutleryCard_firststep1-front-ja-rev3.pdf")


I added "IF BTN()" and "GOTO1" to learn 'loop' and 'judge' in computer.


They are 44 candidates of Kids Programming Mentor! (2nd grade of EI, Fukui Kosen)


They built own IchigoJam computers!
It's just beginning! Let's enjoy computing with both hardwares and softwares!

links
- こどもプログラミング教材 Jammy! Programming.KIDS - 日鉄日立システムエンジニアリング株式会社 (original version)
- Let's Compile Your Hand! Real Card Programming for Kids

Running and Riding the Bus with VUFINE+ x neoplug

2017/04/24
#megane #english 

I've started to prepare an event of marathon at Sabae with the neoplug glass.

This is the first prototype of running indicator "speedmeter".
I was able to run with time, my speed, time, odometer and accuracy of GPS (now 5m is the best condition)!


I found a busstop in front of Fukui-KOSEN.
Next time I'll try to catch the bus to return to home!

Tweet
クリエイティブ・コモンズ・ライセンス
この作品は「Creative Commons — CC BY 4.0」の下に提供されています。
CC BY 福野泰介 - Taisuke Fukuno / @taisukef / high-res profile image