Arduino to card Controll T-Scann 8 Ver 1.60

What's new in ver 1.60 is instead of using "delayMicroseconds" which pauses the program run. It should always be avoided. Now I use "micros ()" instead, the program can loop all code and perform step on stepper motors when the time is right, much better!

 

Even the winding of the film on wheel-C is redone. Now the speed of wheel-C is regulated continuously, more evenly on the wheel.

When the scan starts, the program detects if it is Super 8 or regular 8. This is done to set the correct number of braking steps.

 

 

// Detect whether Super 8 or Regular 8

 

361.    if (typeF >= 2 && WstepLast > 280 && WstepLast < 300 ) {

      WstepS = 270; //R8

    }

 

    if (typeF >= 2 && WstepLast > 300) {

      WstepS = 290; //S8

    }

 

Now the program knows that it is Super8, the distance between each frame is about 315 steps.

 

1 - 290 steps now the variable "sped" changes from 1000 microsecond to 15000 microsecond.

 

352. if (Wstep >= WstepS && typeF >= 2 ) {

 

      sped = spedS;

   }

 

2 - "perfLevel" is now 250 and the picture can be taken

 

 

 

3 - After exposing the image, "sped" is reset to 1000

    "Wstep" counts the number of steps between frames, resets.

 

    "WstepV" determines that the minimum number of steps before a new exposure can occur

    is at least 200 steps. This is to minimize the risk of exposure in the wrong place.

This is the new code for winding the film on wheel-c.

 

The start value of "inDraTime" is 2000. The movie is stretched when the scan begins.

 

 

// ------------ Stretching film pickup wheel (C) ------

 

    inDraState = digitalRead(inDra);

 

 

 

    if (Play == HIGH && inDraState == LOW && (time - LastTimeDra) >= inDraTime) {

      digitalWrite(stepSpoleC, LOW); digitalWrite(stepSpoleC, HIGH); LastTimeDra = time;

    }

 

Each time the Tracktion switch turns on, the speed decreases slightly

by "inDraTime = inDraTime + 200;" increased.

 

 361.   if (Play == HIGH && inDraState == HIGH) {

           inDraTime = inDraTime + 200;

    }

 

 

The maximum time "inDraTime> = 12000" is 12000 which then reduces the time to 7000. The speed / time can then vary between 7000 and 12000.

 

  if (Play == HIGH && inDraState == HIGH && inDraTime >= 12000) {

      inDraTime = 7000;

    }

 

 

If you want to study how this function works

replace "measureP" with "inDraTime" and use "Serial monitor" in Arduino IDE. This value usually fluctuates up and down.

 

 

370. if (Play == HIGH) {

      Serial.println(measureP);

    }

 

Arduino IDE has a function under Tools - Serial Plotter - which makes it possible to see the detection of

film perforation in real time.