EZB Connections icon EZB Connections Add and manage up to 255 EZ-B I/O controller connections in ARC, select COM/IP ports or device addresses to connect or remove devices. Try it →
South Africa
Asked

Micro:Bit Buttons Driving Tic Tac Toe

I’ve got a BBC micro:bit connected to ARC over USB using the BBC micro:bit skill (flashed the firmware from the skill and can see Button A/B and accelerometer values updating). I’m trying to use the micro:bit as a simple handheld controller for the Tic Tac Toe skill: tilt left/right/up/down to move a cursor across a 3x3 index in my script, press A to place an O, and press B to reset the game.

What works: the micro:bit inputs are solid in ARC (I can watch the values change), and if I click the Tic Tac Toe UI with the mouse the game plays fine. What I can’t figure out is how to programmatically place an O in a specific cell from a script. I assumed ControlCommand would do it, but the Cheat Sheet in Tic Tac Toe doesn’t show command names on my end. I tried guesses like:

// ARC JavaScript skill
ControlCommand("Tic Tac Toe", "Reset Game");
ControlCommand("Tic Tac Toe", "PlaceAt", 1, 2); // row, col?

Neither produces any response (no error, just nothing happens). I also tried renaming the Tic Tac Toe control to a simpler title and confirmed I can ControlCommand other skills from the same script, so it seems specific to Tic Tac Toe. Bonus goal: I’d like to mirror win/draw on the micro:bit’s 5x5 LEDs, but I don’t see any variables exposed by the Tic Tac Toe skill indicating current state or winner.

What are the correct ControlCommand names (and parameters) for the Tic Tac Toe skill to reset the game and place an O in a specific cell, and are there any variables/events exposed for win/lose/draw that I can read to drive the micro:bit LED matrix?



Related Hardware (view all EZB hardware)
Connect BBC Micro:bit to Synthiam ARC via USB. Access GPIO, LEDs, buttons; upload Arduino firmware for I2C, SPI and analog sensors.
USB
Servos Varies
Camera
Audio
UART
I2C
ADC 3
Digital 16

Related Robot Skills (view all robot skills)
Tic Tac Toe by Synthiam
Play Tic Tac Toe with your ARC robot: configurable turn, win and draw scripts, cheat commands and optional speech-recognition control.
Run scripts automatically when specified ARC variables change; define variable-to-script pairs, monitor status, and trigger actions.

ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

Yes - Tic Tac Toe in ARC is one of those skills where the command names are not obvious from the UI, and if the Cheat Sheet isn't showing them, the most reliable place to verify is the skill's configuration menu and script examples.

What to try first

Open the Tic Tac Toe skill’s kebab menu in the top-right of the skill window and look for any of these:

  • Script examples
  • Commands
  • Cheat Sheet
  • Documentation / help

That skill does expose control commands for scripting, but the exact command names may not be shown unless you view them from the skill itself.


Most likely command pattern

For ARC skills like this, the command is usually sent with:

ControlCommand("Tic Tac Toe", "CommandName", parameter1, parameter2);

For a game board skill, the common pattern is often not row/column by numeric coordinates, but rather a board index or cell number.

So instead of:

ControlCommand("Tic Tac Toe", "PlaceAt", 1, 2);

it may be something like:

ControlCommand("Tic Tac Toe", "Place", 4);

or:

ControlCommand("Tic Tac Toe", "Move", 4);

But I don’t want to guess wrong here because each skill defines its own command names.


How to find the exact commands

Here’s the best way to discover them inside ARC:

  1. Open the Tic Tac Toe skill
  2. Click the three-line menu in the top-right of the skill
  3. Look for:
    • Cheat Sheet
    • Script Help
    • Commands
  4. If available, open the script editor and type:
ControlCommand("Tic Tac Toe", "");

Then use ARC’s command helper / autocomplete if it appears.

If ARC still doesn’t show anything, the skill may not have publicly documented commands on the main surface, and you may need to use the skill’s variable outputs or a different control approach.


About variables / winner state

If the skill doesn’t expose variables, then the usual workaround in ARC is to create your own state layer:

  • Maintain your own currentCell
  • Track your own board array in script
  • Send the move into Tic Tac Toe through ControlCommand()
  • Mirror the outcome to the micro:bit LEDs from your script logic

That’s often the cleanest approach when a skill doesn’t publish enough state variables.


Suggested ARC approach for micro:bit control

Since your micro:bit inputs are already readable in ARC, I’d recommend:

  • Use a script or On Variable Changed skill
  • Track:
    • tilt direction
    • Button A = place O
    • Button B = reset
  • Update a selectedCell
  • Drive the Tic Tac Toe skill with the exact command once identified
  • Mirror the current cell and game state to the micro:bit LEDs

The On Variable Changed skill is a good fit here: https://synthiam.com/Support/Skills/Scripting/On-Variable-Changed?id=19359


For the LED matrix goal

If you want to reflect win/draw/lose on the micro:bit display, you can absolutely do that from script once you know the game state. If Tic Tac Toe doesn’t expose a winner variable, then the best workaround is:

  • keep the game logic in your script
  • detect win/draw yourself
  • then call micro:bit display commands accordingly

What I need from you

To give you the exact ControlCommand() names, can you share:

  1. A screenshot of the Tic Tac Toe skill’s kebab menu
  2. Whether you see any command list in its configuration window
  3. The exact name of the control as shown in ARC

If you want, I can also help you build the micro:bit-to-Tic-Tac-Toe JavaScript script once we know the command name for placing a move.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.