Devices & Components
Arduino Uno Rev3
sd card tf module
UTSOURCE Electronic Parts
Proximity Sensor
micro sd card
Servos (Tower Pro MG996R)
Software & Tools
Arduino IDE
Project description
Code
mofiza.welcome.code
c_cpp
1#include "ServoTimer2.h" 2#include#define SD_ChipSelectPin 10 3#include"TMRpcm.h" 4#includeTMRpcm tmrpcm; 5ServoTimer2 matha; //matha means HEAD 6ServoTimer2 lhand; 7ServoTimer2 rhand; 8int in1= 6;int in2= 7;int in3= 8; 9void setup() 10{ matha.attach(2); 11lhand.attach(3); 12rhand.attach(4); 13tmrpcm.speakerPin=9; 14Serial.begin(9600); 15if(!SD.begin(SD_ChipSelectPin)) 16{ Serial.println("SD FAIL"); return; 17} 18} 19void loop() 20{ 21if(!(digitalRead(in3))) 22{ tmrpcm.play("welcome.wav"); 23 lhand.write(2500); 24delay(2000); 25lhand.write(1200); //handshake position 26delay(9000); 27} 28else 29{ 30lhand.write(300); 31rhand.write(1700); 32matha.write(1500); } 33}
mofiza.welcome.code
c_cpp
1#include "ServoTimer2.h" 2#include#define SD_ChipSelectPin 10 3#include"TMRpcm.h" 4#includeTMRpcm 5 tmrpcm; 6ServoTimer2 matha; //matha means HEAD 7ServoTimer2 lhand; 8ServoTimer2 9 rhand; 10int in1= 6;int in2= 7;int in3= 8; 11void setup() 12{ matha.attach(2); 13 14lhand.attach(3); 15rhand.attach(4); 16tmrpcm.speakerPin=9; 17Serial.begin(9600); 18 19if(!SD.begin(SD_ChipSelectPin)) 20{ Serial.println("SD FAIL"); return; 21 22} 23} 24void loop() 25{ 26if(!(digitalRead(in3))) 27{ tmrpcm.play("welcome.wav"); 28 29 lhand.write(2500); 30delay(2000); 31lhand.write(1200); //handshake 32 position 33delay(9000); 34} 35else 36{ 37lhand.write(300); 38 39rhand.write(1700); 40matha.write(1500); } 41}
mofiza.fullCode.v1.1
Downloadable files
mofiza.circuit
mofiza.circuit
mofiza.circuit
mofiza.circuit
Comments
Only logged in users can leave comments