STUPID PET TRICK

 This is a frustrated to the knees metal villain, as you can see, he is composed of a wire. To react to his emotions, I made his body crooked.


Often at this time, whoever it is will want someone to give us comfort, and this is where my inspiration comes from, because not everyone will have the courage to comfort a stranger. In this installation, when we stand in front of the little man and look at him, the led on his head will become brighter and brighter as we get closer to him and as we say to him "everything will be okay". Orange is the color of warmth, and in my opinion, the color of healing.






<textarea>/*

Example sketch for the HC-SR04 ultrasonic sensor
Written by Spulber George-Marian
REQUIRES the following Arduino library:
- EasyUltrasonic: https://github.com/SpulberGeorge/EasyUltrasonic
This sketch prints the distance measured by the ultrasonic sensor in the 4 Pin Mode to the Serial Monitor.
###########################################
                CONNECTIONS:
###########################################
###########################################
              HC-SR04 sensor:
###########################################
          VCC -> 5V
          trig pin -> digital pin 10
          echo pin -> digital pin 11
          GND -> GND
         
###########################################
MIT License
Copyright (c) 2022 Spulber George-Marian
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <EasyUltrasonic.h>
#define TRIGPIN 10 // Digital pin connected to the trig pin of the ultrasonic sensor
#define ECHOPIN 11 // Digital pin connected to the echo pin of the ultrasonic sensor
EasyUltrasonic ultrasonic; // Create the ultrasonic object
float distanceCM;
float cmMapped;
float follower;
void setup() {
  Serial.begin(9600); // Open the serial port
  ultrasonic.attach(TRIGPIN, ECHOPIN); // Attaches the ultrasonic sensor on the specified pins on the ultrasonic object
  pinMode(3,INPUT);
}
void loop() {
 
  distanceCM = ultrasonic.getDistanceCM(); // Read the distance in centimeters
  if(distanceCM < 300){
    distanceCM = 300;
  }
  cmMapped = map(distanceCM,3,170,255,0);
  follower += (cmMapped -follower) * 0.5;
  analogWrite(9,cmMapped);
 
  // float distanceIN = ultrasonic.getDistanceIN(); // Uncomment if you want to get the distance in inches
 
  // Print the distance value in Serial Monitor
  Serial.print(cmMapped);
  Serial.print(" ");
  Serial.println(digitalRead(3));
  delay(100);
  int thispitch = map(follower,0,255,120,1500);
   if(digitalRead(3)==0){
  tone(8,9);
}

}</textarea>

https://youtube.com/shorts/nWdGXUp77Vs?feature=share

https://youtu.be/-OPMfNhfEf0


评论

此博客中的热门博文

A5OBDF310

OBDF310A3

OBDF310A4