how can I create a ButtonBar for following specific actions

I have two sets of parameters p1[i] and p2[i], (i=ag, cs, wh) for which I want to create two separate button bars. I have the following conditions:

Given two equations:

 Manipulate[
...
gr[i]=xx*p1[i];
mu[i]=yy*p2[i];
p1[i]={0,1};
p2[i]={0,1};
...
]


Define a scenario such as: {p1[ag]=1, p1[cs]=1, p1[wh]=0} and {p2[ag]=1, p2[cs]=0, p2[wh]=0}. Underneath each buton I like to see the choice: 0 or 1. If it starts with 0, then clicking on the button should turn it to 1 and vice versa.

With this button format, I want to follow the parameter choices made (i.e., the type of scenario) and obtain the associated values of the two equations, gr[i], mu[i]. I want to do this using Manipulate.

For me, it is important to see the choices {0,1} made underneath each button as it will help me see the parameter choices.

I hope my explanation is clear enough.

UPDATE

For better visualizing the design of ButtonBar I wanted, I like to give the picture of the design:

For parameter set p1[i] I have three choices and the same for p2[i]. I should be clicking on the values {0,1} and the clicked ones should turn to "Green". Note that ag, cs, wh remain unchanged for both parameters.

This shows how to lay out a table of buttons that show their values and which of the values is currently set. It also shows a second table which displays the results of changing parameter values with the buttons. I use TableForm to do the layout because it's easy to use and adequate for purposes of answering this question. You can get a fancier and better looking layout if you are willing mess around with Grid.

btnLbl = SetterBar[#, {0, 1}] &;

With[{xx = π, yy = E},
DynamicModule[{tags, gr, mu, p1, p2},
gr[i_] := xx p1[i];
mu[i_] := yy p2[i];
tags = {ag, cs, wh};
Set[p1[#], 0] & /@ tags;
Set[p2[#], 0] & /@ tags;
Column[
{Dynamic[
TableForm[
{Button[btnLbl[p1[#]], p1[#] = Mod[p1[#] + 1, 2],
Appearance -> None] & /@ tags,
Button[btnLbl[p2[#]], p2[#] = Mod[p2[#] + 1, 2],
Appearance -> None] & /@ tags},

• In my version of Mathematica 11, I cannot see the blue colored buttons. Is there a way to set Green color manually? – Tugrul Temel Nov 20 '19 at 20:21
• Your above answer solved the question. Since my problem was much wider than what my question implies, I tried to solve the rest of my problem by myself by playing around your Code. However, I failed to solve my problem. The rest of my problem is not worth to ask a new question because it is just one step away from the answer. Would it be appropriate for me to update my question again for an extension to your Code? I would appreciate if you guide me. thanks. – Tugrul Temel Nov 21 '19 at 22:17