Tumgik
#rasberry pi pico
bat-farme · 10 months
Text
so excited to wire my diy boxx 2morrow <3
kind of anxious about measuring the red wires and whether or not i should tape the microcontroller to the box or let it just hang there so that vibrations and jostling don't mess w the chip as much. wires should be fine though since i bought stranded ones.
Tumblr media
this is what it looks like outside. ive made myself a little guide to make it easier soldering each button to the default pinhole set in the firmware, but again anxious about that part. i'll defo (probably) have it in the center to save on wire. the ground though, that part i found pretty fun on my stream deck.
thing im most anxious abt is the usb wire. im hoping i can find one lying around that i can leave inside to have a dedicated wire since i dont have a breakout. but if it comes to it, i can share the one i use for my drawing tablet. unplugging its gonna be a bitch though.
hope in the future i can also wire a gamecube usb, so i can play on my wii or at locals that use gamecubes.
6 notes · View notes
techcree · 1 year
Text
Raspberry Pi Pico Bluetooth und Micropython
Tumblr media
Der Raspberry Pi Pico kann auch Bluetooth (BT). Leider wurde sich auf die falsche Programmiersprache dabei eingeschossen. Wie ist der Stand heute?
So langsam legt sich Staub auf den Raspberry Pi Pico. Jedenfalls wenn man darauf wartet Bluetooth mit Micropython nutzen zu wollen. Zwar beherrschte der kleine preiswerte Microcontroller der Raspberry Pi Foundation UK Bluetooth (BT) bereits von Beginn der Ausführung Pico W an, doch es gab in dem Sinne qualsi keine Software. Die Anpassung der SDK, also des kleinen Betriebssystems ist zwar mittlerweile erfolgt, doch dies beschränkt sich heute immer noch auf die Programmierung mittels C/C++.
Tumblr media
Im Bereich Micropython hat sich bisher immernoch nichts getan. C++ hat seinen Urspung in der maschinennahen Programmierung und wurde von AT&T bereits 1979 als C Variante entwickelt, die mit sehr wenigen Schlüsselworten auskommt. Ich würde fast den Vergleich hernehmen wie es im Fall von Python und Micropython auch so ist. Micropython bedeutet nicht, dass es eine für Microcontroller angepasste Python Version ist, sondern das es klein ist. Es hat also eine deutlich abgespecktere Basis-Bibliothek. Das ist sicher der Grund dafür, dass es gerade auf Microcontrollern wie dem Raspberry Pi Pico so erfolgreich eingesetzt wird.
Vergleichen wir oberflächlich C++ mit Micropython ist es in erster Linie sicher nur eine Frage der Performance. In zweiter Linie geht es aber auch um Kompatibilität zu Anwendungen. Also in dem Zusammenhang, dass man einfach bei Micropython bleibt, wenn man damit bereits begonnen hat Lösungen zu prgrammieren. Micropython beschränkt uns jedoch im direkten Vergleich natürlich dann auch wegen der stark eingedampften Basis-Bibliothek. Auch wenn sich grundsätzlich zusätzliche Libaries (Lib) hinzufügen, also dazu installieren lassen, so gibt es schlicht für bestimmte Themen keine verfügbaren Micropython Bibliotheken.
Ein wichtiger Aspekt ist, dass C/C++ in Punkt Verbreitung bzw. Beliebtheit heute eigentlich keine so richtige Rolle mehr spielt. Python ist schlicht heute die beliebteste Programmiersprache weltweit. Deshalb kommt dann auch Micropython eine so große Bedeutung zu. Leider hat sich in den letzten Wochen seit die neue SDK für BT für den PicoW erschienen ist hier nichts spührbar getan. Warum mag das der Fall sein? Nun zum einen ist der PicoW für vieles gut, aber seine Einsatzgebiete bei BT sicher so überschaubar, dass es für die meißten schlicht auch garkeine Rolle spielt. Außerdem gibt es Zubehör, welches preiswert ergänzt werden kann und für das es dann auch die erforderlichen Lib's gibt. So beispielsweise das HC-05/HC-06 Klasse 2 Bluetooth SPP-Modul mit Serial Port Protocol, welches eine drahtlose serielle Kommunikation ermöglicht und schon weit verbreitet ist.
Die Frage stellt sich aber natürlich für was soll man das überhaupt mit einem Microcontroller nutzen? Um es mit einem sogenannten Master-Bluetooth-Gerät zu nutzen, wie beispielsweise einem PC, Smartphone oder Tablet. Das sicher griffigste Beispiel ist den Microcontroller dann als Steuer-/Programmeinheit für eine drrahtlose tastatur und Maus zu verwenden. Wir bauen also eine DIY Tastatur und wollen diese mittels BT an einen PC anschließen können. Solche Projekte gibt es bereits und auch bei Kickstarter lassen sich einige dieser Dinge finden, bei denen ein Rasberry Pi Pico Herz schlägt. Wir könnten sicher auch einen kleinen Roboter via BT vom Smartphone aus stzeuern und derlei Dinge.
All zu viel gibt es aber da nicht. Das liegt daran, dass der Raspberry Pi Pico W eben ein WLAN Modul besitzt und so einen Webserver zur Verfügung stellen kann der dann im Browser über die ihm zugewiesene IP Adresse im WLAN Netz erreichbar ist. Damit läßt sich erstmal ziemlich viel machen. Kurz um, wir müssen abwarten ob Micropython hier etwas ergänzen wird und wann.
Tumblr media
Licht am Ende des Tunnels! Es gibt offenbar ein Projekt dazu, doch das scheint noch etwas Zeit zu brauchen. Jedenfalls gibt es dazu nunn auch eine Beta, die aber noch in einem sehr experimentellen Stadium zu sein scheint. Und ja es ist pimoroni, die hier am Werke sind. Das könnte uns nicht nur insgesamt im Thema voranbringen, sondern dürfte bedeuten, dass pimoroni ggf. in Zukunft spezielle Lösungen, also Produkte auf den Markt bringen wird bei dem BT ein wesentliches Merkmal sein könnte.
Hört sich doch gut an. Aktuell bleibt es aber beim Status Quo.
0 notes
philipholt · 5 years
Text
The PICO-8 Virtual Fantasy Console is an idealized constrained modern day game maker
Tumblr media
I love everything about PICO-8. It's a fantasy gaming console that wants you - and the kids in your life and everyone you know - to make games!
How cool is that?
You know the game Celeste? It's available on every platform, has one every award and is generally considered a modern-day classic. Well the first version was made on PICO-8 in 4 days as a hackathon project and you can play it here online. Here's the link when they launched in 4 years ago on the forums. They pushed the limits, as they call out "We used pretty much all our resources for this. 8186/8192 code, the entire spritemap, the entire map, and 63/64 sounds." How far could one go? Wolf3D even?
"A fantasy console is like a regular console, but without the inconvenience of actual hardware. PICO-8 has everything else that makes a console a console: machine specifications and display format, development tools, design culture, distribution platform, community and playership. It is similar to a retro game emulator, but for a machine that never existed. PICO-8's specifications and ecosystem are instead designed from scratch to produce something that has it's own identity and feels real. Instead of physical cartridges, programs made for PICO-8 are distributed on .png images that look like cartridges, complete with labels and a fixed 32k data capacity."
What a great start and great proof that you can make an amazing game in a small space. If you loved GameBoys and have fond memories of GBA and other small games, you'll love PICO-8.
How to play PICO-8 cartridges
If you just want to explore, you can go to https://www.lexaloffle.com and just play in your browser! PICO-8 is a "fantasy console" that doesn't exist physically (unless you build one, more on that later). If you want to develop cartridges and play locally, you can buy the whole system (any platform) for $14.99, which I have.
If you have Windows and Chrome or New Edge you can just plug in your Xbox Controller with a micro-USB cable and visit https://www.lexaloffle.com/pico-8.php and start playing now! It's amazing - yes I know how it works but it's still amazing - to me to be able to play a game in a web browser using a game controller. I guess I'm easily impressed.
It wasn't very clear to me how to load and play any cartridge LOCALLY. For example, I can play Demon Castle here on the Forums but how do I play it locally and later, offline?
The easy way is to run PICO-8 and hit ESC to get their command line. Then I type LOAD #cartid where #cartid is literally the id of the cartridge on the forums. In the case of Demon Castle it's #demon_castle-0 so I can just LOAD #demon_castle-0 followed by RUN.
Alternatively - and this is just lovely - if I see the PNG pic of the cartridge on a web page, I can just save that PNG locally and save it in C:\Users\scott\AppData\Roaming\pico-8\carts then run it with LOAD demon_castle-0 (or I can include the full filename with extensions). THAT PNG ABOVE IS THE ACTUAL GAME AS WELL. What a clever thing - a true virtual cartridge.
One of the many genius parts of the PICO-8 is that the "Cartridges" are actually PNG pictures of cartridges. Drink that in for a second. They save a screenshot of the game while the cart is running, then they hide the actual code in a steganographic process - they are hiding the code in two of the bits of the color channels! Since the cart pics are 160*205 there's enough room for 32k.
A p8 file is source code and a p8.png is the compiled cart!
How to make PICO-8 games
The PICO-8 software includes everything you need - consciously constrained - to make AND play games. You hit ESC to move between the game and the game designer. It includes a sprite and music editor as well.
From their site, the specifications are TIGHT on purpose because constraints are fun. When I write for the PalmPilot back in the 90s I had just 4k of heap and it was the most fun I've had in years.
Display - 128x128 16 colours
Cartridge Size - 32k
Sound - 4 channel chip blerps
Code - Lua
Sprites - 256 8x8 sprites
Map - 128x32 cels
"The harsh limitations of PICO-8 are carefully chosen to be fun to work with, to encourage small but expressive designs, and to give cartridges made with PICO-8 their own particular look and feel."
The code you will use is LUA. Here's some demo code of a Hello World that animates 11 sprites and includes two lines of text
t = 0 music(0) -- play music from pattern 0 function _draw() cls() for i=1,11 do -- for each letter for j=0,7 do -- for each rainbow trail part t1 = t + i*4 - j*2 -- adjusted time y = 45-j + cos(t1/50)*5 -- vertical position pal(7, 14-j) -- remap colour from white spr(16+i, 8+i*8, y) -- draw letter sprite end end print("this is pico-8", 37, 70, 14) print("nice to meet you", 34, 80, 12) spr(1, 64-4, 90) -- draw heart sprite t += 1 end
That's just a simple example, there's a huge forum with thousands of games and lots of folks happy to help you in this new world of game creation with the PICO-8. Here's a wonderful PICO-8 Cheat Sheet to print out with a list of functions and concepts. Maybe set it as your wallpaper while developing? There's a detailed User Manual and a 72 page PICO-8 Zine PDF which is really impressive!
And finally, be sure to bookmark this GitHub hosted amazing curated list of PICO-8 resources! https://github.com/pico-8/awesome-PICO-8
  Writing PICO-8 Code in another Editor
