Forum Replies Created
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
rohit pandeyParticipant#include<REGX51.h>#include<intrins.h>// for using _nop_() functionsfr16 DPTR =0x82;sbit trig=P3^1;void send_pulse(void) //to generate 10 microseconds delay{TH0=0x00;TL0=0x00;trig=1;_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();trig=0;}unsigned char get_range(void){unsigned char range;send_pulse();while(!INT0);// in sake of these lines you can generate a delay of 40 Milli seconds=40000 microwhile (INT0);// secondsDPH=TH0;DPL=TL0;TH0=0xFF;TL0=0xFF;if(DPTR<35000)//actually you need to use 38000 but the sensor may not work at higher levelsrange=DPTR/59;elserange=0; // indicates that there is no obstacle in front of the sensorreturn range;}void main(){TMOD=0x09;//timer0 in 16 bit mode with gate enableTR0=1;//timer run enabledTH0=0x00;TL0=0x00;P1=0xff;P3|=0x04;//setting pin P3.2}this is my code please help me in howing distance on led as above mentioned led code it is giving me errors please patch them into thisrohit pandeyParticipant
and the cicuit diagram if possible for you or zulhoriz please provide the schematics for connection of sensor to micro and to dc motor thnx in advance
rohit pandeyParticipantnidhin i need ur help in making a similar project but i dont have to display it i just have to convert the range into vibration like maximum range gives minimum vibrations and min range gives maximum vibration using pwm can you provide somthing on the it will be highly appriciable i am using 6 volt dc motor using maimum 5 volt range as entier circuit will be powered by a 9 volt battry and i am using hc sr04 ultrasonic range module and atmel 89s51 as processor please help as i am new to c programming and dont know how to do all this thanks in advance
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)