
Arduino simple code
- or -
Post a project like this3422
$15
- Posted:
- Proposals: 5
- Remote
- #1246473
- Awarded
Description
Experience Level: Intermediate
The job is HOME MADE MOTION ACTIVATED TRASH CAN
Projeto URL: http://clone.tinkernut.com/portfolio/motion-activated-trash-can/
Projeto vídeo https://youtu.be/pUIGNnbTe0o
The code is:
#define pingTrig 6 #define pingEcho 7 #include Servo myservo; void setup() { pinMode(pingTrig, OUTPUT); pinMode(pingEcho, INPUT); myservo.attach(9); } void loop() { long duration, inches, cm; digitalWrite(pingTrig, LOW); delayMicroseconds(2); digitalWrite(pingTrig, HIGH); delayMicroseconds(10); digitalWrite(pingTrig, LOW); duration = pulseIn(pingEcho, HIGH); cm = duration / 29 / 2; if(cm < 10 ){ myservo.write(90); delay(100); }else{ myservo.write(0); } delay(2000); }
I have and arduino code that make a servo motor turns 90 degrees and go back tô zero when activated by the ultrasonic sensor. (Automatic trash can that open and closes) And it is working fine.
I want tô modify the code tô make it work with a Stepper motor and tb6560.
**the job can be done en less than 10 minutes, Because i will send the code and u just have to make and add a simple modification.
Projeto URL: http://clone.tinkernut.com/portfolio/motion-activated-trash-can/
Projeto vídeo https://youtu.be/pUIGNnbTe0o
The code is:
#define pingTrig 6 #define pingEcho 7 #include Servo myservo; void setup() { pinMode(pingTrig, OUTPUT); pinMode(pingEcho, INPUT); myservo.attach(9); } void loop() { long duration, inches, cm; digitalWrite(pingTrig, LOW); delayMicroseconds(2); digitalWrite(pingTrig, HIGH); delayMicroseconds(10); digitalWrite(pingTrig, LOW); duration = pulseIn(pingEcho, HIGH); cm = duration / 29 / 2; if(cm < 10 ){ myservo.write(90); delay(100); }else{ myservo.write(0); } delay(2000); }
I have and arduino code that make a servo motor turns 90 degrees and go back tô zero when activated by the ultrasonic sensor. (Automatic trash can that open and closes) And it is working fine.
I want tô modify the code tô make it work with a Stepper motor and tb6560.
**the job can be done en less than 10 minutes, Because i will send the code and u just have to make and add a simple modification.
Tareq A.
100% (5)Projects Completed
2
Freelancers worked with
2
Projects awarded
67%
Last project
21 Apr 2019
Brazil
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-

Tareq i can help you when its due?
100743
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies