Arduino pin management in Javascript