Hello, I am trying to get this termal printer to print info based on whether the if statement condition is valid or not. So in this code if each if statement is valid i want it to print both the magnesium and zinc stuff from each if statement but its only printing one. I think it is because they are both being called at the exact same time but im not sure. Can someone please help..
Lol i know this sounds confusing but to be plain and simple i just want it to print both texts shown in the code below one after the other (assuming both if statements are activated).
if (buttonPushCounter1 == 22 or buttonPushCounter == 22){ //dispense pills after last question of survey is answered
if (question3Yes == 1){
if (Stepper1 == 0){
delay(300);
myStepper1.step(stepsPerRevolution/8);
Stepper1 = 1;
Thermal.println("You Lack Magnesium In your Diet.");
Thermal.write(10); //Sends the LF to the printer, advances the paper
Thermal.write(10);
Thermal.print("Magnesium is important for many processes in the body including regulating muscle and nerve function, blood sugar levels, blood pressure making protien, bone and dna. ");
Thermal.write(10);
Thermal.write(10);
Thermal.print("Food Sources With Magnesium Include:");
Thermal.write(10);
Thermal.print("-Whole Grains");
Thermal.write(10);
Thermal.print("-Green Leafy Vegetables");
Thermal.write(10);
Thermal.print("-Nuts");
Thermal.write(10);
Thermal.write(10);
Thermal.write(10);
Thermal.write(10);
do { } while (1>0);
}
delay(300);
if (Stepper4 == 0){
delay(300);
myStepper4.step(stepsPerRevolution/8);
Thermal.write(10); //Sends the LF to the printer, advances the paper
Thermal.write(10);
Thermal.print("Zinc is a mineral that helps keep our immune system healthy, protein synthesis, normal cell replacment & wound healing.");
Thermal.write(10);
Thermal.write(10);
Thermal.print("Food Sources With Zinc Include:");
Thermal.write(10);
Thermal.print("-Red Meat");
Thermal.write(10);
Thermal.print("-Poultry");
Thermal.write(10);
Thermal.print("-Beans");
Thermal.write(10);
Thermal.print("-Shellfish");
Thermal.write(10);
Thermal.print("-Dairy");
Thermal.write(10);
Thermal.print("-Salmon");
Thermal.write(10);
Thermal.write(10);
Thermal.write(10);
Thermal.write(10);
do { } while (1>0);}
Stepper4 = 1; //store value telling us that stepper has been rotated once
Thermal.println("You lack zinc in your diet.");
}
question3Yes = 0;