Beginner Guide to Microcontrollers - Tutorial - Stormworks

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone and welcome to a full beginner's guide on how to create mic controllers here in stormwix in this video i'm going to show you how to go from a to z from creating a brand new controller to editing it and to even using it on a creation now microcontrollers are very very powerful tools of logic that we can use here in game now they serve two main purposes for me one it allows me to reduce the size of a larger components that we use inside our creations and two it allows us to create a very complex logic components that we were unable to use with the regular inventory logic components that we have now you'll notice here in front of me i've got a little bit of an example here we have four different doors that i would like to control all with their own pivots and with all their own buttons in order for me to achieve this i would have to use four different switchboxes with four different push to toggle buttons what we're going to do is we're going to build a microcontroller to go and scale that down into a much smaller piece that we can work with so to create a mic controller at the top right hand side of your screen you will notice you have a mic controller editor we can click on that and it then takes us straight into the mic controller editor in here it's broken down into two different sections one is the design and two is the logic in the design you can go and choose the size you want and what type of nodes you also want for example we're going to start off with the properties we can go and call it what name we would like so for example door controller this way we can easily find it inside of our inventory we can even give it a description opens four doors we can change the size of it as we need to either the width or the length then we can move into the actual logic this is where you can either go and add your inputs or your outputs for example on our example here we want four inputs which are on and offs and we want to transfer those into number outputs to actually control our pivots so we're going to go back into our controller and we're going to start adding some logic nodes on here we're going to add one new node that's going to be an on and off and it's going to be an input we can change it to number composite video audio and we can either make it an input or an output we want to have four of these so we're going to add one two three four and we're going to call this door 1 door 2 door 3 and door 4. you'll notice that currently we're getting a warning message on our left hand side of the screen that's because our nodes are currently overlapping we can click on them and drag them to reorder and to move them around now that we have our full inputs i also want four outputs that will allow me to actually go and control the pivots of the doors so to do that we're going to go and add one two three four new nodes you can see they've been added here at the bottom and i can now go and change these to numbers and two outputs that way we can then send that to door one change the second one to a number and to an output and that one's going to go to door number two and i can continue doing that now that we have our four number outputs all labeled we could also give it a description either we don't have to i'm going to go and move them around so they do not overlap anymore and you can now so we have four inputs for on and offs and we also have four outputs for numbers the last option we get inside of here part of the design phase is the symbol this is where you can go and create this and make it a little bit more custom to you it also makes it easier to identify it inside of your inventory so for example i'm going to go and draw a couple of doors here at the top that way i can quickly see this once i am inside of my inventory looking for this controller later on once we're done with that we can now move into the logic phase of a mic controller click on the logic and we get brought to the logic screen here you will notice that you have your inputs and your outputs all in the center of your screen we can now move these across by simply clicking and dragging them to where we would like once they're in here we now have the access to access any of the inventory components that we would like to use for example in the last tutorial we covered a beginner's guide and how to use logic components those same components can be found inside here with the addition of some new ones which we'll cover at a later point so what we want to do is we want to now go and convert this on and off into a number to do that i want to use a switchbox so i'm going to go into my inventory i'm going to go find a numerical switchbox if i couldn't find it by searching up and down i could use the search box and look for switchbox that way i could simply go and find it once i've gone and found it i can then place it down in my creation i'm going to place that over here so we can now move some of these things out of the way that we don't need at the moment and we can bring them back later we want our on off to go and switch the switch box when it's off we want the door closed which is value zero so we can leave it empty and when it's on we want to pass through a one so we're going to be passing through a constant number i can click on it and i can change it to one once i have it as one it goes into the switch box once it goes through the switch box it's then going to go to my door now the thing is i'm currently using push buttons on my doors that means i'll have to continuously press the button or my door to open when i let go it's going to close it i want that to actually be a toggle button so what i'm going to do is i'm going to get another piece of logic and that's going to be a push to toggle we can take that and put that down in between our in and off and our actual numerical switch box that way when we're not pressing this it's getting zero when we press it and toggles it it will send through a one now we can repeat the same process for door number two three four and to do that we could either repeat the same process by going as our inventory choosing a switchbox and moving on or to save time you can actually click and drag this go to the top and copy it once you've copied it you can use the paste button and you can get a few more of these i'm going to paste this four times and put this down on my creation once i've got that on all i now need to do is connect up all of my logic blocks that i have inside here my ins and my arts and i've now gone and created my controller now once you've gone and created the controller and you want to go and test it we can then go and save this so we're going to go and click on save we're going to go to new and we're going to call this our example door controller once we've gone and saved it we can close out of our editor go back into the vehicle workbench go into our inventory and search for the example door controller you can straight away see it's over here it found it and i can straight away find it quickly by looking for that little icon that we created early on once we have that you will notice that we now have a special controller this is our own one we've just gone and built it has four inputs and four outputs we're going to come here and delete all of the logic that we don't need anymore i will look at the size difference from what we've gone from to what we're going to much more compact in comparison now that we have that we can get this connected so door number one door number one door number two door number two door number three door number three and door number four so instead of using all that logic that we had before we've now got a very small little controller that does exactly the same thing press this button goes and opens the door that was a push button because we're using push to toggles it's going to toggle that push it again and it goes and closes it and i can do the same thing with all of these different doors open and close them as we want this is the beauty of using a very small controller now we could add on to that to go back into our controller and edit it even more you can simply select the controller in your vehicle editor and you'll notice the top we have an edit option once we click on the edit option it's then going to take us back into the mic controller editor where we can go and change this and add things let's for example say that we want these doors to close at let's say negative 0.2 we want all the doors to close at negative 0.2 so to do that i've added a constant number and i'm now simply going to go and add those onto the off values of all the switch boxes to test it again i can use the update click confirm it's gone updated automatically and i can go and spawn in you'll now notice that all these doors are closed at a 0.2 angle instead of zero now very useful let's go back into the microcontroller editor and let's edit it some more now once we go back into the controller we have some additional things that we can add on if we would like to possibly control or edit this controller without going inside it we can actually add some options here on the left hand side just like you could when you had a normal logic component let's say for example a pid once you had the pid you can click on it and you can see there's some options on the left hand side here we could add those same type of options on our own custom controller to do that we can go into the editor go to the bottom where we have our inventory of logic blocks and we can then at the bottom find some cool things called properties there is an option for property drop down property number property slider property text and property toggle for example i want to use a slider to control how much in and how much out it goes we can add the slider on click on it call this my door closed i can give it a minimum and a maximum so i'm going to say door closed minimum minus one maximum one and we're going to go 0.1 increments that way instead of using this constant number i can now connect the slider to the switch boxes once i've got the slider on i can update this and you'll now notice that once i've clicked on the controller i now have the option to use a slider to edit this so i can say i want the door to close at negative 0.5 spawn it in and the doors are now all closed at 0.5 so it's a very cool feature to click on this and change it what happens if maybe i want to read out i want to see what the angle of these doors currently are when i look at this controller once i've spawned in i want to go up to it i want to look at this and i want some details well i can actually add some more information we go back into my controller editor go into our inventory of logic blocks you will notice that we have either a tooltip number or a tooltip on and off so i'm going to use a tooltip number i'm going to go and put it over here and i can say this is going to be door number one okay that's what i'm going to be reading out of it so i'm going to take the value that's going to our door i'm going to send it over to our tooltip just over here once i go and update this spawn it in watch what happens once i hover over the controller it shows me what the value that is currently going to door number one if i was to click it have a look it now has a value of one so this is once again very very useful we could even add a on off tooltip so back into our inventory grab our on off tool tip and go and add that over to our wish to toggle this is going to be our door open or closed once it's turned on it's going to be open and once it's turned off it will be closed do we want it always to show yes or do we only want it to show once it's on or if it's off i like to have it always that way it shows both open and it also shows the closed click on update confirm it spawn our creation in and now you'll notice it says the door is closed we can go and open it now it says the doors open you can add these really cool customization parts over here too there are some additional things that you can do inside your mic controller this is my use of some of the very important things like the composite logic blocks here we have audio we have binary we also have composite read and writes we also have a composite switch box and one very popular one which is the lua script taking that allows us to then go and read data put it into a luis script and then send it out back to our creation this is a very very powerful and if you guys would like to know more about that i have a full series on how to use lua and how i take you through building text boxes to building all kinds of different things using lua which is very powerful and very cool at the same time so once you have your controller you can add more and more and more things to this for example maybe we wanted to control this using a composite panel instead of using a on off buttons or push buttons so to do that we're going to go on to our example and delete the push buttons we're going to add a simple composite panel composite panels are really nice and compact and allow you to control multiple things we can click on the composite panel and give each one a button i'm going to name these door 1 door 2 door 3 and door 4. i'm going to make sure that they are a button they're a push and i can also go and change the channel at which they operate at so channel 1 channel 2 channel 3 and channel 4 meaning that each one of those buttons have their own channel that they will send an on off signal to once we've got that we can then go to our mic controller and we can change the on offs to be composite instead so i'm going to go in back to my design i'm going to delete my on offs by using the x delete button next to the node i'm going to add a brand new node this time it's going to be for composite and it's going to be input we're going to go back to our logic and you'll now notice we have a composite input i want to take that and we're going to read the data that we have on those channels so we can go and find a read composite this time we're reading the on off and we need to read four so we're gonna get one two three and four once we have all four we can connect the composite up and go and tell it what channel it's actually reading on first one is reading on channel one the second one is reading on channel two the third one is reading on channel three and the fourth one is reading on channel 4. we can now get those connected to our push to toggles just like we had early on with our regular push buttons once we have that connected we could go and save it however we could even make this more compact simply by clicking and dragging this and changing the width or the length of the actual controller so you can now see i am two by three blocks i can update that goes back here you can see the size have changed and i can now go and make sure all my logic is connected because i moved door number four logic node it disconnected it which means i really need to reconnect it over here once i've done that i can now connect my composite from my panel to my mic controller because i'm in advanced i'm also going to connect my electricity i can now go and spawn that in i can simply see that we have our buttons press button one and it opens up the door press it again goes and closes the door so you can see how much more compact you can make all that logic and all those buttons by using a mic controller and also even some composite panels here in stormwix now the last part of this is you can also go and download and use my controllers from the workshop to do that you can simply go up to the load button go to the workshop and here you can go and download them and use them on your own creations if you've already downloaded and used it before you don't actually have to come into the mic controller editor all you have to do is go into a regular inventory go and search for the actual panel that you would like to use and they will all show up down the bottom underneath the workshop mic controllers here on the right hand side so i think that's a great place to end this video off with hopefully this has been a full beginner's guide and how to use a microcontroller if you would like to see an advanced video going through all the advanced logic components that we have inside of microtranslator let me know in the video's description below and in the comments as always if you have liked this video don't forget that like button and if you want to follow my content for any future content don't forget that subscribe button too and until the next one we will see you then you
Info
Channel: MrNJersey
Views: 19,943
Rating: undefined out of 5
Keywords: Stormworks, update, news, major, next, island, map, area, snow, mountain, land, friday, improvements, thumbnail, screens, monitors, radio, camera, lua, code, script, laser, distance, shark, megalodon, attack, bug, electric, battery, winch, cable, fuel, space, space engineers, seats, car, racing, pipes, rails, sonar, radar, new, audio, link, BASE, spawn, new game, game, wedges, slope, winches, connector, rope, logic, node, modular, engines, guide
Id: Tq7zxjMvrgc
Channel Id: undefined
Length: 20min 56sec (1256 seconds)
Published: Fri Mar 19 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.