I have an automation:bit which works well for turning things on and off but now I want to add a simple touch control. in the past I have used a routine which averages analog reads to set an untouched threshold for a pin and then a similar process to get a touched value which is hope fully different. However as part of the averaging process I reset the pin to high after each read. In makecode I can do this by doing a digital write following the analogue read on the same pin but it looks as though this is not possible with the automation:bit as digital and analogue seem to be separated. can anyone suggest a way I can do this? ideally in makecode?
thanks in advance