Updated for ScratchGPIO3
ScratchGPIO3 compatible version