In this lesson, we will simply read the value of Joystick.
After creating a new project, click on the Simulation icon on the left side of the page to enter the Simulation page.
Connect the Y of Joystick to A1, X to A0 and Btn to D0. Then connect the VCC and GND to 3.3V and GND respectively.
Drag a print block from the Basic category to Forever block.
Click on the Lists category and drag a create list with block to behind the print block to create the list.
Click the Settings button in the top left corner and add other 3 item blocks to the list.
Click on Text category to drag 3 Text blocks to the first position of create list with block.
Change 3 Text blocks to X, Y and Btn.
Drag 3 Joystick blocks in the Sensor Kit category to the create list with block, and change the following values to X, Y and Btn. Finally place a delay block below the print block.
Now save your project, connect the Bluetooth and click Flash to compile and download the code. After that, when you slide the joystick, the values of X,Y and Btn will be printed on the Debug Monitor.