We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i need help. i get this source code
#include <at89x51.h> #include <delay.h> #define usi P3_2 // ultrasonic in #define uso P3_3 // ultrasonic out
unsigned char i; bit x;
at 0x90 sbit md1; // left at 0x91 sbit me1; // at 0x92 sbit md2; // right at 0x93 sbit me2; //
void cek_jarak() { TH0 = 0x00; TL0 = 0x00; TF0 = 0; TF1 = 0; usi = 1; TR1 = 1; while(!TF1); TR1 = 0; usi = 0; while(!uso); TR0 = 1; while(uso); TR0 = 0; }
void perjalanan(bit a, bit b, bit c, bit d) {me1= a; me2= b; md1= c; md2= d;}
void main() { TMOD = 0x21 ; TCON = 0x00 ; TH1 = 100; while(1) { cek_jarak(); if(TH0 > 0x00) perjalanan(0,0,1,1);// forward else { perjalanan(0,0,0,0);// backward for(i=0; i<100; i++)delay(6000); perjalanan(0,0,x,~x);// turn right/left for(i=0; i<100; i++)delay(6000); } x = ~x; } }
but i cannot compile it. can anybody help?
i'm so sorry.. it's not library that i mean.. it's the headers.. so sorry.. i'm new in this stuff, that's why i tried to learn.. i'm indonesian and in my area there's nobody studied about microcontroller and their stuff.. so i can't ask for advice anywhere here.. hope you don't mind sharing some of your knowledge..