jieda 發表於 2012-5-12 18:41:45

Pololu 習作

本帖最後由 jieda 於 2012-5-12 18:43 編輯

https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-prn1/p480x480/542287_365206330202491_100001393805427_1031710_1694139468_n.jpg


##############
#Main Table
#RoyIp
#############
begin
   closeAllCh
   T0700 #CH0-3 RB ON
   30000 13 servo #CH13 T5 on
   30000 15 servo #CH15 Fan on
   1 delay_clocks
   T0800 #CH4-7 B ON
   1 delay_clocks
   T0900 #CH12 B ON
   2 delay_clocks
   T1100 #CH8-11 ON
   2 delay_clocks
   T1300 #CH14 XML ON
   3 delay_clocks
   T1600 #CH14 XML OFF
   3 delay_clocks
   T1900 #CH8-11 OFF, CH0-3 10%, CH13 T5 OFF
   2 delay_clocks
   T2100 #CH4-7 & CH12 OFF
   6 delay_clocks
   closeAllCh
   4 delay_clocks
repeat

####################
sub closeAllCh
######################
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
23 servo 22 servo 21 servo 20 servo 19 servo 18 servo
17 servo 16 servo 15 servo 14 servo 13 servo 12 servo
11 servo 10 servo 9 servo 8 servo 7 servo 6 servo
5 servo 4 servo 3 servo 2 servo 1 servo 0 servo
1000 delay
return

#####################
sub delay_seconds
#####################
begin
dup while
1 minus 1000 delay
repeat
drop
return

#######################
sub delay_minutes
#####################
begin
dup while
1 minus 60 delay_seconds
repeat
drop
return

#####################
sub delay_clocks
#####################
begin
dup while
1 minus 60 delay_minutes
repeat
drop
return

############
sub T0700
############
0
begin
  dup 15000 less_than while
  1 plus
  4 delay
  dup 0 servo
  dup 1 servo
  dup 2 servo
  dup 3 servo
repeat
drop
return

############
sub T0800
############
0
begin
  dup 15000 less_than while
  1 plus
  4 delay
  dup 4 servo
  dup 5 servo
  dup 6 servo
  dup 7 servo
repeat
drop
return

############
sub T0900
############
0
begin
  dup 15000 less_than while
  1 plus
  4 delay
  dup 12 servo
repeat
drop
return

############
sub T1100
############
0
begin
  dup 15000 less_than while
  1 plus
  4 delay
  dup 8 servo
  dup 9 servo
  dup 10 servo
  dup 11 servo
repeat
drop
return

############
sub T1300
############
0
begin
  dup 15000 less_than while
  1 plus
  4 delay
  dup 14 servo
repeat
drop
return

############
sub T1600
###########
15000
begin
  dup 0 greater_than while
  1 minus
  4 delay
  dup 14 servo
repeat
drop
return

############
sub T1900
###########
15000
begin
  dup 0 greater_than while
  1 minus
  4 delay
  dup 8 servo
  dup 9 servo
  dup 10 servo
  dup 11 servo
repeat
drop
0 13 servo #CH13 T5 OFF
15000
begin
  dup 750 greater_than while
  1 minus
  4 delay
  dup 0 servo
  dup 1 servo
  dup 2 servo
  dup 3 servo
repeat
drop
return

############
sub T2100
###########
15000
begin
  dup -1 greater_than while
  1 minus
  5 delay
  dup 4 servo
  dup 5 servo
  dup 6 servo
  dup 7 servo
  dup 12 servo
repeat
drop
return




jieda 發表於 2012-5-12 18:44:49

