Create a Star Wars Tactical Display with a the Round Display!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this session you are going to see how to create a Star Wars tactical display on a mini OLED first by looking at the specifications outwire it to an Arduino how to set up the driver library in the Arduino IDE and finally a while true of the code that create the Star Wars tactical display let's get started this is the display I bought on Amazon I've put the link in the video description it's made by wave share the size is 1.2 inch it's a LCD that can displace up to 65 000 colors and the size of the display is 240 by 240 pixels it's compatible with the Raspberry Pi and other microcontrollers but I am going to use it with an Arduino to make the Star Wars tactical display the device comes with unborn memory so it does not took up any memory on your Arduino and it's a good thing compared for example with the sorted display which is more common this display has no memory at all it creates a 1K buffer of dynamic memory on your Arduino and the dynamic memory on an Arduino is only 2K so it leaves you with 1K 1000 byte which can be a problem for some projects and it has been for me when I built my neutron star detector I crashed the Arduino many times because of a shortage of dynamic memory so using a display like this one which requires no memory on your Arduino is very good because it leaves a lot of free space to play with the display wiring the display is very easy all the pins are well identified at the back of the display it comes with this small GST connectors with all the wires you need to plug it on the Arduino so you first insert the connector into the ausing at the back of the display like this push it a little bit so it is inserted completely now I am going to use an Arduino Nano for this project but the wiring is exactly the same for an Arduino Uno including the PIN numbers here is the diagram for each wire of the display and the corresponding pin on the Arduino pause the video and take your time to wire it on your side this is the completed wiring for the Nano you don't need anything else to make it working now if you're going to use an Arduino Uno for this project you will see that the cable provided with the display is not compatible with the Uno in that case use a simple Dupont wire that you use for prototyping and connect one end of the depend wire to the end of the cable connector do this for each wire of the display and you will be able to connect them to your Arduino Uno now let's see how we can use the display with Arduino waveshare provides a program to use the display on an Arduino I have tried it and it works fine but I prefer to use the Adafruit gfx functions to draw on a display it's more standard and if you have another display you could use my code almost without any changes the Adafruit gfx functions are widely used and easy to understand now we need to use this open source Library which is a gfx library made for the wave share display I've put the link in the video description download the library by clicking the code button and choose the download zip in the menu it will download a zip file in your download folder open your Arduino IDE then open the sketch menu and choose include Library then add zip Library okay the zip file you just downloaded and click open it will install the library and it's now ready to be used let's look at the code that creates the Star Wars tactical display first you need to make sure that you place the aurobash editor file in the same folder where your sketch is saved again you can download the code the link is in the video description I will guide you through The Code by first showing you the main functions before looking at functions that do the inner workings for making the actual tactical display and I have set up a webcam so you can see live what the code is actually doing on the display first in the setup function we need to set the phone the aura Dash font after that we set the size of the phone to 1 and it's important to set it at one because the aurobash font is already sized for displaying at an eight point size on the display we initialize the display with the begin function clear the screen to a black screen which is already what is shown on the webcam and we need to set the rotation to zero which is in fact no rotation on the display we don't want the display to rotate and this function is actually simulating the display booting up and displaying the Tactical display so let's upload it and see what it does so the boot tactical display function is actually drawing the main tactical display so we see a circle quadrants arcs that are drawn at the display objects in white that has been detected some faint object we're not sure if they are detected or not and in this quadrant we're displaying orabesh characters once the setup function has finished executing and the actual tactical display is showing what we are doing in the main Loop is do some animation on the Tactical display so we have five functions that are doing animation and the first function is called blink objects so what the function does is choose randomly one to three objects to Blink at random colors so this choose the objects to be randomly blinked the blinking will goes from y to a random color for 5000 milliseconds which is five seconds at a speed of 700 milliseconds so if we upload the code to see what it does exactly so the display is booting and we see objects blinking white objects here that are blinking from red to White and now we have three objects blinking from green to White so every time in the loop function it's choosing random objects to be blinked now the second function is called blink Arc and what it does is choose a random Arc that we see here in light blue choose a random or Arc and makes one of them blink so it will blink from color blue to a random color again for five seconds at an interval of 700 milliseconds so let's comment out this one so that we see only the blink Arc function doing its job so let's upload the code and you see the arc blinking from red to blue and after five seconds another Arc is chosen randomly and this one is in green now the next function is called blink tactical text and what it does is simply showing the alert word in that quadrant and make it blink for 10 000 milliseconds which is 10 seconds from uh in red from a low intensity to a high intensity so let's upload the code and you see the alert in arabesh displayed in this quadrant and flashing in Red so you don't see it very well because of the resolution of the webcam but it's actually nicely displayed from a low intensity in red to high intensity and the next function following the blink tactical text is just writing again the same text that we saw in our range when the screen is is booted up so if we execute it we will see that after blinking the the alert in red it will write again the orange text in the same quadrant so it's it's kind of restoring the text that was there before the alert was showing so the alert is blinking for 10 seconds and after that writing the the orange text restoring it now what the last function is doing the blink radar on function is just make the uh the orange character this one blinking uh at a 200 millisecond interval for five seconds let's upload it so the text is blinking now we can make all the other function executing in the loop in the main Loop functions so what it does is simply doing the animation for each of the functions blinking random objects white objects at the top blinking an arc followed by blinking the Tactical errors word restoring this text and blinking it so let's upload the code and we will see all the animation [Music] so the blinking of objects after that the blinking of Arc after that the blinking of the other text finally the blinking of the radar on in that quadrant and it's repeating again the same sequences over and over since we are in the main Loop now these are the main functions so it's all you need to know if you just want to reuse the code for your own projects now if we look into the detail functions so in the sequences section you have all the main functions that are used in the setup and the main Loop function so the boot tactical display function the blink radar on right radar on the blink object the blink Arc the blink tactical text and after that uh I've created some geometry functions so to draw a line at an angle because these functions are not available so this dry line a Tango is just drying line on the screen at an angle specified in degrees um this one is actually drawing a rectangle at an angle in degrees so you see these little rectangle in white are drawn at angle um I have a function to draw an arc from uh starting at a degree and ending at a degree so for example from 10 degrees to 90 degree so it's it's actually drawing arcs and in other fruit you just only have a draw Circle function you cannot draw Arc so with this function you can you can actually do a Arc and these functions are for clearing the screen displaying over Bash string on the display some RGB functions to work with the RGB colors the duration functions to help having sequences executed for a specified time and if we look at the top of the file um what's is important the include here so these one are necessary these three ones are necessary to use the display so spih and the 84 gfx are standard Library this one we downloaded first from the open source uh website and this one is the aurobash editor file that is provided on my website uh this is the only two pins that we need to Define in our code the DC and CS pin and the other pins are defined actually in this other file and the rest are just details so coordinate for displaying the arcs coordinate for displaying the lines at an angle all the coordinates for creating the the objects in white which I call the detected objects the undetected objects which are the faint blue objects here so that's it let me know in the comments if you found this session useful and if you got any problems using my code to make your own Star Wars tactical display let me know and I will help you thanks for watching
Info
Channel: The Last Outpost Workshop
Views: 5,767
Rating: undefined out of 5
Keywords: Arduino, props, Starwars, electronic, code, programming, oled, minioled
Id: HzHRJd7rihE
Channel Id: undefined
Length: 16min 12sec (972 seconds)
Published: Wed Jan 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.