Trying to configure openscan

Ive ordered a kit from a guy in Germany that uses a nano to control two servos and trigger a pin on the board at certain intervals. That pin on the board goes to a optocoupler that triggers a bluetooth shutter controller for a phone to take photos at those intervals. Theres not alot of info on his page about configuring the sketch to trigger the optocoupler via the nano. Im wandering if someone could see something I am missing in the sketch that he has supplied. Thank you.https://www.openscan.eu/?lang=en

Scanner.ino (30.7 KB)

Im wandering

Stand still. Talk to us. What makes you think anything is wrong?

int buttonUP = 11; //pin for button up
int buttonDOWN = 10; //pin for button down
int buttonOK = 9; //pin for button ok
int step1startpin = 7; //Stepper1 start pin
int step2startpin = 4; //Stepper2 start pin
int photopin1 = 3; //CameraPin
int step1dirpin = 4; //Stepper1 direction pin
int step2dirpin = 6; //Stepper2 direction pin
int step1steppin = 5; //Stepper1 step pin
int step2steppin = 7; //Stepper2 step pin

Consistency is good. This code is not. If you are going to use Pin in the name of variables that hold pin numbers (doing so is a VERY good idea), use Pin in the names of ALL such variables.

AccelStepper Stepper1(1, step1steppin, step1dirpin); // TABLE!!
AccelStepper Stepper2(1, step2steppin, step2dirpin); //(ROTOR!!!)

Using dumb names for the instances, and adding comments, is not a good idea. There is NO reason not to name the instances Table and Rotor. Then, when you later tell a stepper to step, it is ABSOLUTELY clear which stepper is to step. This way, I have to scroll back to the top to figure out which motor is supposed to move.

I don't like to scroll, so I'd just assume that it was the wrong one.

void loop() {

  #define address I2C
  LiquidCrystal_I2C  lcd(address, 2, 1, 0, 4, 5, 6, 7);
  lcd.begin (20, 4);

Creating an instance of the LiquidCrystal_I2C class on every pass through loop() is wrong. You've done this once already. Stop doing it again.

  while(1){

Running an infinite loop in loop() tells me that you don't know what you are doing. So, I quit reading at this point.

Sorry for necro reply. Hopefully this helps anyone else Googling.

I was stuck in the same scenario (I think) as the OP. FWIW, he didn't write the code - it runs an open source 3D printed 3D Scanner called Openscan. There was a single line of code missing (I believe) from the source - replacing it fixed my issue.

Apparently there are numerous issues with the code (not the least of which is the lack of comments after the PIN setup) based on the above terse reply, but it seems to be functioning fine for me now.

Adding:

val4=EEPROM.read(44);

in void AUSLOESEN () fixed the issue for me. A value was stored at that EEPROM location, but it was never read back out into "val4".