* Since the oscilloscope readings were not very clear, we tried to understand what was wrong, and it took us two attempts to get it right. During the first attempt, the ground connection was not properly attached, and in the second, the channels were inverted.
* I used the code that Adrián Torres’ Fab Academy documentation provided as a reference for programming the distance sensor. But unfortunately it was not working.

week 9:output devices


Gert's training

During this week’s training, Gert showed us how to use the oscilloscope to check if the power voltage influences the performance of an output


9.1
Gert introduced us to the objective of the exercise
9.2
Gert demonstrated in detail the proper way to connect the oscilloscope to the sensor, explaining the role of each connection
9.3
ensuring that all connections are secure and properly aligned
9.4
movement detection
the sensor doesn't react

new iteration

For this week’s assignment, I decided to reuse the PCB board I designed back in Week 5. The reference from Adrián Torres’ Fab Academy documentation turned out to be extremely helpful when planning the pin layout and connections. It seems that the board I designed is well-suited not only for controlling the servo motor I used in weeks 5 and 6, but also for experimenting with various input devices.

Since I am still questioning which kind of detectors would be the best to include in my final project I decided to use a distance detector sensor


9.6
no movement detection
the sensor doesn't react
9.7
found the distance sensor in the shop
9.8
the distance sensor VL53L1X
the sensor doesn't react
the sensor doesn't react
the sensor doesn't react
9.8
the distance sensor VL53L1X
9.8
the distance sensor VL53L1X
the sensor doesn't react
the sensor doesn't react
Arduino VL53L1X Distance Sensor + Button + LED Brightness Control



#include 

Servo myservo;

const int buttonPin = 1;  
const int servoPin = 26;  
const int ledPin = 0;     

int buttonState = 0;
int lastButtonState = LOW;
int servoAngle = 0;

void setup() {
  myservo.attach(servoPin);
  pinMode(buttonPin, INPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH); // LED on initially

  servoAngle = 0;
  myservo.write(servoAngle);
}

void loop() {
  buttonState = digitalRead(buttonPin);

  if (lastButtonState == LOW && buttonState == HIGH) {
    digitalWrite(ledPin, LOW);

    // Rotate +90° but wrap back to 0° if beyond 180
    servoAngle += 90;
    if (servoAngle > 180) {
      servoAngle = 0;
    }

    myservo.write(servoAngle);
    delay(400); // debounce delay
    digitalWrite(ledPin, HIGH); // LED back on after move
  }

  lastButtonState = buttonState;
}