source code for automatic plant irrigation arduino

2
SOFTWARE DESCRIPTION #include<reg51.h> sbit SW_1 = P2^6; //connecting switch 1 to the port 2 ,pin 6. sbit SW_2 = P2^7; // connecting switch 1 to the port 2 ,pin 7. sbit MTR = P1^0; void main() { int x; while(1) { if(SW_1==0 & SW_2==0) { MTR=1; for(x=0;x<150;x++); MTR=0; for(x=0;x<600;x++); } if(SW_1==0 & SW_2==1) { MTR=1; for(x=0;x<300;x++); MTR=0; for(x=0;x<300;x++); } if(SW_1==1 & SW_2==0)

Upload: akash

Post on 12-Sep-2015

9 views

Category:

Documents


3 download

DESCRIPTION

Trust comes here...

TRANSCRIPT

SOFTWARE DESCRIPTION

#include sbit SW_1 = P2^6; //connecting switch 1 to the port 2 ,pin 6. sbit SW_2 = P2^7; // connecting switch 1 to the port 2 ,pin 7. sbit MTR = P1^0; void main() { int x; while(1) { if(SW_1==0 & SW_2==0) { MTR=1; for(x=0;x