Compare commits

...

5 Commits

Author SHA1 Message Date
Uberi ae8c4bdd87 Contact info. 2015-01-19 00:23:26 -05:00
Anthony Zhang 41502c4191 New article - Mesecons Basics! 2013-05-08 19:09:21 -04:00
Anthony Zhang bd8ff9e99e Add a note about Luacontroller orientation to all articles. 2013-04-15 17:37:33 -04:00
Anthony Zhang d9b6243b2d Add post to front page and fix cropping on one of the images. 2013-04-14 16:06:29 -04:00
Anthony Zhang 5f24d62f27 New article: the digital clock! 2013-04-14 16:01:39 -04:00
38 changed files with 317 additions and 2 deletions

View File

@ -18,6 +18,56 @@
<p>All articles assume basic knowlege of how Mesecons work, and some may also assume some proficiency in the <a href="http://www.lua.org/about.html">Lua programming language</a>.</p>
<p>For more Mesecons madness, check out Nore's new site, <a href="http://nore.mesecons.net/">Basic Mesecons</a>!</p>
<table class="entry"><tr>
<td>
<h2>Mesecons Basics</h2>
<h3>6/5/13 - Uberi</h3>
<p>An intermission from building to explain the very very basics of Mesecons circuitry. No previous experience required! There's a bit of building too, apparently.</p>
<p class="difficulty">Difficulty level:
<img src="img/Difficulty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
(1/10)
</p>
<a href="projects/MeseconsBasics/index.html" class="post">Read on...</a>
</td>
<td>
<img src="projects/MeseconsBasics/img/Basics.png" alt="Post preview" class="preview">
</td>
</tr></table>
<table class="entry"><tr>
<td>
<h2>Digital Clock</h2>
<h3>14/4/13 - Uberi</h3>
<p>A clock that is digital. Oh, and it displays the time too.</p>
<p class="difficulty">Difficulty level:
<img src="img/Difficulty.png">
<img src="img/Difficulty.png">
<img src="img/Difficulty.png">
<img src="img/Difficulty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
<img src="img/DifficultyEmpty.png">
(4/10)
</p>
<a href="projects/Clock/index.html" class="post">Read on...</a>
</td>
<td>
<img src="projects/Clock/img/Clock.gif" alt="Post preview" class="preview">
</td>
</tr></table>
<table class="entry"><tr>
<td>
<h2>Node Detector</h2>
@ -94,6 +144,7 @@
</tr></table>
<br><br><br><br>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
<p>Need to contact me? Do so at <a href="http://uberi.github.io/">my website</a>!</p>
</div>
</body>
</html>

17
projects/Clock/Clock.we Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

BIN
projects/Clock/img/RTC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

136
projects/Clock/index.html Normal file
View File

