Program
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Real2Virtual202111]]
* プログラム [#le24e57f]
** サイコロ側 [#ia291409]
*** Mbed L-tek FF LPC546XX [#r9dcff23]
#code(c){{
/*
timer interrupt
|
(set current output face... the face connect with the u...
|
v
face 0 input (photo transister 0) routine
face 1 input (photo transister 1) routine
face 2 input (photo transister 2) routine
face 3 input (photo transister 3) routine
face 4 input (photo transister 4) routine
face 5 input (photo transister 5) routine
|
v
current output face routine
|
V
end
Main routine
|
v
initialize
|
v
start loop
|
v
if there is a command input from USB Serial (for debug) ...
then exec the command
|
v
if there is a command input from faces
then exec the command
|
v
repeat the loop
input routine
+---------------------------+
| inter face command buffer +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 0 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 1 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 2 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 3 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 4 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 5 +---> message interpreter -->
+---------------------------+
*/
/*
USB TERMINAL
mbed NXP LPC1768
1 GND 3.3 Vout 40
2 VIN 5.0v USV vout 39
3 VB IF- 38
4 nR IF+ 37
5 p5 mosi(spi) Ethernet RD- 36
6 p6 miso(spi) Ethernet RD+ 35
7 p7 sck Ethernet TD- 34
8 p8 Ethernet TD+ 33
9 p9 tx(serial) USB D- 32
10 p10 rx(serial) USB D+ 31
11 p11 mosi(spi) p30 30
12 p12 miso(spi) p29 29
13 p13 tx/sck I2C SDA p28 28
14 p14 rx I2C SCL p27 27
15 p15 analog p26 26
16 p16 analog p25 25
17 p17 analog p24 24
18 p18 analog /out p23 23
19 p19 analog p22 22
20 p20 analog p21 21
*/
/*
tesla dice configuration of the LPC1768
PIN REG
30 PE0 p30 direction 0 --------------- LED00 LED01 ...
29 PE1 p29 direction 1 --------------- LED10 LED11 ...
28 PE2 p28 direction 2 --------------- LED20 LED21 ...
27 PE3 p27 direction 3 --------------- LED30 LED31 ...
---- | | ...
| | ...
26 PE4 p26 face 0-----R150ohm----------------+ | ...
25 PE5 p25 face 1-----R150ohm-----------------------+ ...
24 PE6 p24 face 2-----R150ohm--------------------------...
23 PE7 p23 face 3-----R150ohm--------------------------...
22 PE8 p22 face 4-----R150ohm--------------------------...
21 PE9 p21 face 5-----R150ohm--------------------------...
REG ... photo tr receive
15 PEA p15 face 0 ------<<<-----
16 PEB p16 face 1 ------<<<-----
17 PEC p17 face 2 ------<<<-----
18 PED p18 face 3 ------<<<-----
19 PEE p19 face 4 ------<<<-----
20 PEF p20 face 5 ------<<<-----
USB Serial
--rx---<<<--serial ---- USB
--tx--->>>--serial ---- USB
M5Stamp/M5Atom Serial
10 --rx---<<<--serial ---- M5Stamp/Atom
9 --tx--->>>--serial ---- M5Stamp/Atom
○LPC1768<->LPC1768 (inter-dice )command
LPC1768->LPC1768 "srs." start the re...
LPC1768<-LPC1768 "(this <dice_name_0> f<x0>d<y...
return the ...
<dice_nam...
<x0> ... t...
<y0> ... d...
LPC1768->LPC1768 "ask <x0><x1>...<xn>." ask th...
LPC1768->LPC1768 "set (<val>) <x0><x1>...<xn>....
○PC <->LPC1768 command ... プローブは PC<->LPC1768 で接続...
pc->LPC1768 "srs." start the recur...
pc<-LPC1768 "(this <dice_name_0> f<x0>d<y0> ...
return the tesla dices...
pc->LPC1768 "con<x0>." 面<x0> の接続を...
pc<-LPC1768 "cf<x1><y1>" ... <x0> は相手...
または "n" ... 接続なし。
pc->LPC1768 "prb." この r8 をプロー...
pc->LPC1768 "dce." この r8 をテスラ...
pc->LPC1768 "mon<level>." r8<->cpld 間の通...
<level>= 0 ... モニター...
<level>= 1 ... r8<-r8 ...
<level>= 2 ... r8<->cpl...
pc->LPC1768 "?." r8 の状態を問い合...
pc<-LPC1768 ...
OutBuffer.status
0 ... no data
1 ... outputting
2 ... output is done
3 ... buffering
4 ... ready for output
5 ... waiting ack
InBuffer.status
0 ... waiting
1 ... reading bits sequence
2 ... ready for input
inter-face commands
sx ----->
<---- ak
*/
}}
- [[common.h]]
- [[Initialize.h]]
- [[Initialize.cpp]]
- [[InBuffer.h]]
- [[InBuffer.cpp]]
- [[OutBuffer.h]]
- [[OutBuffer.cpp]]
- [[CommandBuffer.h]]
- [[CommandBuffer.cpp]]
- [[StringQueue.h]]
- [[StringQueue.cpp]]
- [[main.cpp]]
*** M5Stamp pico Mate [#y77510c7]
- [[m5Stamp-wifi-ex03]]
** PC側 [#f144dd05]
- このライブラリを使わせていただいています。感謝します。
-- https://sites.google.com/site/3dprogramminginpython/
*** Cube.py [#pe49c00f]
- [[Cube.py]]
*** real2virtual_ex03.py [#u5a11a45]
- [[real2virtual_ex02.py]]
** 受信機(自動工場)側 [#ta644284]
- main controller
- actuator controller
-
----
#counter
終了行:
[[Real2Virtual202111]]
* プログラム [#le24e57f]
** サイコロ側 [#ia291409]
*** Mbed L-tek FF LPC546XX [#r9dcff23]
#code(c){{
/*
timer interrupt
|
(set current output face... the face connect with the u...
|
v
face 0 input (photo transister 0) routine
face 1 input (photo transister 1) routine
face 2 input (photo transister 2) routine
face 3 input (photo transister 3) routine
face 4 input (photo transister 4) routine
face 5 input (photo transister 5) routine
|
v
current output face routine
|
V
end
Main routine
|
v
initialize
|
v
start loop
|
v
if there is a command input from USB Serial (for debug) ...
then exec the command
|
v
if there is a command input from faces
then exec the command
|
v
repeat the loop
input routine
+---------------------------+
| inter face command buffer +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 0 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 1 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 2 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 3 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 4 +---> message interpreter -->
+---------------------------+
+---------------------------+
| command buffer for face 5 +---> message interpreter -->
+---------------------------+
*/
/*
USB TERMINAL
mbed NXP LPC1768
1 GND 3.3 Vout 40
2 VIN 5.0v USV vout 39
3 VB IF- 38
4 nR IF+ 37
5 p5 mosi(spi) Ethernet RD- 36
6 p6 miso(spi) Ethernet RD+ 35
7 p7 sck Ethernet TD- 34
8 p8 Ethernet TD+ 33
9 p9 tx(serial) USB D- 32
10 p10 rx(serial) USB D+ 31
11 p11 mosi(spi) p30 30
12 p12 miso(spi) p29 29
13 p13 tx/sck I2C SDA p28 28
14 p14 rx I2C SCL p27 27
15 p15 analog p26 26
16 p16 analog p25 25
17 p17 analog p24 24
18 p18 analog /out p23 23
19 p19 analog p22 22
20 p20 analog p21 21
*/
/*
tesla dice configuration of the LPC1768
PIN REG
30 PE0 p30 direction 0 --------------- LED00 LED01 ...
29 PE1 p29 direction 1 --------------- LED10 LED11 ...
28 PE2 p28 direction 2 --------------- LED20 LED21 ...
27 PE3 p27 direction 3 --------------- LED30 LED31 ...
---- | | ...
| | ...
26 PE4 p26 face 0-----R150ohm----------------+ | ...
25 PE5 p25 face 1-----R150ohm-----------------------+ ...
24 PE6 p24 face 2-----R150ohm--------------------------...
23 PE7 p23 face 3-----R150ohm--------------------------...
22 PE8 p22 face 4-----R150ohm--------------------------...
21 PE9 p21 face 5-----R150ohm--------------------------...
REG ... photo tr receive
15 PEA p15 face 0 ------<<<-----
16 PEB p16 face 1 ------<<<-----
17 PEC p17 face 2 ------<<<-----
18 PED p18 face 3 ------<<<-----
19 PEE p19 face 4 ------<<<-----
20 PEF p20 face 5 ------<<<-----
USB Serial
--rx---<<<--serial ---- USB
--tx--->>>--serial ---- USB
M5Stamp/M5Atom Serial
10 --rx---<<<--serial ---- M5Stamp/Atom
9 --tx--->>>--serial ---- M5Stamp/Atom
○LPC1768<->LPC1768 (inter-dice )command
LPC1768->LPC1768 "srs." start the re...
LPC1768<-LPC1768 "(this <dice_name_0> f<x0>d<y...
return the ...
<dice_nam...
<x0> ... t...
<y0> ... d...
LPC1768->LPC1768 "ask <x0><x1>...<xn>." ask th...
LPC1768->LPC1768 "set (<val>) <x0><x1>...<xn>....
○PC <->LPC1768 command ... プローブは PC<->LPC1768 で接続...
pc->LPC1768 "srs." start the recur...
pc<-LPC1768 "(this <dice_name_0> f<x0>d<y0> ...
return the tesla dices...
pc->LPC1768 "con<x0>." 面<x0> の接続を...
pc<-LPC1768 "cf<x1><y1>" ... <x0> は相手...
または "n" ... 接続なし。
pc->LPC1768 "prb." この r8 をプロー...
pc->LPC1768 "dce." この r8 をテスラ...
pc->LPC1768 "mon<level>." r8<->cpld 間の通...
<level>= 0 ... モニター...
<level>= 1 ... r8<-r8 ...
<level>= 2 ... r8<->cpl...
pc->LPC1768 "?." r8 の状態を問い合...
pc<-LPC1768 ...
OutBuffer.status
0 ... no data
1 ... outputting
2 ... output is done
3 ... buffering
4 ... ready for output
5 ... waiting ack
InBuffer.status
0 ... waiting
1 ... reading bits sequence
2 ... ready for input
inter-face commands
sx ----->
<---- ak
*/
}}
- [[common.h]]
- [[Initialize.h]]
- [[Initialize.cpp]]
- [[InBuffer.h]]
- [[InBuffer.cpp]]
- [[OutBuffer.h]]
- [[OutBuffer.cpp]]
- [[CommandBuffer.h]]
- [[CommandBuffer.cpp]]
- [[StringQueue.h]]
- [[StringQueue.cpp]]
- [[main.cpp]]
*** M5Stamp pico Mate [#y77510c7]
- [[m5Stamp-wifi-ex03]]
** PC側 [#f144dd05]
- このライブラリを使わせていただいています。感謝します。
-- https://sites.google.com/site/3dprogramminginpython/
*** Cube.py [#pe49c00f]
- [[Cube.py]]
*** real2virtual_ex03.py [#u5a11a45]
- [[real2virtual_ex02.py]]
** 受信機(自動工場)側 [#ta644284]
- main controller
- actuator controller
-
----
#counter
ページ名: