I have put the code up in the article: Penta SATA HAT enhanced display (oled, I/O, temp) and operation (button, fan)