Bodymimicry 3d Model by artemot on Sketchfab
Bodymimicry Accesory by artemot on Sketchfab
int solenoidPin = 4; //This is the output pin on the Arduino we are using void setup() { // put your setup code here, to run once: pinMode(solenoidPin, OUTPUT); //Sets the pin as an output } void loop() { // put your main code here, to run repeatedly: digitalWrite(solenoidPin, HIGH); //Switch Solenoid ON delay(2000); //Wait 1 Second digitalWrite(solenoidPin, LOW); //Switch Solenoid OFF delay(2000); //Wait 1 Second }
/* * Ultrasonic Sensor HC-SR04 and Arduino Tutorial * * by Dejan Nedelkovski, * www.HowToMechatronics.com * */ // defines pins numbers const int trigPin = 0; const int echoPin = 1; // defines variables long duration; int distance; void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input pinMode(2,OUTPUT); //Serial.begin(9600); // Starts the serial communication } void loop() { // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the distance distance= duration*0.034/2; if (distance<10){ digitalWrite(2,HIGH); } else{ digitalWrite(2,LOW); } }
* Ultrasonic Sensor HC-SR04 and Arduino Tutorial * * by Dejan Nedelkovski, * www.HowToMechatronics.com * */ // defines pins numbers const int trigPin = 0; const int echoPin = 1; // defines variables long duration; int distance; void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input pinMode(2,OUTPUT); //Serial.begin(9600); // Starts the serial communication } void loop() { // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the distance distance= duration*0.034/2; if (distance<10){ digitalWrite(2,HIGH); } else{ digitalWrite(2,LOW); } }