@ -0,0 +1,136 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="StyleSheet" href="../../Style.css" type="text/css">
<link href="../../rainbow/theme.css" rel="stylesheet" type="text/css">
<script src="../../rainbow/rainbow.min.js"></script>
<title>Clock | The Mesecons Laboratory</title>
</head>
<body>
<div id="content">
<h1><a href="../../index.html" class="title">Mesecons Laboratory</a></h1>
<p id="subtitle">Adventures in digital circuitry.</p>
<br>
<h2>Clock</h2>
<h3>14/4/13 - Uberi</h3>
<p class="difficulty">Difficulty level:
<img src="../../img/Difficulty.png">
<img src="../../img/Difficulty.png">
<img src="../../img/Difficulty.png">
<img src="../../img/Difficulty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
(4/10)
</p>
<p>This article assumes you have the <a href="https://github.com/Jeija/minetest-mod-digilines/">Digilines mod</a>, which I generally consider a de facto part of Mesecons. It is still possible to complete it without this mod, but replacing its functionality with fancy wiring is an exercise left to the reader.</p>
<p>Don't you ever wish you had a clock in-game while playing Minetest, just to keep track of all the time you're wasting? Need a timepiece for the top of the main tower in town hall? Let's build one!</p>
<img src="img/Clock.gif" alt="Clock" class="picture">
<p>This clock will never need adjustment and works even if you use the /time command! This is made possible using the Digilines RTC.</p>
<h4>Step 1: Design</h4>
<p>Before we build anything, let me explain how the Digilines RTC works.</p>
<p>The RTC, short for Real Time Clock, is a Digilines device that allows you to obtain the current (in-game) time of day. How does it work? When you plonk an RTC down, you can right-click it to set the channel:</p>
<img src="img/RTC.png" alt="Real Time Clock" class="picture">
<p>Now, whenever you send a digilines signal on that channel, using "GET" as the message, it will in turn send a digilines signal on that same channel, but with the current time as the message.</p>
<p>However, this time isn't just in a standard time format; it's represented as fractional hours. Let's take a look:</p>
<pre>/time 0 is midnight.
/time 500 is half-past midnight.
/time 7250 is around 7:15 AM.
/time 1500 is around 3 o'clock PM.</pre>
<p>The thousands place and above denotes the hour in 24-hour notation, while the hundreds place and below denotes a fraction of that hour.</p>
<p>When we get to the programming section, there will be a more detailed overview of how to deal with coverting this time into the one we're more used to.</p>
<h4>Step 2: Layout</h4>
<p>We want the clock to look as nice as possible. Therefore, we start from the display:</p>
<img src="img/Display.png" alt="Clock display" class="picture">
<p>Well this is a nice display and all, but there's one big problem with it - it doesn't display anything! Let's remedy that situation:</p>
<img src="img/WiredDisplay.png" alt="Wired displays" class="picture">
<p>Each digit display has been wired up to a standard seven segment driver supporting the digits 0-9, since that's all we really need. Note that port A faces the lightstone and port C faces the camera in the image above. While the machine can be built in any orientation, I will assume we are using the one shown. Changing the Luacontroller code to work with other orientations is an exercise left for the reader.</p>
<p>For the sake of completeness, here is the code inside each Luacontroller on the leftmost display (the ones column of the minutes):</p>
<p>Top:</p>
<pre data-language="lua">if event.type == "program" then
mem.accept = {[0]=true, [2]=true, [3]=true, [5]=true, [6]=true, [7]=true, [8]=true, [9]=true}
elseif event.type == "digiline" then
port.a = mem.accept[event.msg.minute]
port.b, port.d = port.a, port.a
end</pre>
<p>Second from top:</p>
<pre data-language="lua">if event.type == "program" then
mem.accept1 = {[0]=true, [4]=true, [5]=true, [6]=true, [8]=true, [9]=true}
mem.accept2 = {[0]=true, [1]=true, [2]=true, [3]=true, [4]=true, [7]=true, [8]=true, [9]=true}
elseif event.type == "digiline" then
port.b = mem.accept1[event.msg.minute]
port.d = mem.accept2[event.msg.minute]
end</pre>
<p>Middle:</p>
<pre data-language="lua">if event.type == "program" then
mem.accept = {[2]=true, [3]=true, [4]=true, [5]=true, [6]=true, [8]=true, [9]=true}
elseif event.type == "digiline" then
port.a = mem.accept[event.msg.minute]
port.b, port.d = port.a, port.a
end</pre>
<p>Second from bottom:</p>
<pre data-language="lua">if event.type == "program" then
mem.accept1 = {[0]=true, [2]=true, [6]=true, [8]=true}
mem.accept2 = {[0]=true, [1]=true, [3]=true, [4]=true, [5]=true, [6]=true, [7]=true, [8]=true, [9]=true}
elseif event.type == "digiline" then
port.b = mem.accept1[event.msg.minute]
port.d = mem.accept2[event.msg.minute]
end</pre>
<p>Bottom:</p>
<pre data-language="lua">if event.type == "program" then
mem.accept = {[0]=true, [2]=true, [3]=true, [5]=true, [6]=true, [8]=true, [9]=true}
elseif event.type == "digiline" then
port.a = mem.accept[event.msg.minute]
port.b, port.d = port.a, port.a
end</pre>
<p>The other displays have nearly the exact same code, except <code>event.msg.minute</code> is replaced with <code>event.msg.tenminute</code>, <code>event.msg.hour</code>, and <code>event.msg.tenhour</code>, from left to right for each digit display.</p>
<h4>Step 3: Construction</h4>
<p>Now we can wire up the timekeeping unit. First, a Digilines RTC is connected to a Luacontroller that polls it when we need it to:</p>
<img src="img/Timekeeping1.png" alt="Clock connected to clock driver" class="picture">
<p>The RTC, unsuprisingly, is set to the channel "clock".</p>
<p>The code inside the Luacontroller is quite simple:</p>
<pre data-language="lua">if event.type == "on" then
digiline_send("clock", "GET")
end</pre>
<p>Whenever any of the pins are turned on, it polls the RTC for the current time.</p>
<p>The RTC can now be wired to another Luacontroller that does the calculations to convert the time into the hours and minutes most people are familiar with:</p>
<img src="img/Timekeeping2.png" alt="Clock connected to display driver" class="picture">
<p>A blinky plant is a very reliable oscillator. Luacontrollers and microcontrollers have delay capabilities, but they will not last past a server restart. Using a blinky plant ensures the clock will work regardless of the conditions it is in.</p>
<p>The code inside the lower Luacontroller calculates the number of hours and minutes from the time value, and turns them into individual digits to be displayed:</p>
<pre data-language="lua">if event.channel == "clock" then
time = event.msg * 24
hour = math.floor(time)
tenhour, hour = math.floor(hour / 10), hour % 10
time = (time % 1) * 60
minute = math.floor(time)
tenminute, minute = math.floor(minute / 10), minute % 10
digiline_send("", {tenhour=tenhour, hour=hour, tenminute=tenminute, minute=minute})
end</pre>
<p>After calculations, it sends off a Digilines signal with all the digits packed into a table. The field names should seem rather familiar - they are the same ones that we used in the displays!</p>
<p>The only thing left to do is ensure the Digilines signal reaches all the displays:</p>
<img src="img/FinalWiring.png" alt="Displays connected to clock" class="picture">
<p>The displays update automatically as time passes by. It works!</p>
<h4>Step 4: Improvements</h4>
<p>The clock as it is right now doesn't look very good, with all those wires showing. How about an enclosure?</p>
<img src="img/Final.png" alt="Clock with enclosure" class="picture">
<p>Or perhaps a blimp?</p>
<img src="img/FinalBlimp.png" alt="Clock with enclosure" class="picture">
<p>After all, you can't have a world without blimps.</p>
<h4>Downloads</h4>
<p>All files are available under the same license as this article. The WE schematics can be loaded using the //load command in <a href="https://github.com/Uberi/MineTest-WorldEdit">WorldEdit</a>.</p>
<p><a href="Clock.we" class="post">Clock in WorldEdit format (WE)</a></p>
<br><br><br><br>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
<p>Need to contact me? Do so at <a href="http://uberi.github.io/">my website</a>!</p>
</div>
</body>
</html>

