User Prompt for Sphero SPDK+

I have a Sphero SPDK+ which we got for Christmas to help teach my 9-year old son coding. We’re currently using the Blocks method of constructing our programs and we’re having good fun with it so far.

I’ve searched around and cannot see how you can use the controlling iPad’s keyboard input in order to interact with a user.

Essentially, I want to write a program where the Sphero will ask a series of mathematical questions e.g. some times tables. I’ll use the random number generator to generate the possible questions. I want to use some random functionality to generate different answers. and speak the questions. I can do all of this. However, what I need to be able to do is for the program to prompt the user to enter values a, b or c. and for the user to give their answer. I was then going to get the Sphero to move, play a sound, change colour depending on whether the answer was correct or not. The thing that I’m stuck with is the prompting for the answer. How can I do this?

Any help would be greatly appreciated.

1 Like

Hello @ArtieFufkin,

Thank you for your question, and welcome to the forum!
There is currently no way to use the keyboard as an input while the program is running.

I really like your example though and how you could teach math through Sphero, and I have a few suggestions for you.

First, you could use the orientation of the robot as an input. You could have the robot speak 4 possible answers with only one of them being correct, and have them associated with a direction. The robot will have to then disable its stabilization.
In order to solve the problem you have to place the robot in the correct orientation for 5 seconds.

Another option would be to use the on collision block, and shake the robot as many times as the answer is.

I hope this helps!

Quentin

That’s seems like a decent workaround.

How do I make it so the user can then drive the Sphero whilst the program runs? I don’t want the robot to move by itself, I want the user to move the robot and then the program can detect which direction it moved.

Any help would be useful.

1 Like

Hello @ArtieFufkin,

There is currently no way to use the joystick while the program is running.
But, you could have some programmed instructions that the robot executes when the answer is correct!

I attached a example that you can recreate and modify. It’s a bit complex, but should do the job.

I hope this helps!

Quentin

1 Like

Thanks ever so much Quentin for the detailed response and for taking the time to look into this! I can see what this is doing. We will give this a go!

Superb!