1
0
Fork 0
Commit graph

8 commits

Author SHA1 Message Date
fab5d22364 Arduino: Use readBytes for cart read
The Wire documentation only shows read() to get data from
the I²C stream.
However, Wire inherits from Stream, so it gets access to
all the same functions, like readBytes(), which can read
more than one character.

Replace the innermost loop of the cartridge load by
readBytes instead of calling read() in a loop.
2023-12-17 13:20:48 +00:00
610ccc630a Unity: Use UInt16.MaxValue rather than hardcoding 65536
Unity provides constants that reflect the maximum value of integer types,
use it for checking the checksum overflow rather than using 65536 directly.
This makes the intent more clear.
2023-12-16 14:10:28 +00:00
91dae1be7e Unity: Fix hardcoded page size in ReceiveSerialData()
Remove the hardocded '128' that checked for a full page being received
and replace it with the appropriate constant.
2023-12-16 14:10:28 +00:00
a18c37daa1 Unity: Add delay after serial connection
The Arduino will block if sent data too quickly after connection.
Add a new coroutine to force waiting for 1s+ and update the UI
accordingly.

Update some comments throughout.
2023-12-16 14:10:28 +00:00
4e11af1da0 Arduino: Use 400kHz clock for I²C
The EEPROM in the cartridges support 'Fast I²C' at 400kHz.
Testing it out, it seems to work fine despite the high pull-ups,
so update the Arduino code to enjoy the 4x speed-up !
2023-12-16 14:10:25 +00:00
20d1f86fa6 Unity: Add Arduino handling code
Add the full working Arduino code for cart loading.
Handle the UI elements, connection to the Arduino
and loading the cartridge over serial.

This code should not be shared with students as it
is the full working code for the communication.
2023-12-16 14:01:28 +00:00
dfe7b6b5d0 Arduino: Add full Arduino code
This is the full working Arduino code, for writing and loading.

This shouldn not be used by students.
2023-12-16 14:01:21 +00:00
f34d81ad87 Setup project, only UI and basic code
The project setup contains README, LICENSE, the full UI and materials.
The PICO-8 side is wired up, but all the Arduino code is absent as
I need to figure out how to carve it out for the students.
2023-11-12 20:59:38 +00:00