TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

"Real" IO: GPIO and serial support

Open gh0st42 opened this issue 7 years ago • 5 comments

It would be really great to have access to the GPIO pins of for example a raspberry pi (probably through wiringpi lib). Furthermore, exposing serial devices (/dev/ttyUSB0, /dev/ttyS0, etc) would open up endless possibilities of communication and retro fun such as BBSes and simple multiplayer.

gh0st42 avatar Mar 22 '18 17:03 gh0st42

Would be great run an arcade like game with a real coin acceptor.

camelo003 avatar Jan 15 '19 20:01 camelo003

I think that these should require a permission screen, something like "Do you want to let this cart use this serial port?" otherwise it could cause security problems.

Kozova1 avatar Aug 01 '21 12:08 Kozova1

You're right, thank you :)

nesbox avatar Aug 02 '21 07:08 nesbox

I can see 2 ways of doing it:

  • Provide a function that can request or drop permissions, something like permission(PERMISSION_NAME,true for request and false for drop)
  • Add it in the cart comments at the start (where you specify the language etc.), something like: -- perms: Serial, GPIO

I'd prefer the first one since it would enable more secure usage of permissions.

Kozova1 avatar Aug 02 '21 09:08 Kozova1

I would love to see this in TIC-80 as well. PICO-8 makes this very easy. It just exposes an 128-byte array that can be poked or peeked from inside the pico cart, and the website the game is embedded in, or the Raspberry Pi it is running on can read or write to that same array. https://pico-8.fandom.com/wiki/GPIO

arkin0x avatar Dec 18 '23 21:12 arkin0x