reworked based on RaspPI GPIO