View File

@ -61,7 +61,7 @@
<h4>Step 4: Programming</h4>
<p>If you don't know much about Luacontrollers, you might find the <a href="http://mesecons.net/luacontroller/">Luacontroller tutorial</a> handy.</p>
<p>Port A is facing our switch.</p>
<p>Port A is facing our switch. If you made it in a different orientation, simply replace the port names with their rotated equivalents. For example, <code>port.b</code> would become <code>port.c</code> in the code if you built the machine 90 degrees clockwise from the orientation used here.</p>
<p>We're going to first outline the basic actions the controller will perform:</p>
<pre data-language="lua">if pin.a then
--extend
@ -102,6 +102,7 @@ end</pre>
<p><a href="DoublePistonLowProfile.wem" class="post">Low profile double sticky piston driver in WorldEdit-Meta format (WEM)</a></p>
<br><br><br><br>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
<p>Need to contact me? Do so at <a href="http://uberi.github.io/">my website</a>!</p>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,106 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="StyleSheet" href="../../Style.css" type="text/css">
<link href="../../rainbow/theme.css" rel="stylesheet" type="text/css">
<script src="../../rainbow/rainbow.min.js"></script>
<title>Mesecons Basics | The Mesecons Laboratory</title>
</head>
<body>
<div id="content">
<h1><a href="../../index.html" class="title">Mesecons Laboratory</a></h1>
<p id="subtitle">Adventures in digital circuitry.</p>
<br>
<h2>Mesecons Basics</h2>
<h3>6/5/13 - Uberi</h3>
<p class="difficulty">Difficulty level:
<img src="../../img/Difficulty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
<img src="../../img/DifficultyEmpty.png">
(1/10)
</p>
<p>So far we've already looked at a couple of machines, but not at Mesecons itself. That won't do! This is a usage guide for new Mesecon users, including those without Redstone experience.</p>
<img src="img/Basics.png" alt="Circuits demonstration" class="picture">
<p>Let's look at exactly what Mesecons can do, and how you can use it.</p>
<h4>Overview</h4>
<p>Mesecons is a digital circuitry mod for Minetest that allows players to create circuits that can do nearly anything.</p>
<p>Mesecons resembles real life circuitry in that you have wires that carry information around and various things that affect or are affected by them, but the basic similarities end there.</p>
<p>There are three basic types of things in the Mesecons mod: wires, receptors, and effectors. We'll look at each one in detail below, but for now we'll go through a summary.</p>
<p>Wires conduct signals around, while receptors do the actual creating of those signals. Effectors do things based on those signals. Some things can act as both receptors and effectors, which is useful for doing things like modifying signals.</p>
<h4>Wires</h4>
<p>These are Mesecon wires:</p>
<img src="img/Wires.png" alt="Mesecon wires" class="picture">
<p>Left to right: normal wire, insulated wire, T-junction wire, corner wire, vertical wire, MESE block. Rear wires are on, front wires are off.</p>
<p>There are a lot of different wires that have distinct uses, but all of them perform essentially the same task. First of all, Mesecon wire has two states: on and off. The on state is generally brighter or more saturated in color than the off state. Wires are off when you place them down, but they can be turned on by being conducted to.</p>
<p>A Mesecon wire that is on (the wire is in the on state) will cause other wires and effectors adjacent to it to turn on as well, a process known as conduction. Which adjacent ones that turn on are determined by the specific type of wire.</p>
<p>In the pictures below, the black boxes denote where the wire conducts. Other locations are completely unaffected by whether it is on or off.</p>
<p>The normal wire conducts in the four cardinal directions, North-East-South-West, but not diagonally. Looking from the side, it conducts to nodes on the same level, or the level above and below it. However, it does not conduct directly above or below:</p>
<img src="img/NormalWire.png" alt="Normal wire rules" class="picture">
<p>The insulated wire, in contrast, conducts only at the ends. The direction is determined by the direction you are facing when you place the wire.</p>
<img src="img/InsulatedWire.png" alt="Insulated wire rules" class="picture">
<p>The T-junction wire gets its name from the shape it forms and conducts in. The direction is determined by the direction you are facing when you place the wire.</p>
<img src="img/TJunctionWire.png" alt="T-junction wire rules" class="picture">
<p>The corner wire conducts only at its ends as well, but they are perpendicular to each other. The direction is determined by the direction you are facing when you place the wire.</p>
<img src="img/CornerWire.png" alt="Corner wire rules" class="picture">
<p>The vertical wire has caps on each end that conduct only in the cardinal directions on the same vertical level as well as directly above or below. The thin parts without caps only conduct directly above or below. Vertical wires can be stacked on top of each other, and only the top and bottom ones will be capped.</p>
<img src="img/VerticalWire.png" alt="Vertical wire rules" class="picture">
<p>The MESE block is extended by Mesecons to conduct in the cardinal directions as well as directly above and below.</p>
<img src="img/MESEBlock.png" alt="MESE block rules" class="picture">
<p>Two wires will only conduct between each other if they are adjacent and both conduct to the location of the other:</p>
<img src="img/Rules.png" alt="Connection rules" class="picture">
<h4>Receptors</h4>
<p>Wires are nice and all, but how do we turn them on if the only way to make one come on is to have something that is already on beside it? That's where receptors come in. Receptors are, in short, things that are not wires, but can also be on and off. Receptors can do things like turning on and off depending on whether there is light, when a player interacts with them, or a lot of things, really. There are far too many types of receptors to describe here, but we'll cover the most important ones.</p>
<p>Power plants are simply always on - they will power anything in the same positions as normal Mesecon wire. Blinky plants behave similarly, but turn on and off every few seconds:</p>
<img src="img/Plants.png" alt="Power and blinky plants" class="picture">
<p>Switches, buttons, and levers are all player controlled - punching switches and levers toggles them between on and off, while buttons turn on when punched and then turn off again after a little while. Switches conduct to the same positions as normal wire, while buttons and levers only conduct to the back or to the node behind the one to the back:</p>
<img src="img/Switches.png" alt="Player-controlled switches" class="picture">
<p>Pressure plates come in wood and stone varieties, which differ mainly in appearance. They turn on when someone or something stands on them - this includes players, mobs, and items. Special rules mean that in addition to conducting to the same locations as normal wire, they also conduct to the node below the node directly below themselves:</p>
<img src="img/PressurePlates.png" alt="Pressure plates" class="picture">
<h4>Effectors</h4>
<p>Now that we have a way to create and carry signals, it's time to do something with them. Effectors are made specifically for this purpose. Effectors can do things like giving off light, moving nodes around, playing music, or even running chat commands. There are far too many types of effectors to describe here, but we'll cover the most important ones.</p>
<p>Meselamps and lightstone light up when they have an on signal and don't give off any light otherwise. Meselamps are brighter than lightstones, while lightstones are available in many different colors:</p>
<img src="img/Lighting.png" alt="Lighting effectors" class="picture">
<p>Pistons can push a column of nodes and entities by one block, and the sticky piston can also pull the closest one. Entities on top of a stack being pushed horizontally are also moved. Movestones (not shown) do something similar, but can push nodes along a "rail" made of conductive materials:</p>
<img src="img/Pistons.gif" alt="Pistons" class="picture">
<p>Noteblocks play a certain note when they receive an on signal. The instrument used to play the note is determined by the node it's placed on top of, while the pitch (how high the note is) is changed by punching it. Placing one on wood planks causes it to make a litecrash sound, tree trunks cause a crash sound, chests cause a snare sound, stone causes a kick sound, glass causes a hihat sound, and anything else causes a piano sound:</p>
<img src="img/Noteblocks.png" alt="Noteblocks" class="picture">
<p>Command blocks execute a chat command when they receive an on signal. However, they are not obtainable in survival mode without cheats due to the potential for abuse. Command blocks can only be changed by their owners (the player that placed it) and show a dialog when right clicked, which allows the target, command, and parameters to be set. Certain special commands are also available - more details can be found by using the "/help" chat command:</p>
<img src="img/CommandBlocks.png" alt="Command blocks" class="picture">
<h4>Putting it all together</h4>
<p>Now that we know how to create, transmit, and cause actions with Mesecon signals, we can look at the area where Mesecons really shines: manipulating signals with digital logic.</p>
<p>Let's say we want to have street lamps that come on only at night. A basic street lamp looks something like the following:</p>
<img src="img/Streetlamp1.png" alt="Basic street lamp" class="picture">
<p>At the moment, it's not giving off light. Let's give the lightstone an on signal:</p>
<img src="img/Streetlamp2.png" alt="Working street lamp" class="picture">
<p>Now it's always on. But what about coming on only at night? Let's power it using a solar panel:</p>
<img src="img/Streetlamp3.png" alt="Daytime street lamp" class="picture">
<p>Just a small problem remains - it only turns on in the day! That's about as useful as a solar powered flashlight. What we need to do is take the opposite of the solar panel's signal.</p>
<p>This is where digital logic comes in. In digital logic, the operation of taking the opposite of a signal is called a "logical NOT". It just so happens that Mesecons has a few devices that can do this operation, as well as many more. In our case, a Mesecon torch does the job very nicely:</p>
<img src="img/StreetlampFinal.png" alt="Final street lamp" class="picture">
<p>The Mesecon torch simply takes the signal on the other side of the node it's attached to, and changes its state so that it's the opposite. That means that when the solar panel is on, the torch is off, and when the solar panel is off, the torch is on. In our case, we use this to detect the absence of light by taking the opposite of the solar panel's light detection.</p>
<p>There are tons of different ways you can manipulate signals like this. In fact, manipulate them enough and there's nothing you can't build - see the Tic-Tac-Toe and Node Detector articles on this site for inspiration. Logic gates can be used just like they are in real life to build many of the electronics we use every day. For the most complex manipulations, there are even Luacontrollers that can be programmed in-game to do just about anything.</p>
<h4>Going Forward</h4>
<p>You probably won't be building Mesecons computers by this point, but hopefully you'll agree that Mesecons does in fact add a huge amount of awesome to Minetest no matter what your playing style is.</p>
<p>For the engineer in you, why not give <a href="https://github.com/Jeija/minetest-mod-digilines/">Digilines</a> a try? LCD displays, data buses, and more are waiting to be made into something incredible. Everything works with Mesecons, of course.</p>
<p>If you love automating things and making them more efficient, <a href="http://forum.minetest.net/viewtopic.php?id=2155">Pipeworks</a> is a great choice. Craft items, transport them, or even organize them, all automatically! Pipeworks, of course, also works great with Mesecons - you can control how pipes and tubes work using signals.</p>
<p>However, if your interests lie with digital logic and manipulating different signals to do different things (like building doors that open only if you push the right sequence of buttons), look no further! Mesecons has logic gates, programmable controllers, and even timing circuits for you to play to your heart's content.</p>
<br><br><br><br>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
<p>Need to contact me? Do so at <a href="http://uberi.github.io/">my website</a>!</p>
</div>
</body>
</html>

