jcrona / mcugotchi

A Tamagotchi P1 emulator for microcontrollers
GNU General Public License v2.0
104 stars 5 forks source link

Raspberry Pi Pico / RP2040 Support #1

Open spmfox opened 3 years ago

spmfox commented 3 years ago

Hello, first I'd like to say this is awesome - thank you for the work. I've been playing around with TamaTool and it works perfectly.

I was curious how hard it would be to get this to run on a Raspberry Pi Pico? Or if its even possible. By combining a Pico with a screen (https://shop.pimoroni.com/products/pico-display-pack) you could get something close to the original form factor with some buttons on the screen. You could even use the screen LED to mirror the attention light, etc.

Just curious your general opinion on this, to fully understand this is over my head. Thank you.

jcrona commented 3 years ago

TamaLIB would run fine on a Raspberry Pi Pico, so what you suggest would definitely work. If you start from a sample code that already handles the screen and buttons, having a working Tamagotchi would just be a matter of wiring things properly from a software perspective. Then add a battery and you will get a fully working portable P1 !

However, I would not add support for the Raspberry Pi Pico in MCUGotchi, but would rather start a new TamaLIB's HAL implementation from scratch. It would be faster and easier.

NoNamedCat commented 3 years ago

jcrona could you explain (in the readme or somewhere else) how to implement a HAL for tamalib for other architectures? I want to design a PCB for this projet. I work designing pcb for the IOT sector and i will be glad to make that using an esp8266 or esp32 (powerfull but yet small devices).

jcrona commented 3 years ago

It is already more or less explained in TamaLIB's README.md file, and more details can be found in hal.h. Basically, you need to connect the SDK of your architecture to TamaLIB by implementing the expected behaviour of the HAL functions using the API provided by your SDK. MCUGotchi provides you with a nice example to replicate.

Side note, I'm currently developing a PCB as well, around an STM32L0 MCU, but I look forward to seeing an ESP32 implementation !

jcrona commented 2 years ago

@NoNamedCat, fell free to checkout the OpenTama board that has been designed specifically for MCUGotchi !