##############
#Main Table
#GoReef
#############
Close_all
begin
   T0900 #CH15,16 Blue On
   T1000 #CH17 T5 On
   1 delay_clocks
   T1100 #CH1 Blue On
   T1110 #CH2 Blue On
   T1120 #CH3 Blue On
   T1130 #CH4 Blue On
   T1140 #CH5 Blue On
   T1150 #CH6 Blue On
   T1200 #CH7~12 Cool White On
   T1500 #CH13,14 MXL On
   4 delay_clocks
   T2000 #CH13,14 MXL Off
   2 delay_clocks
   T2300 #CH7~12 Cool White Off
   T0000 #CH1 Blue Off
   T0010 #CH2 Blue Off  
   T0020 #CH3 Blue Off  
   T0030 #CH4 Blue Off  
   T0040 #CH5 Blue Off  
   T0050 #CH6 Blue Off  
   1 delay_clocks
   T0200 #CH17 T5 Off  
   Moon_0200 #CH15,16 Blue Down to 10%  
   3 delay_clocks
   Close_all
   3 delay_clocks #Speed
repeat

#########
sub Close_all
#########  
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
23 servo 22 servo 21 servo 20 servo 19 servo 18 servo
17 servo 16 servo 15 servo 14 servo 13 servo 12 servo
11 servo 10 servo 9 servo 8 servo 7 servo 6 servo
5 servo 4 servo 3 servo 2 servo 1 servo 0 servo
1000 delay
return

###########
sub delay_seconds
###########  
check_temp
begin
   dup while 1 minus 1000 delay
repeat
drop return

###########
sub delay_minutes
##########  
begin
   dup while 1 minus 60 delay_seconds
repeat  
drop return

##########
sub delay_clocks
##########
begin
  dup while 1 minus 60 delay_minutes
repeat  
drop return

##########
sub check_temp
##########
0 18 servo #FAN
0 19 servo #FAN
0 0 740 servo_range
8000 740 760 servo_range
16000 760 1023 servo_range
return

##########
sub servo_range
##########
pot 2 pick less_than logical_not    # >= low
pot 2 pick greater_than logical_not # <= high
logical_and
if
  2 pick 16000 equals
  if
     2 pick 18 servo #FAN
     2 pick 19 servo #FAN
  else  
     2 pick 18 servo #FAN
  endif
endif
drop drop drop
return

#####
sub pot
#####
0 get_position
return

######
sub T0900
######
0
begin
   dup 15001 less_than while
   dup 15 servo
   dup 16 servo   
   1 plus
   240 delay
   check_temp
repeat
drop return

######
sub T1000
######
30000 17 servo
return

######
sub T1100
######
0
begin
   dup 15001 less_than while
   dup 1 servo
   1 plus
   40 delay
   check_temp
repeat
drop return

######
sub T1110
######
0
begin
   dup 15001 less_than while
   dup 2 servo
   1 plus
   40 delay
   check_temp
repeat
drop return

######
sub T1120
######
0
begin
   dup 15001 less_than while
   dup 3 servo
   1 plus
   40 delay
   check_temp
repeat
drop return

######
sub T1130
######
0
begin
   dup 15001 less_than while
   dup 4 servo
   1 plus
   40 delay
   check_temp
repeat
drop return

######
sub T1140
######
0
begin
   dup 15001 less_than while
   dup 5 servo
   1 plus
   40 delay
   check_temp
repeat
drop return

######
sub T1150
######
0
begin
   dup 15001 less_than while
   dup 6 servo
   1 plus
   40 delay
   check_temp
repeat
drop return

######
sub T1200
######
0
begin
   dup 15001 less_than while
   dup 7 servo
   dup 8 servo
   dup 9 servo
   dup 10 servo
   dup 11 servo
   dup 12 servo
   1 plus
   720 delay
   check_temp
repeat
drop return

######
sub T1500
######
0
begin
   dup 15001 less_than while
   dup 13 servo
   dup 14 servo
   1 plus
   240 delay
   check_temp
repeat
drop return

#####
sub T2000
#######
15000
begin
   dup -1 greater_than while
   dup 13 servo
   dup 14 servo
   1 minus
   240 delay
   check_temp
repeat
drop return

#####
sub T2300
#######
15000
begin
   dup -1 greater_than while
   dup 7 servo
   dup 8 servo
   dup 9 servo
   dup 10 servo
   dup 11 servo
   dup 12 servo
   1 minus
   240 delay
   check_temp
repeat
drop return

#####
sub T0000
#######
15000
begin
   dup -1 greater_than while
   dup 1 servo
   1 minus
   40 delay
   check_temp
