then //How do you declare “then” in this scope?

larryd:
I smell a troll.

+1

In this Thread the OP said " I spent my adult life in Silicon Valley;" and it is very difficult to imagine how anyone with a professional knowledge of computing (no matter how long ago) could ask questions like in this Thread.

Of course he might have been selling doughnuts to the geeks.

...R

Robin2:
In this Thread the OP said " I spent my adult life in Silicon Valley;" and it is very difficult to imagine how anyone with a professional knowledge of computing (no matter how long ago) could ask questions like in this Thread.

Of course he might have been selling doughnuts to the geeks.

If you look at the LinkedIn link I posted you will see that he was supervising the HVAC technicians and other facilities maintenance people. May never have talked to a programmer in his 36-year career.

johnwasser:
May never have talked to a programmer in his 36-year career.

That figures. But then his reference to his time in Silicon Valley was misleading. I have no idea whether that was intentional, but it was certainly careless.

...R

// Its Hard Teaching an Old Dog New Tricks. Thanks John for checking on me. Also, thanks for all input.
// Please see attachments...the intent is to place this, as a working file, into the Microcontroller.``
void setup() {
unsigned long previousTime = 848;
int switchState = 152;
int prevSwitchState = 848; // Not sure of these 3 lines...the intent is to time the outputs a small fraction of a second.
int Time = 1;
long interval = 1;
for (int x = 1; x < 8; x++) { // Not sure of these 3 lines either...see above…please explain “x+++...MS language?
pinMode(x, OUTPUT);
}
int switchPin = pinMode;
int then();
then = switchPin;
if (digitalRead(A0) = HIGH);
{
switchPin 7 == HIGH;
}
if (digitalRead(A1) = HIGH);
{
switchPin 6 == HIGH;
}
if (digitalRead(A2) = HIGH);
{
switchPin 2 == HIGH;
}
if (digitalRead(A3) = HIGH);
{
switchPin 3 == HIGH;
}
if (digitalRead(A4) = HIGH);
{
switchPin 4 == HIGH
}
if (digitalRead(A5) = HIGH);
{
switchPin 5 == HIGH;
}
void loop() {
unsigned long currentTime = millis();
int Time = 2;
long interval = 1;
}

NotesDOC.doc (30.5 KB)

if (digitalRead(A0) = HIGH);
{
  switchPin 7 == HIGH;
}

You have the proper use of = and == reversed.

So it can't be "a working file".

Please, this has been mentioned many times now!

if (digitalRead(A0) = HIGH);
{
switchPin 7 == HIGH;
}

Should Be!

if (digitalRead(A0) == HIGH);
{
switchPin 7 = HIGH;
}

An old dog should be able to still read :wink:

Read this:

And read this:
https://www.arduino.cc/en/Reference/If

// Not sure of these 3 lines either...see above…please explain "x+++

x++ <-----<<<<< is the same as x = x +1

for (int x = 1; x < 8; x++)
{ // Not sure of these 3 lines either...see above…please explain "x+++...MS language?
pinMode(x, OUTPUT);
}

This is making pins 1-7 OUTPUT pins.
This is your code after all.

There is so much wrong with the program that it is difficult to know where to start so let's start with the loop() function

  void loop()
  {
    unsigned long currentTime = millis();
    int Time = 2;
    long interval = 1;
  }

What is it supposed to do apart from declaring and initialising 3 variables that are local to the function so will not be available anywhere else in the program, not that any other code will be executed anyway.

Another simple question. Where is the end of the setup() function ?

// Its Hard Teaching an Old Dog New Tricks. Thanks John for checking on me. Also, thanks for all input.
// Please see attachments...the intent is to place this, as a working file, into the Microcontroller.
// My ignorance, I started with 2 OP programs, had to start somewhere...hopefully, see new attachment.

void setup() {
unsigned long previousTime = 848;
int switchState = 152;
int prevSwitchState = 848; // Not sure of these 3 lines...the intent is to time the outputs a small fraction of a second.
int Time = 1;
long interval = 1;
for (int x = 1; x < 8; x++) { // Not sure of these 3 lines either...see above…please explain "x+++...MS language?
pinMode(x, OUTPUT);
// Maybe the OUTPUT pins will work.
}
int switchPin = pinMode;
int then();
then = switchPin;
if (digitalRead(A0) == HIGH);
{
switchPin 7 = HIGH;
}
if (digitalRead(A1) == HIGH);
{
switchPin 6 = HIGH;
}
if (digitalRead(A2) == HIGH);
{
switchPin 2 = HIGH;
}
if (digitalRead(A3) == HIGH);
{
switchPin 3 = HIGH;
}
if (digitalRead(A4) == HIGH);
{
switchPin 4 = HIGH
}
if (digitalRead(A5) == HIGH);
{
switchPin 5 = HIGH;
}
void loop() {
// The intent is to run the above program.
}

if (digitalRead(A2) == HIGH);Lose the semicolon.
Use code tags.
Make sure you've got enough { and }, in the right places

the intent is to place this, as a working file, into the Microcontroller.

This is obvious.

What is your project supposed to do for you?
Because of viruses, most here will not open a .DOC file.
Please post as simple text in your next post.

.

Can I suggest that before posting yet another hopeless effort you at least try to verify it ? If it won't verify you won't be able to load it and therefore it will never run.

If you get errors that you don't understand then say so and post the errors. And please learn how to post code properly using the </> code tags.

You will find that some of the errors come from all your

{
 switchPin 7 = HIGH;
}

types of statement.

I can't even be sure what you are intending to do with these but whatever it is they don't do anything.

Steve

// Its Hard Teaching an Old Dog New Tricks. Thanks John for checking on me. Also, thanks for all input.
// I will try to right this kind of stuff: if (digitalRead(A0) = HIGH);
{
switchPin 7 == HIGH; in my next post.
// I want to get "Certified" by Arrow Electronics...Indiegogo & Arrow teamed up to help people like me.
// Notes
The Microcontroller can control, almost perfectly, from timing alone; output HIGH for 152ms (.0152) and, output LOW for 848ms (.0848). This timing will allow for multiple corrections per seconds and, is for both WEST (CW) and UP (CW), depending on point of view. With GPS timing, the ‘Days’ can be programmed at the immediate installed location. At the end of the day, the altitude will remain at that angle, while the azimuth angle will travel back to, and park, in the East for the next day.
Microcontroller controls the motors in their respective directions based on their sensor inputs.
Think of a clock face--the center sensor, when light shines on it, the sensor is looking through the orifice hole directly at the center of the sun and, is on control point.
When the sun moves, it shines across the orifice opening, out the bottom at an angle, and falls on a side sensor; that sensor energizes its respective motor to remove the light from that sensor and bring it back to the center.
At the start of the new day, if timing alone is slightly off, the altitude sensors will respond to bring the platform to control point. This should be within control range for Seasonal Solstices and Equinoxes.

Notes, cont.
This control unit can be manufactured in various models. My desire at the moment is to get one to market at a reasonable cost, immediately.
The loads imposed will warrant having different capacities. Changing out the FETs is one example.
The control can be made with WiFi intergraded; touch key pad, etc..
The motors will be 24 VDC so, multiple output transformers will be required so as to handle both.
They can be cabinet mounted or, decorator styled to hang on living room walls.
Manufacturing costs have to be considered. One to control the umbrella on the back patio is an example; remote mounting is another.

Re: BOM?
Microcontroller-ATmega-328P [This controller appears capable, if pushbuttons can be used]
MCU 8-bit ATmega AVR RISC 32KB Flash 2.5V/3.3V/5V 28-Pin PDIP
TSOP32438SS1V IC IR RCVR MOO 38KHZ RADIAL (these are 5mm and can be substituted with 3mm).
PNP Darlington can be used or, separate amplification utilized).
The below companies were used for the previous prototype but, some parts will not be required in the new design. Perhaps a fixed resistor can replace the Bournes variable.
Phoenix Contact
Lumex SML _LED Mfg# LX1206GC-TR
Micro Commercial
Panasonic
TDK
Fairchild
Te
TI
Bournes

https://www.arrow.com/en/indiegogo/program-overview

  1. A millisecond (from milli- and second; symbol: ms) is a thousandth (0.001 or 10−3 or 1/1000) of a second.
    10 milliseconds (a hundredth of a second) are called a centisecond.
    100 milliseconds (one tenth of a second) are called a decisecond.
    The timing is to be replaced with Microcontroller and GPS.

Part of the ‘system’ is the separate sensor assembly. The new sensor assembly also needs to be produced in a Plug-and-Play assembly with several extension (plug-and-play) cord assemblies. Also needed is to pursue with a “Chip” Manufacturer about the costs to manufacture a new solid state chip that is mounted in a waterproof container.
The control will work with ambient light sensors but, Infrared receiver sensors will work better. Because they respond somewhat to ambient light, it is best to use a ‘cold mirror’ to filter out the ambient part. Also, to be water proof, the assembly needs a lens; possibly, the lens can be replaced with the mirror, otherwise they can be piggybacked.
In theory, this control will operate by timing alone but, in case it doesn’t, the perimeter sensors come into play to take up the slack. The 6th sensor is to keep the solar arrays out of the shade of other arrays.
Precision is the name of the game; I’m talking 4 digit accuracy [.0123], for everything involved.

// Here is a note to Arrow showing the existing prototype that I will be replacing...Solid State is desired.
Word file to Paul
The timing is to be replaced with Microcontroller and GPS.

Part of the ‘system’ is the separate sensor assembly. The new sensor assembly also needs to be produced in a Plug-and-Play assembly with several extension (plug-and-play) cord assemblies. Also needed is to pursue with a “Chip” Manufacturer about the costs to manufacture a new solid state chip that is mounted in a waterproof container.
The control will work with ambient light sensors but, Infrared receiver sensors will work better. Because they respond somewhat to ambient light, it is best to use a ‘cold mirror’ to filter out the ambient part. Also, to be water proof, the assembly needs a lens; possibly, the lens can be replaced with the mirror, otherwise they can be piggybacked.
In theory, this control will operate by timing alone but, in case it doesn’t, the perimeter sensors come into play to take up the slack. The 6th sensor is to keep the solar arrays out of the shade of other arrays.
Precision is the name of the game; I’m talking 4 digit accuracy [.0123], for everything involved.

12

9 F 3

6

Orifices

  • O Sun
    | | Light beams
    v v
  • O Orifice #1
    | |
    v v
  • O Orifice #2
    | |
    v v
  • OOO Sensors
    Front Right side view
    O
    O O O
    O
    Bottom view
    I believe the control system can be miniaturized with smaller sensors clustered tighter together and, replacing the small bore tube with a very small orifice.
    The relays can be replaced with a programmable microcontroller and the second Time Clock replaced with a counting scheme. The first clock can be replaced with GPS.

THEORY
TC-1 Day/Night
Daytime N/C contact supplies power to the common terminal of Relay A1 (West). D/N relay (Face-center sensor)_ when no light on sensor (LED on)-not on control-motor must run to bring light on face sensor. When D/N relay switches, n/c contact passes voltage, thru a diode, to the common terminal of Relay A1 (West). It also passes voltage to electronic timers T1 & T2. Timer LED’s flashes off, momentarily, all other LED’s are ON continuously when on control point.
(If D/N relay does not switch-not on control, motor continuously drives to the west_ how to get back to control?
From start, the system MUST BE aimed at the sun, so as to be on control.
[repeat] (When D/N relay switches, n/c contact passes voltage, thru a diode, to the common terminal of Relay A1 West). It also passes voltage to electronic timers T1 & T2.
T1 drives motor westward- through timing-
Relays D/N {Face}, West, East, Up, Down are functions of their respective sensors:
Relay D/N {Face} common contact is powered thru time clock TC-1 contact n/c for daytime control.
Relay A1 (West) common contact is powered thru D/N {Face} relay contact n/o for daytime control.
D/N {Face} relay contact n/c only makes circuit when unit is OFF control point, so as to not conflict with normal operation during the day.
Relay A1 (West) common contact passes thru to relay contact n/c to energize motor ⃝M-A (West).
Relay A2 (East) common contact is powered thru to relay contact n/c to energize motor ⃝M-A (East).
Relay E1 (Up) & Relay E2 (Down) common contacts are powered thru a Flip/Flop, which in turn is powered by D/N {Face} relay contact n/c for daytime control.
Timer T1 contact n/c provides timed-control for daytime control of ⃝M-A (West).
Timer T2 contact n/c provides timed-control for daytime control of ⃝M-E (UP & Down) thru a.m.-p.m. TC-2.
Sensor ҈#1 LED is lighted when no light is on ҉sensor (Relay A1 contact n/c provides voltage to ⃝M-A.
Sensor ҈#1 LED is out when light is shining on ҉sensor. Voltage is removed from motor ⃝M-A.

Notes:
Therefore, on the equinox and for several days before and after the equinox, the length of day will range from about 12 hours and six and one-half minutes at the equator, to 12 hours and 8 minutes at 30 degrees latitude, to 12 hours and 16 minutes at 60 degrees latitude.
Seasons are caused by the fact that the Earth is tilted on its axis by 23.5°. (23.5/365=0.0425)
6060**24365=31,536,000 [2.72/day]; (approx. 3 up & 3 down). This should accommodate the Solstices and Equinoxes.

If you have any questions, I will be more than glad to answer them.
Warm regards,
Jack

P.S. Please let me know if you can access the web pages.

// When certified, I will be seeking funding on Indiegogo...watch for it!

@JackOWalden1Sr, with all respect, I think you need to find a person with whom you can meet and discuss the project face to face and who has the expertise to help you turn your idea into reality.

I don't think it is practical to bridge that gap in an an online Forum.

...R

// R...Thank you for your well received opinion, however, I respectfully disagree.
// Like Thomas Edison,, I know 10,000 ways that wont work. (raising capital)
// The world needs, wants, and is waiting for this...I have parts on order for testing...Indiegogo is yet another try for funding...please help me get this to market and, it will make you feel good about helping.
// Please see below for more...

const int switchPin = 9;
unsigned long previousTime = .152;
int switchState = .152;
int prevSwitchState = .152;
int led = 1;
long interval = 1;
void setup() {
  for (int x = 1; x < 8; x++) {
    pinMode(x, OUTPUT);
  }
  pinMode(switchPin, INPUT);
}
void loop() {
  unsigned long currentTime = millis();
  if (currentTime - previousTime > interval) {
    previousTime = currentTime;
    digitalWrite(led, HIGH);
    led++;
    if (led == 6) {
    }
    {
      switchState = digitalRead(switchPin);
      if (switchState != prevSwitchState)
        for (int x = 1; x < 2; x++)
          digitalWrite(x, HIGH );
    }
    led = 1;
    previousTime = currentTime;
    {
      prevSwitchState = switchState;
    }
  }
}

int prevSwitchState = .152;

Do you know what in integer is?

unsigned long previousTime = .152;
int switchState = .152;
int prevSwitchState = .152;

if (led == 6) {
}

Same old same old, patience has been lost here.

 for (int x = 1; x < 8; x++)
  {
    pinMode(x, OUTPUT);
  }

Do you really want to use pin 1 as an output when it is used by the Serial interface ? What have you got connected to it ?

    if (led == 6)
    {
    }

Did you mean to do something if led equals 6 ?

    {
      switchState = digitalRead(switchPin);
      if (switchState != prevSwitchState)
        for (int x = 1; x < 2; x++)
          digitalWrite(x, HIGH );
    }

Why the braces around this code block but not around the for loop code block ?
Why the for loop anyway when the loop value can only ever be 1 ?

The attached photo of a monitor is too fuzzy to read. Looks like Darlington Pairs on the left. What are those things across the top?!? The block on the right looks like a motor driver but the thing on the far right has wires that just fade out.

Troll 10/10. Don't be duped by the picture.
Person can't even name a variable correctly and is misrepresenting the 'support' of companies who have never heard of nor care about this pointless project. Some Rube Goldberg sun tracker more pointless than systems that already exist but to this person's mind their ignorance is taken to be proof that it's a new idea.
Can we just let this die?