There is a 3 year old PICO-8 extension for Visual Studio Code that is a decent start, although it's created assuming a Mac, so if you are a Windows user, you will need to change the Keyboard Shortcuts to something like "Ctrl-Shift-Alt-R" to run cartridges. There's no debugger that I'm seeing. In an ideal world we'd use launch.json and have a registered PICO-8 type and that would make launching after changing code a lot clearer.
There is a more recent "pico8vscodeditor" extension by Steve Robbins that includes snippets for loops and some snippets for the Pico-8 API. I recommend this newer fleshed out extension - kudos Steve! Be sure to include the full path to your PICO-8 executable, and note that the hotkey to run is a chord, starting with "Ctrl-8" then "R."
Editing code directly in the PICO-8 application is totally possible and you can truly develop an entire cart in there, but if you do, you're a better person than I. Here's a directory listing in VSCode on the left and PICO-8 on the right.
And some code.
You can expert to HTML5 as well as binaries for Windows, Mac, and Linux. It's a full game maker! There are also other game systems out there like PicoLove that take PICO-8 in different directions and those are worth knowing about as well.
What about a physical PICO-8 Console
A number of folks have talked about the ultimate portable handheld PICO-8 device. I have done a lot of spelunking and as of this writing it doesn't exist.
You could get a Raspberry Pi Zero and put this Waveshare LCD hat on top. The screen is perfect. But the joystick and buttons...just aren't. There's also no sound by default. But $14 is a good start.
The Tiny GamePi15, also from Waveshare could be good with decent buttons but it has a 240x240 screen.
The full sized Game Hat looks promising and has a large 480x320 screen so you could play PICO-8 at a scaled 256x256.
The RetroStone is also close but you're truly on your own, compiling drivers yourself (twitter thread) from what I can gather
The ClockworkPI GameShell is SOOOO close but the screen is 320x240 which makes 128x128 an awkward scaled mess with aliasing, and the screen the Clockwork folks chose doesn't have a true grid if pixels. Their pixels are staggered. Hopefully they'll offer an alternative module one day, then this would truly be the perfect device. There are clear instructions on how to get going.
The PocketCHIP has a great screen but a nightmare input keyboard.
For now, any PC, Laptop, or Rasberry Pi with a proper setup will do just fine for you to explore the PICO-8 and the world of fantasy consoles!
Sponsor: OzCode is a magical debugging extension for C#/.NET devs working in Visual Studio. Get to the root cause of your bugs faster with heads-up display, advanced search inside objects, LINQ query debugging, side-by-side object comparisons & more. Try for free!
© 2019 Scott Hanselman. All rights reserved.
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
      The PICO-8 Virtual Fantasy Console is an idealized constrained modern day game maker published first on http://7elementswd.tumblr.com/
