6. 6
開始
Socket_tid0( ):
Android connection
Get command
Socket_tid1( ):
Android connection
Get command
Step_motor( ):
Set flatmotor
結束
User1
pthread_create ( )
Item_thread( ):
Get random item
Item_read( ):
Read each GPIO
Use LED to show who take the
item and what the item is.
User2
使用者連線?
是
桌台
傾斜
pthread_create ( )
產生
特殊道具
取得
特殊道具
否
User==2?
否
Score==5?
是
是
否
控制桌
台傾斜
User1
Stick_motor( ):
Have 4 thread to control
each stick DC motor
打擊馬達
Score_thread( ):
Use 7_segment to show
the point of each player
紀錄得
分狀態
Item_countdown( ):
Set the item time for
different effects.
特殊道具
時間
Score==5?
是
否
Pthread_exit(NULL)
Score==5?
是
否
Pthread_exit(NULL)
Score==5?
是
否
Pthread_exit(NULL)
Score==5?
Score==5?
Pthread_exit(NULL)
Pthread_exit(NULL)
否 否
是
是
Join Socket thread
Show the result on LCD
pthread_create ( )
pthread_create ( )