Playdate Oneil Camera

It looks so amazing!

Here are some purple PCBs from the Playdate archive. I'm pretty sure Playdate wouldn't have happened without OSHPark. :smiley:

13 Likes

Ok so here's an exclusive look at the almost finished case :wink:

I started it in FreeCAD but I grew tired (polite understatement) of its quirks so I rebuilt the whole project from scratch on Onshape and carried on from there. Best decision I ever made too late.

It prints in 4 parts without support, assembles without tools using press fit and snap locks. This test print took about 4 hours on a Prusa MK3s with PETG. The design in 4 parts leverages the textured bed sheet for a nice surface finish on all back and front facing surfaces.

The case is 1.5 Playdate tall - with the extra height at the bottom when held normally - and there's a chin kind of thing that makes the front face flush with the console. This serves several purposes but combined with the added thickness, makes it quite comfortable to hold (even for just playing!).

The chin part hides the USB cable and you can take the PD out and snap it on the other side of the case for some 1-bit selfie action without disconnecting the cable in the process. The camera bump is 0.5 Playdate tall like the front chin, and is not full width so it keeps the PD's power button accessible in this configuration too.

The PD is locked with magnets in both modes (but obviously better secured in regular mode).

The case holds a giant 5000mAh battery that charges the PD in addition to powering the camera hardware. I don't know how long it's going to run, but long. There's a power switch at the top of the case and a charging port at the bottom.

Right now it's possible to easily swap out the sensor board without opening the case so I can test different lens mounts (swapping the entire board). I don't know if that's useful beyond prototyping and I might change it in the final design.

There's one last cool little feature I'm not mentioning here, I'll save it for the next update :wink:

I'm quite happy with this last test and I'd say I'm ~90% done with the design by now. I have some small adjustments to make here and there but this is very close to the end goal.

I'll show off the inside in a later post; it might not look like much but it's the most complex 3d thing I've ever designed and it was a lot of fun-pain. I hope you like it!

Now the big question is, what color should I print the final make? :wink:

13 Likes

That's amazing!

I kind of think a black print works well: automatically matches (part of) the Playdate, as well as the lens.

Purple would be cool too though! Or anything but a slightly-wrong yellow.

1 Like

Agreed! I think I'll simply go with jet black instead of this glittery "galaxy black".

2 Likes

By the way, as I discovered making this "photo roll" project (free to adapt), scaling dithered images to 1/3 does a pretty decent job of preserving a wide variety of dithered tones. Works great for ordered dithers especially, but more random scatterings don't come out half bad either.

(And I like your dawn-of-cinema cranked video idea!)

1 Like

Mark 3 is now fully designed, assembled and operational yay :slight_smile:

pd cam selfie mode small

So I got back to the software side, added mirror mode for more comfortable selfies:

Next will be the finishing touches: a start screen, a camera roll. And I think there's a nasty memory leak somewhere because the PD always ends up crashing if left streaming from the camera for a couple of minutes straignt. Problem is, it's very hard to debug. Maybe I'll just put a timeout on the viewfinder and call it fixed.

I'll make a little video to demo the whole thing end to end in the coming days. And then I'll document the build process, tidy up the code, and put everything on github. I might try another revision of the case/hardware before I do as I'd like to make it a bit more generic (right now it's designed to fit exactly the battery pack and power circuit I used).

Oh and here's the one more thing I teased in the previous post: the reason why the PCB is purple (and oversized) is because we can see it through holes in the case that act as pockets to store the console and protect its screen during transport :slight_smile:

pd cam cover mode small

Cheers!

10 Likes

This is excellent. Forget the camera, it looks fun just to change the configurations around like a transformer!

3 Likes

Here's a little video I made :slight_smile:

3 Likes

I actually did find and test your viewer earlier and this is how I knew the images didn't scale too well with error diffusion based dithering :

playdate-20230610-223548

However I returned to it tonight and I've found a simple fix :slight_smile:
Applying a small blur before scaling down makes a huge difference !

img:blurredImage(1, 1, gfx.image.kDitherTypeScreen, true)

playdate-20230610-223633

I'll be factoring your code inside of the camera app next ! I guess instead of saving the pictures only as gif for easy export, I'll need to save 2 copies, one gif for export and one pdi that I can read back to render this viewer. No biggie.

4 Likes

Very nice! Turning the dither to an ordered one like that does the trick.

Using your code as a starting point, I've updated my menu class to support images, looks rather decent to me :slight_smile:

pd cam roll

I wrote some logic to store sort of a rolling buffer of last X thumbnails in memory rather than reading the filesystem all the time. I have lots to learn on PD memory management and cost of reading/writing files :slight_smile:

5 Likes

Slick!

I use a rolling buffer of sorts for zooming in Outside Parties. Why throw out data that might be seen again soon? It helped a lot.

(Outside Parties is a really cool concept with SCP Foundation vibes, the devlog is super interesting, and I'm looking forward to playing it!)

2 Likes

Thanks! Just looked up SCP—kind of cool!

Indeed, be careful it's a rabbit hole.

In other news I've updated the SDK to 2.0 and my clunky VS Code setup fell apart so instead of coding fun things I'll get back to trying to get a lua+C project to build on Windows+VS Code again. The official doc is lacunar.

1 Like

I'm really loving the Mark 3 design! The option of using it as a case to protect the screen, the wire being tucked away during use, selfie mode: it all seems really well-considered! I'm really looking forward to seeing all the documentation on Github: I have way too many side projects already, but I'd love to make and use this!

2 Likes

Howdy,

I've had some trouble with my Teensy, and had to replace it. I'm also waiting on new power circuitry to test parts that would be easier to find than what I'm currently using.

On the softwre side I spent quite some time polishing the app, making it more robust at detecting and connecting to the hardware, and integrating the camera roll feature to browse and delete pictures on device.

2023-06-21_23-52-03 2023-06-21_23-52-19

Next step is :crank: to record animated gifs :sparkles: !

So far I have crank-to-burst-shoot so it saves fames as fast as possible. From there I'd like to process the images into a gif on device, and clean up the individual files.

I've found this little library that looks quite straightforward and am now trying to port it to pd. So far all it does is crash the pd with error e0. Anyone here willing to help me out with this ? (all good now :slight_smile:)

PS: here's what it could look like (youtube on my laptop screen, processed these frames with an external tool)
animated gif test

4 Likes

Video next?! Is there anything you can't do?! :grin:

1 Like

All right, so the code works in the Simulator( on Windows). Takes .5 second to process 50 pdi files into one animated gif. This is another YT video I filmed with the camera.

2023-06-23_15-06-03-bw

I don't yet have it running on the real device unfortunately: it currently crashes before processing anything with ReadFile failed (995) (any clue what the code means?). And then once this is hopefully sorted out, I'll probably also need to rewrite the code to make it non blocking (eg process one frame, return to lua, update, repeat).

PS: since we create the gif manually here, we can use an arbitrary color palette... maybe that could be a fun little option :slight_smile:

2023-06-23_15-06-03-py

3 Likes