1
0
Clone
4
Home
mosskoi edited this page 2025-10-19 21:34:32 +01:00

What is this project?

This project helps sets up a way to use a external UV sensor on as pass it's data to mGBA to be used by Boktai: the sun is in your hands. This way real UV data can be used in the emulated game, bypassing the need to manually update the sunlight value and bringing the game one step closer to it's intended behavior.

How is this done?

Simple version: By using a UV sensor on a microcontroller and passing that data to a mGBA script that writes that read value into RAM.

More technical version: in one of two ways: If the microcontroller has WiFi capabilities you it can connect directly to the lua server, connecting via TCP and updating every half a second with a new reading, the server in turn maps the pin analog reading to in-game sun light levels and finally writes that value into memory. If the microcontroller does not have WiFi capabilities you can still run this project but will pass information via the serial, a python script is available to bridge the serial and TCP connection, when the data arrives at the server is goes through the same mapping and converting process.

What do I need to get this working?

Hardware

  • A microcontroller.
  • An UV sensor.
  • A USB cable that's able to connect your chosen microcontroller to your computer.
  • Jumper wires ( depends on UV sensor )

Software

  • Arduino IDE
  • Python3 (if on linux)
  • mGBA

Interested in mode detailed instructions to get this project working?

Here's the how-to for WiFi version and for Serial version