This is an old revision of the document!
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in
/var/www/kucjica/emperors-wiki/inc/parser/handler.php on line
1458
Warning: Declaration of syntax_plugin_wrap_div::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in
/var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/div.php on line
43
Warning: Declaration of syntax_plugin_wrap_div::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in
/var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/div.php on line
81
Warning: Declaration of syntax_plugin_wrap_closesection::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in
/var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/closesection.php on line
23
Warning: Declaration of syntax_plugin_wrap_closesection::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in
/var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/closesection.php on line
29
Warning: Declaration of syntax_plugin_wrap_span::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in
/var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/span.php on line
43
Warning: Declaration of syntax_plugin_wrap_span::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in
/var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/span.php on line
63
Warning: Declaration of syntax_plugin_gallery::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in
/var/www/kucjica/emperors-wiki/lib/plugins/gallery/syntax.php on line
51
Warning: Declaration of syntax_plugin_gallery::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in
/var/www/kucjica/emperors-wiki/lib/plugins/gallery/syntax.php on line
147
Warning: Declaration of syntax_plugin_vshare::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in
/var/www/kucjica/emperors-wiki/lib/plugins/vshare/syntax.php on line
47
Warning: Declaration of syntax_plugin_vshare::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in
/var/www/kucjica/emperors-wiki/lib/plugins/vshare/syntax.php on line
107
Warning: preg_match(): Compilation failed: invalid range in character class at offset 3444 in
/var/www/kucjica/emperors-wiki/inc/parser/lexer.php on line
118
A PCRE internal error occured. This might be caused by a faulty plugin
====== ledclass.py ======
external functions for different LED behaviours
<code python>
import serial, glob
try:
portled = glob.glob("/dev/arduino-leds")[0]
except IndexError:
portled = glob.glob("/dev/ttyACM0")[0]
print "portled", portled
serled = serial.Serial(portled, 19200, timeout=1)
def clearAll():
for j in range(4):
message = ("%d,0,0,0")%(j)
serled.write(message+'\n')
def fadeIn(led, color):
for i in range(255)[::15]:
if color == "red":
r = i
g = 0
b = 0
elif color == "green":
r = 0
g = i
b = 0
message = (str(led)+",%d,%d,%d")%(r,g,b)
serled.write(message+"\n")
def fadeInRed(led):
for i in range(255)[::15]:
message = (str(led)+",%d,0,0")%(i)
serled.write(message+"\n")
def fadeInGreen(led):
for i in range(255)[::15]:
message = (str(led)+",0,0,%d")%(i)
serled.write(message+"\n")
def fadeInYellow(led):
for i in range(255)[::15]:
message = (str(led)+",%d,0,%d")%(i,i)
serled.write(message+"\n")
def fadeInPurple(led):
for i in range(255)[::15]:
message = (str(led)+",%d,%d,0")%(i,int(i*0.2))
serled.write(message+"\n")
def fadeInTurq(led):
for i in range(255)[::15]:
message = (str(led)+",0,%d,%d")%(int(i*0.2),i)
serled.write(message+"\n")
# fading OUT functions by colour:
def fadeOutRed(led):
for i in range(255,0,-1)[::25]:
message = (str(led)+",%d,0,0")%(i)
serled.write(message+"\n")
serled.write(str(led)+",0,0,0\n")
def fadeOutGreen(led):
for i in range(255,0,-1)[::25]:
message = (str(led)+",0,0,%d")%(i)
serled.write(message+"\n")
serled.write(str(led)+",0,0,0\n")
def fadeOutYellow(led):
for i in range(255,0,-1)[::25]:
message = (str(led)+",%d,0,%d")%(i,i)
serled.write(message+"\n")
serled.write(str(led)+",0,0,0\n")
def fadeOutPurple(led):
for i in range(255,0,-1)[::25]:
message = (str(led)+",%d,%d,0")%(i,int(i*0.2))
serled.write(message+"\n")
serled.write(str(led)+",0,0,0\n")
def fadeOutTurq(led):
for i in range(255,0,-1)[::25]:
message = (str(led)+",0,%d,%d")%(int(i*0.2),i)
serled.write(message+"\n")
serled.write(str(led)+",0,0,0\n")
</code>