In the IDE there is an EXAMPLE sketch in the WiFi101 examples called SCAN NETWORKS.
That should get you going.