Danke für die Antwort und sorry wegen Sontag, da war ich wohl etwas gereitzt...
Ich habe heute früh bei google was gefunden mit dem ich den I2c bus abscannen kann.
Also gedownloaded und ein bissel angepasst und das karm bei raus.
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <linux/i2c-dev.h>
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
int file;
int adapter_nr = 0;
char filename[20];
int res;
char buf[10];
unsigned long funcs;
int quit=0;
printf("Opening device...\n");
sprintf(filename,"/dev/i2c/%s",argv[1]);
if ((file = open(filename,O_RDWR)) < 0)
{
perror("open() failed");
}
printf("Done\n");
int port;
for (port=0; port<127; port++)
{
int res;
if (ioctl(file, I2C_SLAVE, port) < 0)
perror("ioctl() I2C_SLAVE failed\n");
res = i2c_smbus_read_byte(file);
if (res >= 0)
printf("i2c chip found at: %d, val = %d\n", port, res);
}
close(file);
}
Alles anzeigen
wenn ich das nun ausführe kommt folgendes raus.
root@dm7025:/media/hdd/apps# ./test 0
Opening device...
Done
i2c chip found at: 12, val = 161
i2c chip found at: 14, val = 255
i2c chip found at: 80, val = 216
root@dm7025:/media/hdd/apps# ./test 1
Opening device...
Done
i2c chip found at: 12, val = 0
i2c chip found at: 14, val = 0
i2c chip found at: 80, val = 91
root@dm7025:/media/hdd/apps# ./test 2
Opening device...
Done
ioctl() I2C_SLAVE failed
: Device or resource busy
ioctl() I2C_SLAVE failed
: Device or resource busy
root@dm7025:/media/hdd/apps# ./test 3
Opening device...
Done
root@dm7025:/media/hdd/apps#
Alles anzeigen
Also gehe ich mal davon aus das es der /dev/i2c/3 sein muss der für Minidin geschaltet ist. Ich habe zwar dort ein LCD das auf 0xFE lauscht aber irgend wie findet er es nicht.
Is das programm richtig und nur meine Verkabelung falsch oder ist das Programm fehlerhaft. ? (Pullups 10kOhm sind dran)
Danke im Voraus