Difference between revisions of "User:Wukl"

From ComputerCraft Wiki
Jump to: navigation, search
 
Line 5: Line 5:
 
<br />
 
<br />
 
See you next time! (Maybe ;-) )
 
See you next time! (Maybe ;-) )
 +
 +
== Mah Libraries ==
 +
=== Decimal to 7-segment decoder ===
 +
The decoder assumes that the computer uses RedPower wires, connected to lamps as shown:
 +
[http://banaanvraag.co.cc/pg/8.png Colour key]
 +
The colours are white, orange, magenta, light blue, yellow, lime and pink in clockwise, inwards spiraling order.
 +
<pre>
 +
sevenSeg = {63, 18, 79, 102, 109, 125, 7, 127, 111, 119, 121, 112, 57, 80, 96, 88}
 +
function decode(_sSide, _iNum)
 +
    rs.setBundledOutput(_sSide, sevenSeg[_iNum])
 +
end
 +
</pre>

Latest revision as of 12:06, 24 June 2012

Hi. I'm Wukl, a (somewhat nerdy) programmer from The Netherlands.
I'm an irregular contributor to the wiki, meaning that I contribute when I have time. Maybe I'll stop contributing at one moment and never come back. I don't know.
See you next time! (Maybe ;-) )

Mah Libraries

Decimal to 7-segment decoder

The decoder assumes that the computer uses RedPower wires, connected to lamps as shown: Colour key The colours are white, orange, magenta, light blue, yellow, lime and pink in clockwise, inwards spiraling order.

sevenSeg = {63, 18, 79, 102, 109, 125, 7, 127, 111, 119, 121, 112, 57, 80, 96, 88}
function decode(_sSide, _iNum)
    rs.setBundledOutput(_sSide, sevenSeg[_iNum])
end