In this project we are going to scale the size of an image using the distance value acquired from an HC-SR04 ultrasonic sensor. The lower the distance, smaller the image size; farther the distance, bigger the image size.
As you can see in the circuit connect the trigger pin of HC-SR04 sensor to digital pin 12, echo pin to digital pin 11 and VCC of sensor to 5v of arduino and GND to GND of arduino.
- Digital 12 to Trigger
- Digital 11 to Echo
- 5V to VCC
- GND to GND