Bonjour a tous
je dois réaliser un script de détection basé sur la librairie WiringPi pour le raspberry
j ai commencé a développer mais je bloque sur une erreur que je ne comprends pas .
j ai donc installé wiringPi sur le RPI
voici une ligne du code :
une partie du code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 root@jeedom:# gcc -Wall -demon_main main.c -lwiringPi cc1: warning: unrecognized gcc debugging option: e [enabled by default] cc1: warning: unrecognized gcc debugging option: m [enabled by default] cc1: warning: unrecognized gcc debugging option: o [enabled by default] cc1: warning: unrecognized gcc debugging option: n [enabled by default] cc1: warning: unrecognized gcc debugging option: _ [enabled by default] cc1: warning: unrecognized gcc debugging option: m [enabled by default] cc1: warning: unrecognized gcc debugging option: i [enabled by default] cc1: warning: unrecognized gcc debugging option: n [enabled by default] main.c: In function main: main.c:347:17: warning: unused variable pin_input [-Wunused-variable] main.c:349:14: warning: unused variable pin_input [-Wunused-variable] main.c:354:15: warning: comparison with string literal results in unspecified behavior [-Waddress] main.c:300:8: warning: unused variable is_mini [-Wunused-variable] main.c:297:8: warning: unused variable Api_key [-Wunused-variable] main.c:296:8: warning: unused variable port [-Wunused-variable] main.c:295:8: warning: unused variable ip_jeedom [-Wunused-variable] main.c: In function start_detect: main.c:274:1: warning: control reaches end of non-void function [-Wreturn-type] main.c: In function detection: main.c:170:1: warning: control reaches end of non-void function [-Wreturn-type] root@jeedom:/usr/share/nginx/www/jeedom/plugins/gpio/ressources/projectc/gpio#
je ne m en sort pas avec ce C
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 char *ip_jeedom = "localhost"; char *port = "none"; char *Api_key = "g7l8vqmn7tns1enlfiy2"; char *tab_input = "45_63_2"; char *tab_pilote = "0_1_1_78-0_0_0_78-4_1_1_206-4_0_0_206"; char *is_mini = "non"; char *addre = "0x20"; wiringPiSetup () ; // On cherche la première occurrence de "test" dans "Texte de test" : if(strcmp(addre, "0x20") != 0) mcp23017Setup(40,0x20); if(strcmp(addre, "0x21") != 0) mcp23017Setup(40,0x21); if(strcmp(addre, "0x22") != 0) mcp23017Setup(40,0x22); if(strcmp(addre, "0x23") != 0) mcp23017Setup(40,0x23); if(strcmp(addre, "0x24") != 0) mcp23017Setup(40,0x24); if(strcmp(addre, "0x25") != 0) mcp23017Setup(40,0x25); if(strcmp(addre, "0x26") != 0) mcp23017Setup(40,0x26); if(strcmp(addre, "0x27") != 0) mcp23017Setup(40,0x27); // printf ("Raspberry Pi - MCP23017 Test\n") ; //mcp23008Setup (int pinBase, int i2cAddress) ; /* printf("host %s \n", ip_jeedom); printf("port %s \n", port); printf("apikey %s \n", Api_key); printf("input %s \n", tab_input); printf("pilote %s \n", tab_pilote); printf("mini %s \n",is_mini); */ char * pch; pch=strchr(tab_input,','); if(pch!=NULL){ // if(strchr(tab_input, ',')){ char *pin_input = strtok(tab_input, ","); }else{ char pin_input = *tab_input; } char* pilotes = tab_pilote; char *pin_pilote = "none"; if(pilotes!="none"){ pin_pilote = tab_pilote; }
merci pour votre aide
Partager