Joystick

The joystick is essentially two potentiometers at 90 degrees from each other, so the MicroBit reads them as two analog inputs. As the two pins on the grove connectors can't both do analog input, you must use alligator clips to pins on the side. The grove connector with the wires can be used, but make sure that the metal parts of the alligator clips don't touch each other, otherwise you will short the sensor. The red connector goes to 3V3, the black connector goes to GND, and the white and yellow go to P1 and P2.

This sample code will allow you to plot the LED on the MicroBit based on the position of the joystick. The analog input goes from roughly 250 - 750 (instead of 0-1023), so I map 300 - 700 to 0 - 4 to make sure I get the full range of the sensor.