The code samples are mostly self-explanatory in the names and the wiring is mostly standard connecting the negative pin to ground and positive to the pin noted in the code with the exception of the potentiometer which requires the leftmost pin, when the nob is facing you, to be connected to 3.3v or Vin, the middle pin to a GPIO and the far left pin to be connected to ground as in image.
Note that analog functions may not always function when using WiFi functionality.