Projekt:SpaceUhr: Unterschied zwischen den Versionen

Zur Navigation springen Zur Suche springen
2.905 Bytes hinzugefügt ,  27. Oktober 2017
→‎Referenzen: Neuer code
(→‎Referenzen: Neuer code)
Zeile 83: Zeile 83:
Code
Code
  <nowiki>
  <nowiki>
neo.setup(5)
guioff
time.setup(2,1)
msgbranch [message]
timercb 15000, [drawClock]
neo.stripcolor(0,13,0,0,5)
delay 7000
neo.stripcolor(0,13,0,0,0)
time.setup(2,1,"pool.ntp.org")
mytime=""
mytime=""
cls
timercb 3000, [drawClock]
door=0
offenzu=""
drawcount=59
wait
 
[message]
timercb 0, [drawClock]
pwmfreq 800
RetMsg = "0"
msgcmd=msgget("cmd")
if msgcmd="secret" then
  for n=1 to 10
  neo.stripcolor(0,15,64,64,64) 
  gosub [morsed]
  neo.stripcolor(0,15,0,0,0)
  zeit=millis()
  do
  loop until millis()>(zeit+250)
  next
  door=30
  RetMsg="1"
  endif
timercb 3000, [drawClock]
MsgReturn RetMsg
wait
wait


[drawClock]
[drawClock]
cls
timercb 0, [drawClock]
drawcount=drawcount+1
gosub [aquireandpost]
gosub [dotime]
gosub [dotime]
gosub [getstate]
if left(offenzu,1)=="o" then
gosub [drawm2]
gosub [drawm2]
gosub [drawm1]
gosub [drawm1]
gosub [drawh2]
gosub [drawh2]
gosub [drawh1]
gosub [drawh1]
gosub [drawflags]
end if
if drawcount > 20 then
drawcount=0
gosub [minuteservice]
end if
timercb 1000, [drawClock]
wait
wait
[getstate]
Status = left(wget("status.schaffenburg.org/"),1)
if Status="o" then
neo.stripcolor(0,15,0,5,0)
else
neo.stripcolor(0,15,5,0,0)
endif
return


[drawh1]
[drawh1]
my=myh1
my=myh1
if my="0" then
neo(12,0,5,0)
neo(13,0,5,0)
endif
if my="1" then
if my="1" then
neo(12,10,10,10)
neo(12,20,20,20)
neo(13,0,5,0)
endif
endif
if my="2" then
if my="2" then
neo(13,10,10,10)
neo(12,0,5,0)
neo(13,20,20,20)
endif
endif
return
return
Zeile 121: Zeile 154:
[drawh2]
[drawh2]
my=myh2
my=myh2
if my="0" then
neo(8,0,5,0)
neo(9,0,5,0)
neo(10,0,5,0)
neo(11,0,5,0)
endif
if my="1" then
if my="1" then
neo(8,10,10,10)
neo(8,20,20,20)
neo(9,0,5,0)
neo(10,0,5,0)
neo(11,0,5,0)
endif
endif
if my="2" then
if my="2" then
neo(9,10,10,10)
neo(8,0,5,0)
neo(9,20,20,20)
neo(10,0,5,0)
neo(11,0,5,0)
endif
endif
if my="3" then
if my="3" then
neo(8,10,10,10)
neo(8,20,20,20)
neo(9,10,10,10)
neo(9,20,20,20)
neo(10,0,5,0)
neo(11,0,5,0)
endif
endif
if my="4" then
if my="4" then
neo(10,10,10,10)
neo(8,0,5,0)
neo(9,0,5,0)
neo(10,20,20,20)
neo(11,0,5,0)
endif
endif
if my="5" then
if my="5" then
neo(10,10,10,10)
neo(8,20,20,20)
neo(8,10,10,10)
neo(9,0,5,0)
neo(10,20,20,20)
neo(11,0,5,0)
endif
endif
if my="6" then
if my="6" then
neo(10,10,10,10)
neo(8,0,5,0)
neo(9,10,10,10)
neo(9,20,20,20)
neo(10,20,20,20)
neo(11,0,5,0)
endif
endif
if my="7" then
if my="7" then
neo(8,10,10,10)
neo(8,20,20,20)
neo(9,10,10,10)
neo(9,20,20,20)
neo(10,10,10,10)
neo(10,20,20,20)
neo(11,0,5,0)
endif
endif
if my="8" then
if my="8" then
neo(11,10,10,10)
neo(8,0,5,0)
neo(9,0,5,0)
neo(10,0,5,0)
neo(11,20,20,20)
endif
endif
if my="9" then
if my="9" then
neo(8,10,10,10)
neo(8,20,20,20)
neo(11,10,10,10)
neo(9,0,5,0)
neo(10,0,5,0)
neo(11,20,20,20)
endif
endif
return
return
Zeile 160: Zeile 220:
[drawm1]
[drawm1]
my=mym1
my=mym1
if my="0" then
neo(4,0,5,0)
neo(5,0,5,0)
neo(6,0,5,0)
neo(7,0,5,0)
endif
if my="1" then
if my="1" then
neo(4,10,10,10)
neo(4,20,20,20)
neo(5,0,5,0)
neo(6,0,5,0)
neo(7,0,5,0)
endif
endif
if my="2" then
if my="2" then
neo(5,10,10,10)
neo(4,0,5,0)
neo(5,20,20,20)
neo(6,0,5,0)
neo(7,0,5,0)
endif
endif
if my="3" then
if my="3" then
neo(4,10,10,10)
neo(4,20,20,20)
neo(5,10,10,10)
neo(5,20,20,20)
neo(6,0,5,0)
neo(7,0,5,0)
endif
endif
if my="4" then
if my="4" then
neo(6,10,10,10)
neo(4,0,5,0)
neo(5,0,5,0)
neo(6,20,20,20)
neo(7,0,5,0)
endif
endif
if my="5" then
if my="5" then
neo(6,10,10,10)
neo(4,20,20,20)
neo(4,10,10,10)
neo(5,0,5,0)
neo(6,20,20,20)
neo(7,0,5,0)
endif
endif
if my="6" then
if my="6" then
neo(6,10,10,10)
neo(4,0,5,0)
neo(5,10,10,10)
neo(5,20,20,20)
neo(6,20,20,20)
neo(7,0,5,0)
endif
endif
if my="7" then
if my="7" then
neo(4,10,10,10)
neo(4,20,20,20)
neo(5,10,10,10)
neo(5,20,20,20)
neo(6,10,10,10)
neo(6,20,20,20)
neo(7,0,5,0)
endif
endif
if my="8" then
if my="8" then
neo(7,10,10,10)
neo(4,0,5,0)
neo(5,0,5,0)
neo(6,0,5,0)
neo(7,20,20,20)
endif
endif
if my="9" then
if my="9" then
neo(4,10,10,10)
neo(4,20,20,20)
neo(7,10,10,10)
neo(5,0,5,0)
neo(6,0,5,0)
neo(7,20,20,20)
endif
endif
return
return
Zeile 198: Zeile 285:
[drawm2]
[drawm2]
my=mym2
my=mym2
if my="0" then
neo(0,0,5,0)
neo(1,0,5,0)
neo(2,0,5,0)
neo(3,0,5,0)
endif
if my="1" then
if my="1" then
neo(0,10,10,10)
neo(0,20,20,20)
neo(1,0,5,0)
neo(2,0,5,0)
neo(3,0,5,0)
endif
endif
if my="2" then
if my="2" then
neo(1,10,10,10)
neo(0,0,5,0)
neo(1,20,20,20)
neo(2,0,5,0)
neo(3,0,5,0)
endif
endif
if my="3" then
if my="3" then
neo(1,10,10,10)
neo(0,20,20,20)
neo(0,10,10,10)
neo(1,20,20,20)
neo(2,0,5,0)
neo(3,0,5,0)
endif
endif
if my="4" then
if my="4" then
neo(2,10,10,10)
neo(0,0,5,0)
neo(1,0,5,0)
neo(2,20,20,20)
neo(3,0,5,0)
endif
endif
if my="5" then
if my="5" then
neo(2,10,10,10)
neo(0,20,20,20)
neo(0,10,10,10)
neo(1,0,5,0)
neo(2,20,20,20)
neo(3,0,5,0)
endif
endif
if my="6" then
if my="6" then
neo(2,10,10,10)
neo(0,0,5,0)
neo(1,10,10,10)
neo(1,20,20,20)
neo(2,20,20,20)
neo(3,0,5,0)
endif
endif
if my="7" then
if my="7" then
neo(2,10,10,10)
neo(0,20,20,20)
neo(1,10,10,10)
neo(1,20,20,20)
neo(0,10,10,10)
neo(2,20,20,20)
neo(3,0,5,0)
endif
endif
if my="8" then
if my="8" then
neo(3,10,10,10)
neo(0,0,5,0)
neo(1,0,5,0)
neo(2,20,20,20)
neo(3,0,5,0)
endif
endif
if my="9" then
if my="9" then
neo(0,10,10,10)
neo(0,20,20,20)
neo(3,10,10,10)
neo(1,0,5,0)
neo(2,20,20,20)
neo(3,0,5,0)
endif
endif
return
return


