The pypilot hat sketch is located in pypilot/arduino/hat of the pypilot git repository.
This sketch receives 433mhz RF signals, and IR remote control signals as well as providing additional gpio pins for wired buttons that can be programmed from the pypilot web interface (on web server on port 33333)
This sketch runs on the onboard atmega328 on the pypilot hat, or tinypilot hat. It is typically already programmed, but if you have built your own setup or wish to reprogram it the steps are detailed below.
Typically this acts as an arduino connected to the raspberry pi via SPI pins, and can be automatically programmed from the raspberry pi. It is not typical to program under tinypilot as the development environment is not in place, so recommend using openplotter or any other linux distribution on pi4 (or earlier as well)
To install the software needed to compile and load the sketch:
$ sudo apt install arduino $ git clone --depth=1 https://github.com/pypilot/pypilot $ cd pypilot/arduino/hat $ make upload
If there is a failure, repeat the “make upload” command several times. It may be needed to use “sudo command” if there are permissions errors
There is also an onboard eeprom which contains a small data file indicating which exact hardware the hat has and is supported. It should not normally need to be reprogrammed, but for completeness the procedure is as follows:
$ cd $ cd pypilot/hat/eeprom
Follow instructions in README edit eeprom_settings.txt if as needed