ブロックエレベータのプログラム書いてみた。

# 準備
- プログラムはNanoBoardAGを使用する為Scratch1.4をベースにしたものです。
- プログラムのインストールとセット方法等
ちっちゃいものくらぶ：NanoBoardAG
（https://tiisai.ddo.jp/?page_id=935） 
- Scratchを立上げる時は「NanoBoardAGWithMotors.image」を選択。
- 入力ボタン
  -  各フロア　呼び出しボタン(抵抗A)
    1F-上階へ　2F-下階へと上階へ　3F-下階へと上階へ　4F-下階へ
  -  カゴ内　行先階ボタンと開閉ボタン（抵抗B)
1F　2F　3F　4F　開く　閉じる
  -  扉開閉検知ボリューム（抵抗C)
  -  カゴ位置検知　マイクロSW（抵抗D)
- モーター出力２つ
  -  昇降用モーター（A-M1)
  -  扉開閉モーター（B-M2)
- Scratch Board 監視盤の抵抗センサーの値の範囲はは0～100です。
単位はΩ（オーム）ではない。非接触時は0,完全接触時は100で表示。



# 配線図
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/7ac8ffdb-8185-8a03-79d6-c8ba524a65db.png)

# ステージ全体
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/a8c6d613-8a39-5fe5-ce54-701a94e50fab.png)

# 全スプライト
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/e94ea894-7deb-5bd8-8078-7cf1daa42e8c.png)



# 各スクリプト
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/9190da74-3bd7-4e27-606b-358e286665a2.png)
![昇降M-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/30a0b1dc-a34e-457b-728c-7d02ae65e036.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/9ff0d911-a8b9-3f5a-51c2-032453ac2cd7.png)
![階表示-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/99f1bad8-bd64-5846-acbe-4f5cf4fe986a.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/c5059955-75c5-c5b3-4a54-8d3222003b93.png)
![Door-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/48679671-e968-b850-d850-14d7715127ec.png)


 　
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/f799170d-3d62-f95e-daf0-ff8acc44f882.png)
![ud表示-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/96cdba6e-0c51-7182-eb19-6de0e7ec9c70.png)


 　
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/03a9500d-d5dd-44a4-2ad2-1cb443549066.png)
![センサー-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/30426592-1445-81fe-34f5-4d216a0e16b1.png)


 　
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/9e7938d8-3e29-f07e-4327-f1cfd3704cf0.png)
![UDsct-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/03edc6f3-34b5-377e-aee0-f476f5dd6987.png)

 　

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/365b36ed-ec3e-8d84-0b45-d20630e556bc.png)
![調整-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/461b1683-f657-8ae4-51cd-a4013f7deb59.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/229a069f-e1a2-094f-734e-6b3e75a57d4a.png)
![Open-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/38a4d599-95d2-59db-900f-78a30f066b0c.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/399cda33-efbb-8b56-7c56-9eec970ab8bb.png)
![Close-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/264b5b21-c029-c9b7-fac6-f7e282eb5c5c.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/f46eef8e-4a0f-9920-0d7b-af3eae4e93e7.png)
![1Fgo-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/03a1f4a1-a1c8-bd37-171a-65e2c0c6790b.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/d10c1cf0-e01e-bccb-e442-fc6e17da95b0.png)
![2Fgo-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/e3179f64-1207-0f5c-6d6f-49a6c72afd68.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/f14e4f9b-873d-f23e-5ab8-576fa51fa1ce.png)
![3Fgo-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/4134a40a-5331-84dd-abc4-37115bc29518.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/254aef86-f3f0-0170-5ace-37f0f28d03e4.png)
![4Fgo-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/d05ad385-ca48-e840-1cc3-f714c7eebd5a.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/bdcdfe24-da44-a80b-5307-6898832fed79.png)
![1FUP-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/cab8afe0-9c2a-ffb6-abe0-45c6b744d92c.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/e31fb297-846b-c430-4772-a2878cf93e2a.png)
![2FDN-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/64b82c87-d0ef-fd81-8471-486f4d25d02f.png)


     
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/1a4b3b4a-5b2b-a1e6-26f5-d72da2a0f772.png)
![2FUP-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/6fd787be-c7e6-c9aa-0fbe-7aecbaaec06e.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/f6d5d975-ccb3-62e0-c8e2-c000774707a1.png)
![3FDN-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/1530af66-9ac0-0a4d-f088-cab27cd98ad0.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/af6630b4-2d44-7f42-325d-420a6f58f2bc.png)
![3FUP-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/e2f8e720-9fab-7020-902c-be7b6f91ccd3.png)



![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/eb41a520-17b1-75e2-6eb6-c727f60f6066.png)
![4FDN-SC.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3010655/c6b326f6-3369-7974-2e1a-f0813f16d3bc.png)