請選擇 進入手機版 | 繼續訪問電腦版

海水領域 SeaFishZone

 找回密碼
 立即註冊
查看: 11951|回復: 37

Pololu 習作 [複製鏈接]

論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 2012-5-12 18:41:45 |顯示全部樓層
本帖最後由 jieda 於 2012-5-12 18:43 編輯




##############
#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




論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 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

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 論壇元老

發表於 2012-5-12 19:05:26 |顯示全部樓層
做人不應損人利,出言不應帶刀劍,
犯錯不應不悔改,緣盡不應徒傷神,
求名不應賣良知,求利不應存心黑,
樂命不應太自我。

Rank: 7Rank: 7Rank: 7

發表於 2012-5-12 19:28:15 |顯示全部樓層
死亡習作

Rank: 7Rank: 7Rank: 7

發表於 2012-5-12 21:03:48 |顯示全部樓層
幾時得閒幫我搞

管理員

我係新手

Rank: 9Rank: 9Rank: 9

最佳新人 活躍會員 熱心會員 推廣達人 宣傳達人 灌水之王 突出貢獻 優秀版主 榮譽管理 論壇元老 開網功神

發表於 2012-5-12 21:06:10 |顯示全部樓層
睇到頭暈
我屋企隔離有粒山咁大既鑽石可唔可以唔做野有糧出呀www.facebook.com/groups/999926450065064/

論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 2012-5-12 21:41:00 來自手機 |顯示全部樓層
貓貓 發表於 2012-5-12 21:03
幾時得閒幫我搞

放個時間表上黎啦

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員

發表於 2012-5-12 22:45:28 |顯示全部樓層
傻佬又法作喇.
善用每一個魚袋,雖然幫不上什麼手,但人人都咁做個威力可以好大.

超級版主

永久禁言

Rank: 8Rank: 8

最佳新人 活躍會員 熱心會員 推廣達人 宣傳達人 灌水之王 論壇元老 開網功神

發表於 2012-5-13 00:19:16 |顯示全部樓層

論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 2012-5-13 12:00:50 |顯示全部樓層
三一萬能俠 發表於 2012-5-12 22:45
傻佬又法作喇.

你見唔到我有依個 荷蘭水蓋

123.JPG

Rank: 7Rank: 7Rank: 7

發表於 2012-5-13 13:11:37 |顯示全部樓層

論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 2012-5-13 13:15:26 |顯示全部樓層
入親黎都暈

Rank: 7Rank: 7Rank: 7

發表於 2012-5-13 13:24:06 |顯示全部樓層
三一萬能俠 發表於 2012-5-12 22:45
傻佬又法作喇.

夠鐘食藥

論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 2012-5-13 15:37:42 來自手機 |顯示全部樓層
jackyn 發表於 2012-5-13 13:24
夠鐘食藥

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

Rank: 7Rank: 7Rank: 7

發表於 2012-5-14 16:31:10 |顯示全部樓層
dup 0 greater_than while同dup -1 greater_than while有咩分別呀 大師兄

論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 2012-5-14 17:17:53 |顯示全部樓層
貓貓 發表於 2012-5-14 16:31
dup 0 greater_than while同dup -1 greater_than while有咩分別呀 大師兄

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

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


Rank: 7Rank: 7Rank: 7

發表於 2012-5-15 08:28:15 |顯示全部樓層
眼花花添
高手既習作

論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 2012-5-15 09:30:07 來自手機 |顯示全部樓層
毛乳 發表於 2012-5-15 08:28
眼花花添
高手既習作

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

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員

發表於 2012-5-15 10:43:25 |顯示全部樓層
jieda 發表於 2012-5-15 09:30
依度冇高手
大碌竹就有條
:-P

你有冇呢種spotlight呀????
ZX.png

善用每一個魚袋,雖然幫不上什麼手,但人人都咁做個威力可以好大.

論壇元老

癲佬

Rank: 7Rank: 7Rank: 7

最佳新人 活躍會員 熱心會員 灌水之王 論壇元老

發表於 2012-5-15 11:20:27 |顯示全部樓層
三一萬能俠 發表於 2012-5-15 10:43
你有冇呢種spotlight呀????

OUTDOOR 產品
我地造吾到呀
您需要登錄後才可以回帖 登錄 | 立即註冊

Archiver|手機版|SeaFishZone 海水領域™

GMT+8, 2024-3-29 12:44 , Processed in 0.051320 second(s), 14 queries , Gzip On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回頂部