'RF transceiver code modified by john schimmel
'original code by amos, brett, daniel and chris
'##########################################################################
'rf test will blink an led on porta.1 when it receives anything
'##############################################################################

chiahac 發表在 痞客邦 留言(0) 人氣()

Serial new code
'RF transceiver code modified by john schimmel
'original code by amos, brett, daniel and chris
'##########################################################################
'rf test will blink an led on porta.1 when it receives anything

chiahac 發表在 痞客邦 留言(0) 人氣()

  • Dec 12 Mon 2005 11:13
  • Pile

'first version (for backup) --
'send out Serial.
' PILE CODE version 1.0
' portb is our 8 inputs from QPROX: QT113h
' b.0 to b.3 is tops

chiahac 發表在 痞客邦 留言(0) 人氣()

  • Dec 10 Sat 2005 11:30
  • xxxxx

' PILE CODE version 1.0
' portb is our 8 inputs from QPROX: QT113h
' b.0 to b.3 is tops
' b.4 to b.7 is bottoms
define OSC 4
countPeople var byte
sendVal var byte
prevB var byte
time var word
delay var word
delay = 3000 'time before new change occurs in milli secs
pinVar var bit[8]
i var byte
myArray var PORTB
'//////////////////////////////////////////////////////////////////
main:
'count number of people at any moment
for i = 0 to 7
IF myArray.0[i] = 1 then
countPeople = countPeople + 1
endif
next
'make a nice button = check if there is a difference
If portb != prevB then
gosub val
prevB = portB
time = 0
else
time = time+1
endif
if time >= delay then
SEROUT2 portc.6, 16468, [DEC sendVal, 13]
endif
'////////////
val:
select case countPeople
case 0
sendVal = 00 'waiting
CASE 1
sendVal = PORTB
CASE 2
sendVal = PORTB
case is >= 3
sendVal = 10 'party
end select
return
goto main

chiahac 發表在 痞客邦 留言(0) 人氣()

'RF transceiver code modified by john schimmel
'original code by amos, brett, daniel and chris
'##########################################################################
'rf test will blink an led on porta.1 when it receives anything
'##############################################################################

chiahac 發表在 痞客邦 留言(0) 人氣()


'RF transceiver code modified by john schimmel
'original code by amos, brett, daniel and chris
'##########################################################################
'rf test will blink an led on porta.1 when it receives anything
'##############################################################################

chiahac 發表在 痞客邦 留言(0) 人氣()

Define OSC 4
INPUT portb.7
INPUT portb.6
INPUT portb.5
INPUT portb.4

chiahac 發表在 痞客邦 留言(0) 人氣()

'RF transceiver code modified by john schimmel
'original code by amos, brett, daniel and chris
'##########################################################################
'rf test will blink an led on porta.1 when it receives anything
'##############################################################################

chiahac 發表在 痞客邦 留言(0) 人氣()

'RF transceiver code modified by john schimmel
'original code by amos, brett, daniel and chris
'##########################################################################
'rf test will blink an led on porta.1 when it receives anything
'##############################################################################

chiahac 發表在 痞客邦 留言(0) 人氣()

'RF transceiver code modified by john schimmel
'original code by amos, brett, daniel and chris
'##########################################################################
'rf test will blink an led on porta.1 when it receives anything
'##############################################################################

chiahac 發表在 痞客邦 留言(0) 人氣()

Define OSC 4
input portb.7
main:
IF portb.7 =1 Then
SEROUT2 portc.6, 16468, ["Hello World!", 13,10]

chiahac 發表在 痞客邦 留言(0) 人氣()

Define OSC 4
main:
SEROUT2 portc.6, 16468, ["Hello World!", 13,10]
goto main

chiahac 發表在 痞客邦 留言(0) 人氣()

1 2
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。