write and read digital pins