Microcontroller › 8051 › Automatic Bidirectional Visitor Counter › I’ve tried make visitor
I‘ve tried make visitor counter circuit and successful, and I want to combine it with articel read write eeprom (I tried it and succeeded), but when I try to combine both methods the program does not work, please help, I want to store data in the eeprom at24c16 count, and show on seven segment display,
here the code…
#include<reg51.h>
#include<intrins.h>
#define msec 50
#define lcd_data_str_pin P0
bit ack;
sbit rs = P3^6; //Register select (RS) pin
sbit rw = P3^5; //Read write(RW) pin
sbit en = P3^7; //Enable(EN) pin
sbit sda=P3^1; //sda
sbit scl=P3^0; //sck
sbit led=P1^0;
sbit led1=P1^1;
sbit sensor_1=P3^1; //sensor1
int max = 0;
int carry = 0;
int arr[4];
//inisialissi varibel eeprom
unsigned char reead,write,write2,b,k;
unsigned int temp;
//
int count_amt[7],j;
unsigned int count_1,count_2;
/*
void delay(int delay_time) // Time delay function
{
int j,k;
for(j=0;j<=delay_time;j++)
for(k=0;k<=1275;k++);
}
*/
void delay(unsigned int count) // Function to provide time delay in msec.
{
int i,j;
for(i=0;i<count;i++)
for(j=0;j<500;j++);
}
void lcd_cmd(unsigned char cmd_addr) //Function to send command to LCD
{
lcd_data_str_pin = cmd_addr;
en = 1;
rs = 0;
rw = 0;
delay(1);
en = 0;
return;
}
void lcd_data_str(char str[50]) //Function to send string
{
int p;
for (p=0;str[p]!=’