Using Viscode Creating simple Java program ( My robotic files import the libraries WPILIB for the my robotic codes , however, when i construct a simple tutorial file I run into that error on the first line " public Main must be Identified ..."
How do i create the ( Main ) file and where does it get places so that the program below can execute.
and if I'm correct
it appears that swerveDrive must somehow be resolved to the variables and it not being declared or recognized
I hope you understand the issue inspite on my poorly word issue
Program below
public class Main { public static void main ( String ... args) { Robot swerveDrive = new Robot(); // create object instance of class swerveDrive.wheeldia = 3.0; // inches swerveDrive.piniongearteeth = 12.00; swerveDrive.spurgearteeth = 14.00; swerveDrive.bevelgearteeth = 12.00; swerveDrive.wheelgearteeth = 44.00; swerveDrive.chassisspeedforward = 1.00; // meter per sec swerveDrive.Neomotorkv = 473.00; // see Neo bushless motor spec sheet swerveDrive.Neomotorfreerpm = 5676.00; // rpm see spec sheet swerveDrive.Neomotornomvoltage = 12.00; // volts see spec sheet System.out.println(" RobotSwerevDriveMotorVoltage is: " + swerveDrive.calculateVoltage()); } static class Robot{ double wheeldia; // Define variable as integer or numericalwithdecimal double piniongearteeth; double spurgearteeth; double bevelgearteeth; double wheelgearteeth; double chassisspeedforward; double Neomotorkv; double Neomotorfreerpm; double Neomotornomvoltage; // create a method to calculate motor voltage and return value to main class double calculateVoltage(){ double Voltage; Voltage = ((( chassisspeedforward * 39.37)/(wheeldia * 3.1416 )) * 60.0*((spurgearteeth/piniongearteeth)*(wheelgearteeth/bevelgearteeth))/(Neomotorkv)); return Voltage ; } } }