0 notes
suzanneshannon · 5 years
Text
The PICO-8 Virtual Fantasy Console is an idealized constrained modern day game maker
Tumblr media
I love everything about PICO-8. It's a fantasy gaming console that wants you - and the kids in your life and everyone you know - to make games!
How cool is that?
You know the game Celeste? It's available on every platform, has one every award and is generally considered a modern-day classic. Well the first version was made on PICO-8 in 4 days as a hackathon project and you can play it here online. Here's the link when they launched in 4 years ago on the forums. They pushed the limits, as they call out "We used pretty much all our resources for this. 8186/8192 code, the entire spritemap, the entire map, and 63/64 sounds." How far could one go? Wolf3D even?
"A fantasy console is like a regular console, but without the inconvenience of actual hardware. PICO-8 has everything else that makes a console a console: machine specifications and display format, development tools, design culture, distribution platform, community and playership. It is similar to a retro game emulator, but for a machine that never existed. PICO-8's specifications and ecosystem are instead designed from scratch to produce something that has it's own identity and feels real. Instead of physical cartridges, programs made for PICO-8 are distributed on .png images that look like cartridges, complete with labels and a fixed 32k data capacity."
What a great start and great proof that you can make an amazing game in a small space. If you loved GameBoys and have fond memories of GBA and other small games, you'll love PICO-8.
How to play PICO-8 cartridges
If you just want to explore, you can go to https://www.lexaloffle.com and just play in your browser! PICO-8 is a "fantasy console" that doesn't exist physically (unless you build one, more on that later). If you want to develop cartridges and play locally, you can buy the whole system (any platform) for $14.99, which I have.
If you have Windows and Chrome or New Edge you can just plug in your Xbox Controller with a micro-USB cable and visit https://www.lexaloffle.com/pico-8.php and start playing now! It's amazing - yes I know how it works but it's still amazing - to me to be able to play a game in a web browser using a game controller. I guess I'm easily impressed.
It wasn't very clear to me how to load and play any cartridge LOCALLY. For example, I can play Demon Castle here on the Forums but how do I play it locally and later, offline?
The easy way is to run PICO-8 and hit ESC to get their command line. Then I type LOAD #cartid where #cartid is literally the id of the cartridge on the forums. In the case of Demon Castle it's #demon_castle-0 so I can just LOAD #demon_castle-0 followed by RUN.
Alternatively - and this is just lovely - if I see the PNG pic of the cartridge on a web page, I can just save that PNG locally and save it in C:\Users\scott\AppData\Roaming\pico-8\carts then run it with LOAD demon_castle-0 (or I can include the full filename with extensions). THAT PNG ABOVE IS THE ACTUAL GAME AS WELL. What a clever thing - a true virtual cartridge.
One of the many genius parts of the PICO-8 is that the "Cartridges" are actually PNG pictures of cartridges. Drink that in for a second. They save a screenshot of the game while the cart is running, then they hide the actual code in a steganographic process - they are hiding the code in two of the bits of the color channels! Since the cart pics are 160*205 there's enough room for 32k.
A p8 file is source code and a p8.png is the compiled cart!
How to make PICO-8 games
The PICO-8 software includes everything you need - consciously constrained - to make AND play games. You hit ESC to move between the game and the game designer. It includes a sprite and music editor as well.
From their site, the specifications are TIGHT on purpose because constraints are fun. When I write for the PalmPilot back in the 90s I had just 4k of heap and it was the most fun I've had in years.
Display - 128x128 16 colours
Cartridge Size - 32k
Sound - 4 channel chip blerps
Code - Lua
Sprites - 256 8x8 sprites
Map - 128x32 cels
"The harsh limitations of PICO-8 are carefully chosen to be fun to work with, to encourage small but expressive designs, and to give cartridges made with PICO-8 their own particular look and feel."
The code you will use is LUA. Here's some demo code of a Hello World that animates 11 sprites and includes two lines of text
t = 0 music(0) -- play music from pattern 0 function _draw() cls() for i=1,11 do -- for each letter for j=0,7 do -- for each rainbow trail part t1 = t + i*4 - j*2 -- adjusted time y = 45-j + cos(t1/50)*5 -- vertical position pal(7, 14-j) -- remap colour from white spr(16+i, 8+i*8, y) -- draw letter sprite end end print("this is pico-8", 37, 70, 14) print("nice to meet you", 34, 80, 12) spr(1, 64-4, 90) -- draw heart sprite t += 1 end
That's just a simple example, there's a huge forum with thousands of games and lots of folks happy to help you in this new world of game creation with the PICO-8. Here's a wonderful PICO-8 Cheat Sheet to print out with a list of functions and concepts. Maybe set it as your wallpaper while developing? There's a detailed User Manual and a 72 page PICO-8 Zine PDF which is really impressive!
And finally, be sure to bookmark this GitHub hosted amazing curated list of PICO-8 resources! https://github.com/pico-8/awesome-PICO-8
  Writing PICO-8 Code in another Editor
