Two different functions in 1 program?

So my friends and i meet every now and then with our 3pis and have a challenge set for what the robots should do. This time we have to do an oval and figure 8. I would like to make the program so that i can press a button like “A” and have it do an oval and then also press a button like “B” and have it do a figure 8 instead of having to export 2 different programs for the different criteria.
Thanks!

Hello.

Yes, you could write a single program that uses multiple buttons to activate different behaviors on the 3pi. You can learn more about this by looking at the example code in the “Orangutan PushButton Interface Functions” section of the Pololu AVR C/C++ Library User’s Guide, which can be found under the Resources tab of the 3pi’s product page.

- Amanda