What is Read-Eval-Print-Loop?
Read-Eval-Print-Loop (REPL) allows you to modify the state of a robot, or its components, in real-time, or while the code is still running. REPL works because of Firmata – the board is just reacting to the node program, so if different instructions are sent through that program, the robot will react.
Using REPL to Control an LED
In order to make the components available to REPL, I used the line this.repl.inject().
this.repl allows you to access the REPL for the program you’re working on and inject accepts an object whose components you can access
By putting this into the program, it lets me have access to the LED through terminal using commands such as:
LED Code with REPL and Schematics
Arduino MEGA board