[dotime]
[dotime]
io(pwo,4,0)
mytime = time()
mytime = time()
wprint htmlvar(mytime)
myh1 = mid(mytime,12,1)
myh1 = mid(mytime,12,1)
myh2 = mid(mytime,13,1)
myh2 = mid(mytime,13,1)
Zeile 241: Zeile 355:
mym2 = mid(mytime,16,1)
mym2 = mid(mytime,16,1)
return
return
[drawflags]
end if
if alive<>"secret" then
  neo(15,5,0,0)
else 
  neo(15,0,door,0)
endif
return
[morsed]
  io(pwo,4,256)
  zeit=millis()
  do
  loop until millis()>(zeit+300)
  io(pwo,4,0)
  zeit=millis()
  do
  loop until millis()>(zeit+100)
  io(pwo,4,256)
  zeit=millis()
  do
  loop until millis()>(zeit+100)
  io(pwo,4,0)
  zeit=millis()
  do
  loop until millis()>(zeit+100)
  io(pwo,4,256)
  zeit=millis()
  do
  loop until millis()>(zeit+100)
  io(pwo,4,0)
  zeit=millis()
  do
  loop until millis()>(zeit+300)
  return
[aquireandpost]
tempcount=tempcount+1
vt=io(ai) 
tempsum=tempsum+vt
if tempcount=60 then
tscount=tscount+1
tempsum=  -47/5120*tempsum + 1230537/5120
tempsum=tempsum-2
if tscount=1 then
io(po,16,0)
sendts("thingspeaktoken","2",str(tempsum))
nyutemp=str(tempsum)
nyumessage = "codeblatz.ddns.net/soap.php?token=secret&tag=spacetemperature&value=" & nyutemp
nubsi=wget(nyumessage,80)
io(po,16,1)
tscount=0
end if
tempcount=0
tempsum=0
end if
return
[minuteservice]
alive=wget("esp-doorbell/msg")
if alive=="secret" then
else
io(pwo,4,256)
zeit=millis()
do
loop until millis()>(zeit+1)
io(pwo,4,0)
end if
offenzu=wget("status.schaffenburg.org/")
return




mitglieder, vorstand
1.621

Bearbeitungen

Navigationsmenü