SlideShare ist ein Scribd-Unternehmen logo
1 von 10
2019年6月30日 PCN ひろしま
IchigoJam でんし こうさく
こえに はんのうする おもちゃ
はなしかけると すずをならす
2
おねがい
• とがった ぶひんが あります
• けがに ちゅうい!!
• ぶひんは ていねいに さわってください
3
サーボモーター SG90
4
おとセンサー
5
よてい
• サーボをつなぐ
• サーボをうごかす
• おとセンサーをつなぐ
• おとセンサーをうごかす
• おとセンサーでサーボをうごかす
6
7
OUT2
5V
GND
GNDIN4
VCCGNDOUT
+
VCCGNDOUT
リスト1
100 V=0
110 FOR I=1 TO 50
120 S=IN(4)
130 IF S THEN V=V+1
140 NEXT
150 ?V
160 GOTO 100
8
リスト2
100 V=0
110 FOR I=1 TO 50
120 S=IN(4)
130 IF S THEN V=V+1
140 NEXT
150 ?V
160 WAIT 1
170 IF V<5 GOTO 100
180 PWM 2,100
190 WAIT 15
200 PWM 2,180
210 WAIT 15
220 GOTO 100
9
リスト3
100 V=0
110 FOR I=1 TO 50
120 S=IN(4)
130 IF S THEN V=V+1
140 NEXT
150 IF V=0 GOTO 190
160 FOR I=1 TO V
170 ?"*";
180 NEXT
190 ?
10
200 WAIT 1
210 IF V<5 GOTO 100
220 PWM 2,100
230 WAIT 15
240 PWM 2,180
250 WAIT 15
260 GOTO 100

Weitere ähnliche Inhalte

Mehr von Takuya Nishimoto (20)

210630 python
210630 python210630 python
210630 python
 
210526 Power Automate Desktop Python
210526 Power Automate Desktop Python210526 Power Automate Desktop Python
210526 Power Automate Desktop Python
 
210428 python
210428 python210428 python
210428 python
 
200918 hannari-python
200918 hannari-python200918 hannari-python
200918 hannari-python
 
200429 python
200429 python200429 python
200429 python
 
200325 flask
200325 flask200325 flask
200325 flask
 
200208 osh-nishimoto-v2
200208 osh-nishimoto-v2200208 osh-nishimoto-v2
200208 osh-nishimoto-v2
 
191208 python-kansai-nishimoto
191208 python-kansai-nishimoto191208 python-kansai-nishimoto
191208 python-kansai-nishimoto
 
191101 nvda-sightworld-nishimoto
191101 nvda-sightworld-nishimoto191101 nvda-sightworld-nishimoto
191101 nvda-sightworld-nishimoto
 
191114 iotlt-nishimoto
191114 iotlt-nishimoto191114 iotlt-nishimoto
191114 iotlt-nishimoto
 
191030 anna-with-python
191030 anna-with-python191030 anna-with-python
191030 anna-with-python
 
190916 nishimoto-nvda-pyconjp
190916 nishimoto-nvda-pyconjp190916 nishimoto-nvda-pyconjp
190916 nishimoto-nvda-pyconjp
 
190925 python-windows
190925 python-windows190925 python-windows
190925 python-windows
 
190731 chalice
190731 chalice190731 chalice
190731 chalice
 
190719 nishimoto nvda talk
190719 nishimoto nvda talk190719 nishimoto nvda talk
190719 nishimoto nvda talk
 
190516 nishimoto
190516 nishimoto190516 nishimoto
190516 nishimoto
 
Iotlt190202 v1
Iotlt190202 v1Iotlt190202 v1
Iotlt190202 v1
 
181226 txt2tags
181226 txt2tags181226 txt2tags
181226 txt2tags
 
181006 nishimoto-kaggle
181006 nishimoto-kaggle181006 nishimoto-kaggle
181006 nishimoto-kaggle
 
180923 osc18hi coderdojo nishimoto
180923 osc18hi coderdojo nishimoto180923 osc18hi coderdojo nishimoto
180923 osc18hi coderdojo nishimoto
 

PCN 190630 v2