/* Hello Forum. My challenge is “How to program ATmega328P Microcontroller for 2 Axis Control. Kudos to John Wassar, and others, for sending me here. You can tell by the thread “Then // How do you declare “Then” in this scope?” why He wanted me to do my home work and, come back. He took my garbage and made it compile. I want to transform an Electro-mechanical control into a full blown solid state electronic Plug and Play unit to take to market. This includes a water proof Sensor Unit(s). See below for starters. */
boolean switchPin2, switchPin3, switchPin4, switchPin5, switchPin6, switchPin7;
void setup() {
unsigned long previousTime = 1520;
int switchState = 1520;
int prevSwitchState = 1520;
int Time = 2;
long interval = 1;
for (int x = 2; x < 8; x++) {
pinMode(x, OUTPUT);
}
// int switchPin = pinMode;
// int then();
// then == switchPin;
if (digitalRead(A0) == HIGH)
switchPin7 = HIGH;
if (digitalRead(A1) == HIGH)
switchPin6 = HIGH;
if (digitalRead(A2) == HIGH)
switchPin2 = HIGH;
if (digitalRead(A3) == HIGH)
switchPin3 = HIGH;
if (digitalRead(A4) == HIGH)
switchPin4 = HIGH;
if (digitalRead(A5) == HIGH)
switchPin5 = HIGH;
pinMode(13, OUTPUT);
}
void loop() {
unsigned long currentTime = millis();
int Time = 2;
long interval = 1;
digitalWrite(15, HIGH);
delayMicroseconds(150); // Approximately 15% duty cycle @ 1KHz
digitalWrite(15, LOW);
delayMicroseconds(1000 - 150);
}
// void setup() // Will this be necessary if the above works OK? Or, will it cause problems if above=Nada
// {
// pinMode(13, OUTPUT);
// }
// void loop()
// {
// digitalWrite(15, HIGH);
// delayMicroseconds(150); // Approximately 15% duty cycle @ 1KHz
// digitalWrite(15, LOW);
// delayMicroseconds(1000 - 150);
// }
/* Please check if the duplicate timing is conflicting, or complimenting, or both necessary, and of course if it will work. I want timing on each output for a small amount of a second, every second and, to include the sensor inputs, with a repeating sampling of the sensors. Using the internal timers would be ideal, and I want to include a GPS chip. */