grhmhome [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=57271 PICO8 LED Matrix Display Project <p>After seeing some cool LED display projects on the forums, I decided make one too. This is a large 128x128 wall display, roughly 384mm&sup2; or 15.11 inches&sup2; in freedom units. This is very cool, but not cheap. This project could cost you upwards to 400 USD if you decide to make one yourself. This project requires you to solder (soldering a simple bridge) and you will need to use the Linux terminal on your Raspberry Pi. </p> <h1>Do this project at your own risk.</h1> <img style="margin-bottom:16px" border=0 src="/media/57271/20230707_220629.jpg" alt="" /> <img style="margin-bottom:16px" border=0 src="/media/57271/20230706_232634.jpg" alt="" /> <h1>Parts list:</h1> <p><a href="https://www.adafruit.com/product/3211">https://www.adafruit.com/product/3211</a> - Adafruit RGB Matrix Bonnet for Raspberry Pi</p> <p><a href="https://www.adafruit.com/product/4732">https://www.adafruit.com/product/4732</a> - 64x64 RGB LED Matrix - 3mm Pitch</p> <p>Raspberry Pi. I used a Raspberry PI 400. My Pi 3 and 3b+ didn't want to work with this.</p> <p>You will also need access to a soldering iron and solder as you'll be soldering a bridge.</p> <p>I also suggest getting longer IDC ribbon cables as the ones that come with the displays were not long enough for connecting all 4.</p> <h1>Step 1:</h1> <p>What you'll need to do is flash a microSD card. I used Raspberry Pi OS Lite (Legacy). Something lightweight will be perfect. You will also need to enable SSH access and connect your Pi to Wifi. This can all be done with the Raspberry Pi Imager. Pi Imager: <a href="https://www.raspberrypi.com/software/">https://www.raspberrypi.com/software/</a></p> <h1>Step 2:</h1> <p>Next, you'll need to follow The Adafruit guide here on connecting the displays: <a href="https://learn.adafruit.com/adafruit-rgb-matrix-bonnet-for-raspberry-pi/driving-matrices">https://learn.adafruit.com/adafruit-rgb-matrix-bonnet-for-raspberry-pi/driving-matrices</a></p> <p>It's also important that you connect the panels like this:</p> <img style="margin-bottom:16px" border=0 src="/media/57271/aaaa1.png" alt="" /> <h1>Step 3:</h1> <p>Connect your your Pi via SSH. On Windows, I use Putty. You could connect your Pi to a monitor instead, but I ended up going the headless route.</p> <p>Install the scripts in the github page below:</p> <p><a href="https://github.com/jenissimo/pico8-led">https://github.com/jenissimo/pico8-led</a></p> <p>In your home folder, you should have a directory called pico8-led. Inside that folder, you will want to edit the file run_led.sh and change the line that shows sudo ./xserver-screen...</p> <p>For me, this is what I had to change mine to. It may be different depending on how you wire up your displays, but this worked for me.<br /> <code>sudo ./xserver-screen --led-rows=64 --led-cols=64 --led-chain=4 --led-slowdown-gpio=4 --led-parallel=1 --led-pixel-mapper=&quot;U-mapper&quot; --led-brightness 80</code></p> <h1>Step 4:</h1> <p>Run the script, run_splore.sh and you should see PICO 8 running. I suggest having this script auto-start so you don't have to keep connecting via SSH. Games with a black background look the nicest. This project is also great for displaying demos. The display is hard to show on camera, but the colors look very nice in person.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/20230707_231533.jpg" alt="" /> <p>I hope this guide is helpful. I plan on installing mine into a wooden frame and mounting mine to a wall.</p> https://www.lexaloffle.com/bbs/?tid=53349 https://www.lexaloffle.com/bbs/?tid=53349 Sat, 08 Jul 2023 06:05:43 UTC ChatGPT creates a pong game for Pico 8 and other random silly things <p> <table><tr><td> <a href="/bbs/?pid=122634#p"> <img src="/bbs/thumbs/pico8_zowwogisi-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=122634#p"> GPT_Pong</a><br><br> by <a href="/bbs/?uid=57271"> grhmhome</a> <br><br><br> <a href="/bbs/?pid=122634#p"> [Click to Play]</a> </td></tr></table> </p> <p>I found out that Open AI's ChatGPT understands programming, including Pico 8 LUA. I had it create something simple, a pong game. I did create the sound effects, but 99.9% of the code was created by ChatGPT. I found the best way to get it to add more code without timing out is to just request it to create code snippets for _draw() and or _update()</p> <p>Code:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>p1_y = 36 p2_y = 36 ball_x = 64 ball_y = 36 ball_vx = 1 ball_vy = 1 p1_score = 0 p2_score = 0 game_state = &quot;start&quot; function _update() if game_state == &quot;start&quot; and (btn(4) or btn(5)) then game_state = &quot;play&quot; p1_score = 0 p2_score = 0 end -- move the paddles if btn(0) then p1_y -= 1 end if btn(1) then p1_y += 1 end if btn(2) then p2_y -= 1 end if btn(3) then p2_y += 1 end -- clamp the paddles to the screen p1_y = mid(8, p1_y, 68) p2_y = mid(8, p2_y, 68) -- move the ball ball_x += ball_vx ball_y += ball_vy -- bounce the ball off the paddles if ball_x &lt; 3 and ball_y &gt; p1_y-4 and ball_y &lt; p1_y+4 then ball_vx = -ball_vx sfx(1) end if ball_x &gt; 123 and ball_y &gt; p2_y-4 and ball_y &lt; p2_y+4 then ball_vx = -ball_vx sfx(1) end -- bounce the ball off the top and bottom of the screen if ball_y &lt; 0 then ball_vy = -ball_vy sfx(0) end if ball_y &gt; 72 then ball_vy = -ball_vy sfx(0) end if ball_x &lt; 0 then sfx(2) p2_score += 1 ball_x = 64 ball_y = 36 ball_vx = 1 ball_vy = 1 end if ball_x &gt; 128 then sfx(2) p1_score += 1 ball_x = 64 ball_y = 36 ball_vx = -1 ball_vy = 1 -- check for game over if p1_score &gt;= 10 or p2_score &gt;= 10 then -- check for input to restart the game if btn(4) or btn(5) then p1_score = 0 p2_score = 0 ball_x = 64 ball_y = 36 ball_vx = 1 ball_vy = 1 end end end end function _draw() cls() -- check the game state if game_state == &quot;start&quot; then -- clear the screen cls() -- display the start screen print(&quot;gpt-pong&quot;, 48, 24, 7) print(&quot;credits: by. chatgpt&quot;, 32, 36, 7) print(&quot;press x or o to start game&quot;, 24, 48, 7) elseif game_state == &quot;play&quot; then cls() -- draw the paddles and ball rectfill(0, p1_y-4, 2, p1_y+4, 7) rectfill(126, p2_y-4, 128, p2_y+4, 7) circfill(ball_x, ball_y, 2, 7) -- draws the player scores print(p1_score, 4, 2, 7) print(p2_score, 118, 2, 7) -- check for game over if p1_score &gt;= 10 or p2_score &gt;= 10 then -- clear the screen cls() -- display the winner if p1_score &gt;= 10 then print(&quot;player 1 wins!&quot;, 32, 36, 7) else print(&quot;player 2 wins!&quot;, 32, 36, 7) end -- display the restart message print(&quot;press x or o to restart the game&quot;, 32, 48, 7) end end end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=50701 https://www.lexaloffle.com/bbs/?tid=50701 Sun, 18 Dec 2022 07:13:07 UTC Cartridge based TV console for fantasy consoles such as PICO 8 <p>Hello there. I'm working on a TV console utilizing a Raspberry Pi 3B+, but any Raspberry Pi should work in theory. Essentially, this takes some of my previous cad projects and crams it into something awesome. I present the nameless console(needs a name).</p> <img style="margin-bottom:16px" border=0 src="/media/57271/console.jpg" alt="" /> <h1>How does it work?</h1> <p>A USB SD card reader functions as a cartridge slot and I made 3D printable shells to go around the SD cards to give them a cartridge look and feel. A bash script loads when the Pi gets turned on that looks for a PICO8 game on the SD card. This can work with other fantasy consoles. I haven't figured out how to get multi-cart games to work with one SD card, but for now, single cart games should work. Right now the TV console project is in beta, but the cad files and startup scripts will be open source.</p> <p>What I would like is suggestions for this project. I will update later with guides on setting this up. This project can also be used as a template for your own projects if you want.</p> <p>A couple of pictures of me playing some games.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/FJxKHE7VkAA2US-.jpg" alt="" /> <img style="margin-bottom:16px" border=0 src="/media/57271/FKADG7hVUAIOCya.jpg" alt="" /> <h1>What is there left to do on this project before its finished?</h1> <p>I need to figure out what I want to do with the front two buttons. I could map them as power and reset, or I could remove them completely. Also, I need to make the console a little bit larger to make plugging in a USB extender into the SD card reader less difficult. In the current design, I have to cut the rubber housing on the USB extender and bend the USB plug 90 degrees, which could damage it. Lastly, I want to figure out how to make cartridges work with multicart games, which I'm unsure how to get that part to work.</p> <p>I'm looking for suggestions and feedback. Constructive criticism is also welcome.</p> https://www.lexaloffle.com/bbs/?tid=46310 https://www.lexaloffle.com/bbs/?tid=46310 Wed, 26 Jan 2022 04:43:35 UTC Pico 8 on a C64 Maxi <p>Hello again. I received my C64 Maxi (TheC64) yesterday and turned it into a Pi powered retro computer. It works great, but required some manually configuring to get fully working. The keyboard works out of the box, but the joystick does not and requires you to compile the SDL2 key mapper software. You could even code Pico 8 games on this thing. I chose Retropie so I can easily select and play C64 games and try out other retro computer emulators.</p> <p>What is a C64 Maxi? It is the bigger brother of the C64 Mini. It has a full sized working keyboard and you can easily play games or code on it. The downside is the default system is hard-coded for a 720p screen resolution. My old Dell VGA monitor doesn't support this screen resolution</p> <p>Why? I wanted to use my old square VGA Dell monitor for C64 games and try seeing if I could use the keyboard on Pico 8. Also, the mod I did doesn't alter the default Maxi boards in any way. I disconnected the keyboard and created a USB adapter that plugs into the C64 Maxi keyboard. If I want to go back to a stock configuration, I'm able to. Do I recommend this mod? Yes I do.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/20211031_130212.jpg" alt="" /> <img style="margin-bottom:16px" border=0 src="/media/57271/20211031_130432.jpg" alt="" /> <img style="margin-bottom:16px" border=0 src="/media/57271/20211031_123415.jpg" alt="" /> <img style="margin-bottom:16px" border=0 src="/media/57271/20211031_123058.jpg" alt="" /> https://www.lexaloffle.com/bbs/?tid=45206 https://www.lexaloffle.com/bbs/?tid=45206 Sun, 31 Oct 2021 20:51:06 UTC Pico 8 on a NTSC CRT TV <p>Hello again. I saw that someone was able to display Pico 8 on a CRT monitor, so I wanted to do the same. If you have any questions or want help getting Pico 8 to display on a CRT monitor, post down below and I can try to help. I was able to do this on a Pi Zero and a Pi 3b+. The hardest part of this project for me wasn't getting the display to work with my Pi 3b+, but USB audio not wanting to cooperate. I tried using the audio jack on my Pi, but it was interfering with the soldered wires I had. It all works now. This is officially my favorite way to play. Yes, playing on a handheld is cool and all, but Pico 8 looks amazing on a CRT.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/CRT0.jpg" alt="" /> <img style="margin-bottom:16px" border=0 src="/media/57271/CRT1.jpg" alt="" /> https://www.lexaloffle.com/bbs/?tid=44944 https://www.lexaloffle.com/bbs/?tid=44944 Mon, 11 Oct 2021 01:34:12 UTC Feature request: extcmd(splore) command <p>I've seen that some people have made their own boot animation carts, but I would like to make my own, and have it where it will run a command at the end of the animation that makes Pico 8 boot into splore.</p> <p>This is how it could work in a dedicated Pico 8 machine:</p> <p>Turn on machine &gt; autorun Pico 8 via bash script or something else with the -run animationcart.p8.png command at the end&gt; animation runs &gt; code at end of cart executes extcmd(splore) or another command that makes Pico 8 go to splore.</p> <p>I've came up a idea to go around doing this, but it is too clunky. I could make a bash script that runs 2 instances of Pico 8 at the same time. One will boot into Pico 8 and run the cart, but shutdown that instance of Pico 8 afterwards, then the other Pico 8 instance would still be running and be in splore.</p> <p>I would like to see this added in a future version of Pico 8 if possible. Thanks for making Pico 8 and have a great day.</p> https://www.lexaloffle.com/bbs/?tid=44591 https://www.lexaloffle.com/bbs/?tid=44591 Sat, 11 Sep 2021 21:05:04 UTC The search for the perfect physical media for Pico 8 <p>Hello again. I've been working on different ideas for running Pico 8 games on physical media.</p> <p>I've tried SD cards and while they are cool and can function as cartridges, they tend to have too much storage and I find that wasteful when Pico 8 games are less than a megabyte. I have been experimenting with other ideas such as using 3.5&quot; floppies. They are much more smaller in storage compared to a SD card, but they have their own setbacks.</p> <p>What would you recommend I try to use as physical media for Pico 8 games? I could try ROM cartridges, but they will probably be the most expensive route and be the most complicated.</p> <p>Here is a picture of a Pico 8 game I put on floppy.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/20210910_185349.jpg" alt="" /> <p>The tutorial I made for mounting SD cards 'should' work for floppies with slight changes.<br /> <a href="https://www.lexaloffle.com/bbs/?tid=44530">https://www.lexaloffle.com/bbs/?tid=44530</a></p> <p>I'm not going to sell Pico 8 games that aren't mine on physical media, I'm just trying out new ideas.</p> https://www.lexaloffle.com/bbs/?tid=44588 https://www.lexaloffle.com/bbs/?tid=44588 Sat, 11 Sep 2021 02:11:41 UTC How to make 3D printable Pico 8 cartridges that work <p>I was working on a new project that involved learning how rom cartridges worked, so I asked around for help and someone suggested that I use SD cards. I ended up liking the idea and decided to use that in my current Pico 8 fanmade handheld project as well. What I did was created a shell that goes around a SD card to give it a cartridge look and feel. A USB SD card reader will read the 'cartridges'. I also wrote a bash script that will search for a p8.png file in your SD card directory and have Pico 8 run that file or run splore instead if no SD card cartridge was connected. Firstly, when you plug in a SD card to your card reader, you should type in </p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> sudo fdisk -l </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>. This should list your SD card. Mine was listed as /dev/sda1</p> <p>I then mounted the SD card and made sure Pico 8 could run the file. While in my Pico 8 directory, I typed in </p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> ./pico8 -run /media/usb0/run.p8.png </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>and Pico 8 ran the file, but use whatever directory you mount your SD card in. Why did I call the cartridge run.p8.png? I tried just using </p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> ./pico8 -run /media/usb0/*p8.png </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>, but I thought, if I had multiple cartridges on the same SD card, it would pick one out of random, and I didn't want that, especially for multicart games. Maybe there is a better way at doing this. If there is, please let me know. I made it where the first cartridge can be called run.p8.png, but other cartridges can be called whatever you want. I modified /etc/rc.local and added a line before the screen driver where it would mount the SD card. For me, I put in </p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> sudo mount /dev/sda1 /media/usb0 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>I then created a bash script that would either load a game from a SD card cartridge or run splore if there was no cartridge connected.</p> <p>Here is the bash script below: I named it autorunpico8.sh, but you can call it whatever you want.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> #!/bin/bash if [ -f &quot;/media/usb0/run.p8.png&quot; ] then exec /home/pi/pico-8/pico8 -run /media/usb0/run.p8.png &amp; else exec /home/pi/pico-8/pico8 -splore &amp; fi exit 0 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Once you create the file, you will want to make it executable by typing in </p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> chmod +x yourscripthere.sh </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Test out the script and see if it works. If it does, put the script in /etc/rc.local above exit 0 at the bottom of the file.</p> <p>When you turn on your Raspberry Pi, Pico 8 will load the cartridge.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/20210905_214858.jpg" alt="" /> <p>When there is no 'cartridge' connected to your SD card reader it boots into splore, but if you really want to, you can make a 100% offline system and make it only look for cartridges.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/20210905_215106.jpg" alt="" /> <p>I will upload the cartridge shells on my Thingiverse page soon enough. The front of the cartridge shell allows you to use custom artwork and you can modify the top text to be anything you want. You slide in a SD card and if it isn't a snug fit, hot glue gun might help keep it in place. The back plate of the cartridge can be removed so you can remove the SD card if it stops working. I hope this tutorial is useful and these cartridges can be used in your Pico 8 projects. Have a wonderful day.</p> https://www.lexaloffle.com/bbs/?tid=44530 https://www.lexaloffle.com/bbs/?tid=44530 Mon, 06 Sep 2021 05:24:50 UTC Pico 8 fan handheld <p>Hello again. I am working on a fan handheld for the Pico 8. Once this project is finished, I'll upload all the cad files onto Thingiverse and create a guide on how to create your own Pico 8 handheld. This is what the first prototype shell looks like.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/20210807_050534-1024x929.jpg" alt="" /> <p>The button spacing feels perfect, but the shell is too wide. Fortunately, it seems like I can shrink it down roughly 5mm so it will be around the same thickness of a Dmg-01 Gameboy. The rounded edges makes it feel comfortable to hold. I might reposition the battery holder location so I might be able to shrink it down another 5mm. I'll take any suggestions for this project as I want this to as good as possible. My goals for this project: </p> <ul> <li>It must be comfortable to hold and not too bulky. </li> <li>It must have a 128x128 resolution screen.</li> <li>It must have sound.</li> <li>It must take AA batteries, but you are free to modify the project to use rechargeable batteries</li> </ul> <p>What I have done so far:</p> <ul> <li>Made some designs in fusion360</li> <li>Printed a prototype shell</li> <li>Got the screen to work and fixed the screen tearing and glitching I was experiencing</li> </ul> <p>I have most of the parts already, besides a speaker, controller board, and power switch, but I will look for solutions for those. Once I'm happy with all the components, I'll print some mounting plates to hold the various hardware, add some screw holes to hold the parts in place, and make a battery door so you can replace your AA batteries. Feel free to leave a comment if you have any suggestions for this project. </p> <p>Thanks for your time,<br /> grhmhome</p> <p>Update: I am working on the back plate of the shell. This is what I have designed so far.</p> <img style="margin-bottom:16px" border=0 src="/media/57271/batterydoorandback.PNG" alt="" /> <p>The back plate has a battery door and housing for the battery holder that will use 3 AA batteries. I'm thinking of using the whole back plate to mount all the electronics.<br /> This is what the console looks like assembled from the back. </p> <img style="margin-bottom:16px" border=0 src="/media/57271/batterydoorandback_2.PNG" alt="" /> <p>Next on this project, I'm going to work on the controls and sound. Once that is done, I will create spots on the back plate to mount all the electronics.</p> <p>Update: I finished the first beta version of my handheld. The handheld is fully assembled, but I came across glaring issues. One of those is the fact the buttons are not keyed in, so the round plastic buttons will freely rotate. The other issues are software related. I'm going to upload the cad files without the Pico 8 logo. I will not write a tutorial yet as it is incomplete, but I can help people with getting the screen, power button, and general controls to work. You are allowed to do anything you want with the cad files I'm going to be uploading to Thingiverse.</p> <p>Edit: I have uploaded the beta cad files for those who want to modify what I've done. I have included .step and stl files so you can modify or make your own. I will be writing a large blog post on how to make one, for those who are interested, including getting the software side of things working.</p> <p><a href="https://www.thingiverse.com/thing:4938902">https://www.thingiverse.com/thing:4938902</a></p> https://www.lexaloffle.com/bbs/?tid=44145 https://www.lexaloffle.com/bbs/?tid=44145 Sun, 08 Aug 2021 17:23:57 UTC Waveshare 128x128 RGB OLED Display on a Pi Zero <img style="margin-bottom:16px" border=0 src="/media/57271/20210808_013118.jpg" alt="" /> <p>Hello there. My name is Grhmhome and I've been working on a fan handheld for Pico 8, using a Pi Zero W. I've been working on this project for roughly a week now. I'm proficient with Cad, 3D printing, and I've been learning soldering. I wanted to make a handheld for the Pico 8 with the correct aspect ratio screen and I finally found the perfect screen for my project. This post is a quick tutorial on how to get the Waveshare 128x128 RGB OLED display module to work properly. This took me all of yesterday to get to work properly as I had to troubleshoot and do more troubleshooting.</p> <p>Where to find this screen?<br /> Amazon: <a href="https://www.amazon.com/dp/B07D9NVJPZ/">https://www.amazon.com/dp/B07D9NVJPZ/</a><br /> Waveshare: <a href="https://www.waveshare.com/1.5inch-rgb-oled-module.htm">https://www.waveshare.com/1.5inch-rgb-oled-module.htm</a></p> <p>I used the latest version of RetroPie for this project.</p> <p>Step 1. Wiring the screen. The pins I used are as follows. The connector that comes with the display should be color coded.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>VCC (Power +): Any 3.3V GND (Power -): Any GND DIN: GPIO 10 MOSI CLK: GPIO 11 CLK CS: GPIO 8 CE0 DC: GPIO 25 RST: GPIO 24</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>If you need help on figuring which pin are which, I used this handy site: <a href="https://pinout.xyz/">https://pinout.xyz/</a></p> <p>Step 2.<br /> Type sudo raspi-config and enable SPI interfaces. You will also want to configure your system to autologin as Pi and boot into the terminal. If you are using RetroPie like me, you will also have to go into the RetroPie settings and make sure your not booting directly into Emulationstation, but into the terminal and have it autologin as Pi.</p> <p>Step 3. Install wiring pi and cmake. If your OS doesn't have git, install that too.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>sudo apt-get update sudo apt install cmake sudo apt install wiringpi sudo apt install git</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Step 5. Clone the git repo <code>git clone https://github.com/juj/fbcp-ili9341.git</code></p> <p>Step 6. Edit some of the files. You will need to edit config.h and change <code>//#define UPDATE_FRAMES_WITHOUT_DIFFING</code></p> <p>to <code>#define UPDATE_FRAMES_WITHOUT_DIFFING</code> </p> <p>Also you will want to edit ssd1351.cpp and change the values on line 35 from 97 to 127.<br /> On ssd1351.h you will want to change #define DISPLAY_NATIVE_HEIGHT 96 to 128 on line 21.</p> <p>Step 7. Once you finish doing that copy the following commands into the terminal.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>mkdir build cd build cmake -DSSD1351=ON -DGPIO_TFT_DATA_CONTROL=25 -DGPIO_TFT_RESET_PIN=24 -DSPI_BUS_CLOCK_DIVISOR=20 -DSTATISTICS=0 .. make -j</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Make sure the display is working by typing in <code>sudo ./fbcp-ili9341</code></p> <p>If the display is working correctly, continue on. If it is not working, you will have to make sure the screen is connected to the correct GPIO pins.</p> <p>Step 8. Next, you will want to make sure the display driver will autostart when you turn on your Pi Zero. Edit /etc/rc.local and add the following above the line that says exit 0 <code>sudo /home/pi/fbcp-ili9341/build/fbcp-ili9341 &amp;</code></p> <p>After that, you will want to edit /boot/config.txt and add the following</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>hdmi_group=2 hdmi_mode=87 hdmi_cvt=128 128 60 hdmi_force_hotplug=1</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>If you want to autostart Pico 8, which I'm assuming you are wanting, add another line in /etc/rc.local above exit 0. Change the path accordingly wherever you decided to put Pico 8.</p> <p><code>sudo /home/pi/pico-8/pico8 -splore &amp;</code></p> <p>Now, when you reboot your system, it should boot directly to Pico 8 every time using the display. I hope this tutorial was helpful. If you have any questions, or if I'm missing anything, feel free to leave a message.</p> https://www.lexaloffle.com/bbs/?tid=44144 https://www.lexaloffle.com/bbs/?tid=44144 Sun, 08 Aug 2021 17:01:56 UTC