There is a 3 year old PICO-8 extension for Visual Studio Code that is a decent start, although it's created assuming a Mac, so if you are a Windows user, you will need to change the Keyboard Shortcuts to something like "Ctrl-Shift-Alt-R" to run cartridges. There's no debugger that I'm seeing. In an ideal world we'd use launch.json and have a registered PICO-8 type and that would make launching after changing code a lot clearer.
There is a more recent "pico8vscodeditor" extension by Steve Robbins that includes snippets for loops and some snippets for the Pico-8 API. I recommend this newer fleshed out extension - kudos Steve! Be sure to include the full path to your PICO-8 executable, and note that the hotkey to run is a chord, starting with "Ctrl-8" then "R."
Editing code directly in the PICO-8 application is totally possible and you can truly develop an entire cart in there, but if you do, you're a better person than I. Here's a directory listing in VSCode on the left and PICO-8 on the right.
And some code.
You can expert to HTML5 as well as binaries for Windows, Mac, and Linux. It's a full game maker! There are also other game systems out there like PicoLove that take PICO-8 in different directions and those are worth knowing about as well.
What about a physical PICO-8 Console
A number of folks have talked about the ultimate portable handheld PICO-8 device. I have done a lot of spelunking and as of this writing it doesn't exist.
You could get a Raspberry Pi Zero and put this Waveshare LCD hat on top. The screen is perfect. But the joystick and buttons...just aren't. There's also no sound by default. But $14 is a good start.
The Tiny GamePi15, also from Waveshare could be good with decent buttons but it has a 240x240 screen.
The full sized Game Hat looks promising and has a large 480x320 screen so you could play PICO-8 at a scaled 256x256.
The RetroStone is also close but you're truly on your own, compiling drivers yourself (twitter thread) from what I can gather
The ClockworkPI GameShell is SOOOO close but the screen is 320x240 which makes 128x128 an awkward scaled mess with aliasing, and the screen the Clockwork folks chose doesn't have a true grid if pixels. Their pixels are staggered. Hopefully they'll offer an alternative module one day, then this would truly be the perfect device. There are clear instructions on how to get going.
The PocketCHIP has a great screen but a nightmare input keyboard.
For now, any PC, Laptop, or Rasberry Pi with a proper setup will do just fine for you to explore the PICO-8 and the world of fantasy consoles!
Sponsor: OzCode is a magical debugging extension for C#/.NET devs working in Visual Studio. Get to the root cause of your bugs faster with heads-up display, advanced search inside objects, LINQ query debugging, side-by-side object comparisons & more. Try for free!
© 2019 Scott Hanselman. All rights reserved.
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
      The PICO-8 Virtual Fantasy Console is an idealized constrained modern day game maker published first on https://deskbysnafu.tumblr.com/
0 notes