what is problem when i write 0x01 at 0x0000 address of st25dv04k?
#include <stdio.h>
#include <sys/ioctl.h> // ioctl
#include <fcntl.h> // open
#include <unistd.h> // read/write usleep
#include <time.h>
#include <netinet/in.h> // htons
#include <linux/i2c-dev.h>
#include "smbus.h"
#define ADDRESS 0x53 // AT24C32's address on I2C bus
int main() {
int fd;
if ((fd = open("/dev/i2c-2", O_RDWR)) < 0) { printf("Couldn't open device! %d\n", fd); return 1; }
if (ioctl(fd, I2C_SLAVE, ADDRESS) < 0) { printf("Couldn't find device on address!\n"); return 1; }
write(fd,0x0000,0x01);
usleep(500);
close(fd);
return 0;
}
