I have attached my .ino file pls read it first.
Now the question is that I want to get the value of “price” back from the if/elseif loop to void loop. and in my case I am getting it as 0. I know that it is outside the scope but I am unable to rectify it.
I have mentioned in the code where I need the value.
Answers will be appreciated.
vending_machine.ino (1.37 KB)