This Library contains the full Jewelbots firmware and enables the user to add custom reactions to your friends and their color groups. Because of conflicts with existing Jewelbots functionality not everything that is available in Solo Coding mode is available in this Library.
Inside the Jewelbots Friendship Library, there are 4 functions that can be used to create custom reactions to friends. These 4 functions each return a boolean (true / false value) that tells the user if there are any friends of the selected color group present nearby.
The four functions are:
Once the Jewelbots Friendship board is selected in the Arduino IDE, there are examples available in the File menu. The example called "Friend_colorgroup_usage" provides an example of checking if any friends in the green color group are present and causes the Jewelbot to buzz and show an animation when a green friend is seen for the first time.
If you can't find the Friendship Coding board, see how to add the board here.
The four functions show changes on the same time period as the lights showing friend group colors. Something to keep in mind, although the Jewelbot checks for other Jewelbots wirelessly multiple times a second, the lights and the see friends functions are only updated every few seconds. Similarly, it is important to note that the functions will return true continually when a friend is nearby, which is why the example shows one simple way to make the reaction happen only once when the color group is first encountered.
The different functions are called the "API", because they are the way you interact with the device. APIs are ways you can work with different interfaces, sometimes in a computer and sometimes online.
This function returns true if any friends in the red color group are nearby. It returns false if none are nearby.
This function returns true if any friends in the green color group are nearby. It returns false if none are nearby.
This function returns true if any friends in the cyan color group are nearby. It returns false if none are nearby.
This function returns true if any friends in the blue color group are nearby. It returns false if none are nearby.