with gpio reading
update for gpio reading