I have made a program with the little knowlegde i have from programming in a java program and i do get alot of mistakes that i don't know how to fix. I have asked my teacher and he doesn't know enough about it for some reason (seems kinda under qualified since he should be the one to help us with this stuff). If anyone could tell me where to find the information i need or tell me what to do to fix this.
Thanks in advance
New: My teacher told me to use this (public static void main(String[] args) i don't really know what it does.
I changed the text into english so it would be easier for you to understand.
Our product is a machine that can make a protein shake for the user after his or her preferences.
I will keep changing this as i read the comments.
(some of this stuff is in danish but that shouldn't make a difference since it should only names and text)
#include <Stepper.h>
const int stepsPerRevolution = 200;
int LillePumpe = 10; // jp3 //
int StorPumpe = 9; // jp4 //
int Enable = 4; //Enable pin til stepmotoren//
Stepper myStepper(stepsPerRevolution, 1,2,5,6); //stepmotoren//
void setup() {
pinMode(Enable, OUTPUT);
pinMode(LillePumpe, OUTPUT);
pinMode(StorPumpe, OUTPUT);
Serial.begin(9600);
myStepper.setSpeed(35);
Keyboard.begin();
}
digitalWrite(Enable, HIGH);
digitalWrite(LillePumpe, LOW);
digitalWrite(StorPumpe, LOW);
void loop (){
public static void main(String[] args) {
if (Serial.available() > 0) {
char inChar = Serial.read();
Keyboard.write(inChar+1);
}
Serial.println("Type your weight in kilo grams and press return.");
int WeightInKilograms = 0;
WeightInKilograms = Keyboard.nextInt();
Serial.println("type 1 if you are training endurance training (for example running or cycling) or type 2 if you are training strength training (for example Bodybuilding, weightlifting or 100-meter-running) and press return.");
int WorkoutType = 0;
WorkoutType = Keyboard.nextInt();
Serial.println("type 1 for a mix with water or type 2 for a mix with milk and press return.");
int TypeOfMixture = 0;
TypeOfMixture = Keyboard.nextInt();
Serial.println("Type 1 for a thin max, type 2 for a medium mix or type 3 for a thick mix and press return.");
int ThicknessOfMixture = 0;
ThicknessOfMixture = Keyboard.nextInt();
if (WorkOutType = 1){
myStepper.step(WeightInKilograms * 3,333);
}
if (WorkOutType = 2){
myStepper.step(WeightInKilograms * 8,444);
}
if (WeightInKilograms >= 135){
myStepper.step(1,111);
}
if (TypeOfMixture == 1 && ThicknessOfMixture == 1){
digitalWrite(LillePumpe, HIGH);
delay(500);
digitalWrite(LillePumpe, LOW);
}
if (TypeOfMixture == 1 && ThicknessOfMixture == 2){
digitalWrite(LillePumpe, HIGH);
delay(1000);
digitalWrite(LillePumpe, LOW);
}
if (TypeOfMixture == 1 && ThicknessOfMixture == 3){
digitalWrite(LillePumpe, HIGH);
delay(2000);
digitalWrite(LillePumpe, LOW);
}
if (TypeOfMixture == 2 && ThicknessOfMixture == 1){
digitalWrite(StorPumpe, HIGH);
delay(500);
digitalWrite(StorPumpe, LOW);
}
if (TypeOfMixture == 2 && ThicknessOfMixture == 2){
digitalWrite(StorPumpe, HIGH);
delay(1000);
digitalWrite(StorPumpe, LOW);
}
if (TypeOfMixture == 2 && ThicknessOfMixture == 3){
digitalWrite(StorPumpe, HIGH);
delay(2000);
digitalWrite(StorPumpe, LOW);
}
Serial.println("Shake you're shake thoroughly for about 2 minutes.");
}
}