Robofun 機器人論壇

標題: 我的功課!(用超聲波感應器控制一個motor開關門) [打印本頁]

作者: 特公    時間: 2007-12-9 17:51
標題: 我的功課!(用超聲波感應器控制一個motor開關門)
我編寫了motor的程序:
' {$STAMP BS2}
' {$PBASIC 2.5}
DIRA = 0
DIRB = 0
DIRC = 15
DIRD = 0
OUTC = 0
MAIN:
OUTC =%0111 'OPEN
PAUSE 200 'OPEN DOOR TIME
OUTC = 0 'STOP
PAUSE 5000 'OPEN DOOR WAITING TIME
OUTC =%1111 'CLOSE
PAUSE 200 'CLOSE DOOR TIME
OUTC =%0 'STOP
PAUSE 2000 'CLOSE DOOR WAITING TIME
GOTO MAIN

但不知是否可行 , 還有感應器應該怎樣編寫或者那裡可以找到有關資料?
我要感應到物件後motor運行!




歡迎光臨 Robofun 機器人論壇 (https://robofun.net/forum/) Powered by Discuz! X3.2