View File

@ -26,7 +26,7 @@
<img src="../../img/DifficultyEmpty.png">
(3/10)
</p>
<p>This article assumes you have the <a href="https://github.com/Jeija/minetest-mod-digilines/">Digilines mod</a>, which I generally consider a de facto part of Mesecons. It is still possible to complete it without this mod, but replacing its functionality with fancy wiring is an exercise left to the reader.
<p>This article assumes you have the <a href="https://github.com/Jeija/minetest-mod-digilines/">Digilines mod</a>, which I generally consider a de facto part of Mesecons. It is still possible to complete it without this mod, but replacing its functionality with fancy wiring is an exercise left to the reader.</p>
<p>Have you ever woken up just feeling like you want to abuse some game mechanics? No? Well, how about detecting different types of nodes?</p>
<img src="img/Detector.gif" alt="Node detector" class="picture">
<p>How did it know the node was sand? Same way it does it below:</p>
@ -70,6 +70,7 @@
<p>So far you've probably been scanning these nodes by firing those pistons manually. Well, that's not very useful, is it? We can probably tell what kind of node it is by ourselves. But this device becomes a lot more useful when automated. Let's begin with my favourite tool for that, the Luacontroller:</p>
<img src="img/Detector5.png" alt="Controller attached to scanner" class="picture">
<p>Here I've wired the Luacontroller ports to the two sets of pistons, as well as the outputs of the two solar panels. In order to be able to send a signal that starts the scanning process, I've also attached a digiline to send these signals on and receive scan results from.</p>
<p>You'll notice that port C is facing the pistons, and port D is facing the solar panels. If you built it in a different orientation, simply replace the port names with their rotated equivalents. For example, <code>port.b</code> would become <code>port.c</code> in the code if you built the machine 90 degrees clockwise from the orientation used here.</p>
<p>Now to program it. We want to send a signal on the digiline, and have the Luacontroller do a number of things:</p>
<ol>
<li>Fire the two pistons that clear the machine and push in the new node to be scanned.</li>
@ -111,6 +112,7 @@ end</pre>
<br><br><br><br>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
<p>Need to contact me? Do so at <a href="http://uberi.github.io/">my website</a>!</p>
</div>
</body>
</html>

View File

@ -46,6 +46,7 @@
<img src="img/Cell.gif" alt="Tic-tac-toe cell" class="picture">
<p>Now to add the control mechanism. We want a nice, simple interface that lets us set the value of any cell. For that, I'm going to set up some Luacontrollers and wire them together with digilines:</p>
<img src="img/CellWired.png" alt="Fully wired cell" class="picture">
<p>Our Luacontrollers have port A is facing the lightstone, and port C facing the back. If you made it in a different orientation, simply replace the port names with their rotated equivalents. For example, <code>port.b</code> would become <code>port.c</code> in the code if you built the machine 90 degrees clockwise from the orientation used here.</p>
<p>The top and bottom Luacontrollers have the following code:</p>
<pre data-language="lua">if event.channel == "set11" then
if event.msg == 1 then
@ -193,6 +194,7 @@ end</pre>
<br><br><br><br>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
<p>Need to contact me? Do so at <a href="http://uberi.github.io/">my website</a>!</p>
</div>
</body>
</html>