ed::Room declarations that
tell Escape Director what each prop reports and what a Game Master can do.
Start from a copy of your working sketch, and test on a spare board with prop
loads disconnected.
How a connected sketch looks
Convert your sketch
- Add
#include <EscapeDirectorRoom.h>and oneed::Roomwith your sketch’s name and version. - Add one
room.prop()for each puzzle or mechanism. A Room takes up to 8 props. - Make each button and switch an
ed::Input. Usepressed()for presses andactive()for a switch’s level. - Replace
delay()(see Replace delay()). - Remove any
Serial.begin()at a speed other than 115200. USB serial is the SDK’s setup channel. Printing is fine, but never print a line that starts with{. - Declare each prop’s signals, commands and state in
setup(), then callroom.begin(). - Call
room.loop()at the top ofloop(). - Report the signal where your code already detects a solve (see Report a solve).
- Compile for your exact board, then pair and test it as in Connect your first Arduino prop.
Replace delay()
The SDK sometimes pausesloop() to keep the board connected. Blocking code
makes that worse, and a delay() holds up the whole prop. Use these instead:
Report a solve
Pick the call that matches how your code knows the puzzle is solved:
Report a signal once, at the moment it happens. Never report it again on each
pass of
loop() while the state stays the same.
Make commands run your own code
A command should call the same function your local input calls, such asopenDoor(). If a command only writes a pin, the next pass of loop() may
write it back from your puzzle state.
Add a Test behavior only for effects that are safe to try with staff in the
Room, and keep it short. See Test mode.
Keep IDs when you change the sketch
A prop’s ID comes from its slug, such as"exit-door". Signal, command and
state IDs are the strings you declare. The Room’s Puzzle links and Automations
point to these IDs.
- To rename something, change its name, not its ID.
- Never reuse an old ID for something new.
- If you remove a signal or command, check the Room’s Automations afterward.
ed::Room, upload, and update the
connection as in
Update your firmware.
Move a Device that is already paired
If the Device was paired with SDK code that didn’t useed::Room, keep its prop IDs by passing each
prop’s existing UUID: