evive has inbuilt 5-way navigational (or Joystick), which is used to navigate in evive menu based system. The navigational key has 4 directions: left, right, up and down. This information is provided by the analog pin A11.
Getting Joystick input from Arduino IDE
The sample code is provided below:
The center switch is connected to the digital pin 19 inactive or high mode. This means that if the switch is pressed, then pin 19 is high, otherwise, the pin is LOW.
Getting Joystick Input in PictoBlox (Scratch)
You can get the state of evive Joystick using Navigation key is in () direction. This block can be found under the Robots palette in the evive extension. This block checks if the navigation key is in one of the four particular directions. The direction for which you wish to check is your choice and can be chosen from the drop down on the block.
- In this script, the sprite moves up, down, left and right according to using the navigation key.