repeat
drop return

#####
sub T0010
#######
15000
begin
   dup -1 greater_than while
   dup 2 servo
   1 minus
   40 delay
   check_temp
repeat
drop return

#####
sub T0020
#######
15000
begin
   dup -1 greater_than while
   dup 3 servo
   1 minus
   40 delay
   check_temp
repeat
drop return

#####
sub T0030
#######
15000
begin
   dup -1 greater_than while
   dup 4 servo
   1 minus
   40 delay
   check_temp
repeat
drop return

#####
sub T0040
#######
15000
begin
   dup -1 greater_than while
   dup 5 servo
   1 minus
   40 delay
   check_temp
repeat
drop return

#####
sub T0050
#######
15000
begin
   dup -1 greater_than while
   dup 6 servo
   1 minus
   40 delay
   check_temp
repeat
drop return

######
sub T0200
######
0 17 servo
return

#####
sub Moon_0200
#######
15000
begin
   dup -1 greater_than while
   dup 750 greater_than
   if
     dup 15 servo
     dup 16 servo
   else
   endif
   1 minus
   240 delay
   check_temp
repeat
drop return

川頁川頁 發表於 2012-5-12 19:05:26

{:6_145:}{:6_169:}

kitangle 發表於 2012-5-12 19:28:15

死亡習作{:6_179:}

貓貓 發表於 2012-5-12 21:03:48

{:6_178:}幾時得閒幫我搞

肥嘟嘟河馬仔 發表於 2012-5-12 21:06:10

{:6_174:}睇到頭暈

jieda 發表於 2012-5-12 21:41:00

貓貓 發表於 2012-5-12 21:03
幾時得閒幫我搞

放個時間表上黎啦

三一萬能俠 發表於 2012-5-12 22:45:28

傻佬又法作喇.{:7_222:}

ice28720 發表於 2012-5-13 00:19:16

{:6_145:} {:6_174:}

jieda 發表於 2012-5-13 12:00:50

三一萬能俠 發表於 2012-5-12 22:45 static/image/common/back.gif
傻佬又法作喇.

你見唔到我有依個 荷蘭水蓋 咩
{:8_274:}{:8_275:}

fatlankei 發表於 2012-5-13 13:11:37

{:6_174:}

jieda 發表於 2012-5-13 13:15:26

入親黎都暈{:6_174:}

jackyn 發表於 2012-5-13 13:24:06

三一萬能俠 發表於 2012-5-12 22:45 static/image/common/back.gif
傻佬又法作喇.

夠鐘食藥{:8_274:}

jieda 發表於 2012-5-13 15:37:42

jackyn 發表於 2012-5-13 13:24
夠鐘食藥

已經毛藥可救
等變提子乾
。。。。

貓貓 發表於 2012-5-14 16:31:10

dup 0 greater_than while同dup -1 greater_than while有咩分別呀 大師兄

jieda 發表於 2012-5-14 17:17:53

貓貓 發表於 2012-5-14 16:31 static/image/common/back.gif
dup 0 greater_than while同dup -1 greater_than while有咩分別呀 大師兄

少於 0 停止 begin...repeat 依個指令

少於 -1 停止 begin...repeat 依個指令


毛乳 發表於 2012-5-15 08:28:15

眼花花添{:6_174:}
高手既習作

jieda 發表於 2012-5-15 09:30:07

毛乳 發表於 2012-5-15 08:28
眼花花添
高手既習作

依度冇高手
大碌竹就有條
:-P

三一萬能俠 發表於 2012-5-15 10:43:25

jieda 發表於 2012-5-15 09:30 static/image/common/back.gif
依度冇高手
大碌竹就有條
:-P

你有冇呢種spotlight呀????

jieda 發表於 2012-5-15 11:20:27

三一萬能俠 發表於 2012-5-15 10:43 static/image/common/back.gif
你有冇呢種spotlight呀????

OUTDOOR 產品
我地造吾到呀
{:7_237:}
頁: [1] 2
查看完整版本: Pololu 習作