Swift Playground for interacting with TJBot! đ€
Interact with TJBot from your iPad in this Swift playground book! This project showcases how Swift can be used to interact with IoT devices such as TJBot. Learn how to program TJBot and make him come to life using IBM Watson services such as Speech to Text, Visual Recognition, Language Translator, and more!
The TJBot playground book communicates with your TJBot using Bluetooth Low Energy (BLE), so you can program your TJBot while sitting next to him!
This playground book requires Swift Playgrounds 2.2. Please see prior releases for a version that is compatible with earlier versions of Swift Playgrounds.
The easiest way to get this playground on your iPad is to subscribe to it within the Playgrounds app.
Alternatively, you can download the latest release to your Mac and then use AirDrop to copy the playground to your iPad. After downloading, right click the âTJBot.playgroundbookâ file, and choose âShare > AirDrop.â A list will open up which should show your iPad. Click your iPad to transfer the Playground.
Note: Make sure AirDrop on your iPad is turned on!
In addition to this playground book, you will need to install the tjbot-daemon project on your TJBot. Please refer to the installation instructions to learn how to set up your TJBot with the daemon.
đ€ No robot, no problem! You can still explore the first two chapters of this playground without a physical TJBot.
There are three chapters in the Playground.
If you are stuck on an example, we recommend referring to the hints before taking a peek at the solution guide.
If you would like to use this playground to demo TJBot's capabilities without having to write any code, please download the solutions guide and AirDrop the "TJBot (Solutions).playgroundbook" file to your iPad.
The TJBot playground communicates with the tjbot-daemon
via Bluetooth LE (BLE). Please ensure the tjbot-daemon
process is running on your TJBot to enable the playground book to connect to it.
It is possible that tjbot-daemon
has crashed. Please take a look at the logs in the Terminal to troubleshoot. If you are stuck, open an issue and we will do our best to help.
tj.see()
or tj.read()
Images have a lot of data, too much to transmit quickly over Bluetooth LE. Thus, in order for your iPad to load images from your TJBot, they both need to be on the same WiFi network.
Note: The iPad will attempt to resolve your TJBot on the local network using its MDNS address. For example, if your TJBot is named âtinkerâ, then images are loaded from the base URL âhttp://tinker.localâ. If your Wifi network (such as some Enterprise networks) drops MDNS packets, then you may not be able to load images from your TJBot. If you do not understand what MDNS is, donât worry! Most home networking gear supports it. đ
It is possible that Watson is returning an error. Check the error
property from any data returned from Watson. It is also possible that a typo in your Watson service credentials will cause Watson to not return data as expected.
Please open an issue and we will do our best to address it.
This project uses the Apache License Version 2.0 software license.