BONJOUR!
j'ai regardé si j'avais pas de soucis sur ma carte et je me rend compte que si!
car, je n'est pas connecté la pin INT de mes PCF c'est peut être ça !
cependant, j'ai tiré une petite carte avec juste 2 PCF et voici le code que j'ai introduit dedans et ça tourne normalement ,
mes avec mon Serial.print( X , BIN); je n'est que des " 0" qui s'affiche c'est donc dire qu'il ne reçois rien au niveau de c'est broche ou bien?
si oui! j'aimerai savoir pourquoi?
merci!
#include "Wire.h"
#include <LiquidCrystal.h>
// Adressage des expandeurs
#define Entrechip1 0x20 // binaire 0x20
#define Entrechip2 0x21 // binaire 0x21
#define Entrechip3 0x22// binaire 0x22
#define Entrechip4 0x23// binaire 0x23
#define Entrechip5 0x24// binaire 0x24
#define Entrechip6 0x25 // binaire 0x25
#define Sortichip1 0x26// binaire 0x26
#define Sortichip2 0x27// binaire 0x27
#define Sortichip3 0x38// binaire 38h
#define Sortichip4 0x39// binaire 39h
#define Sortichip5 0x3A// binaire 3Ah
#define Sortichip6 0x3B// binaire 3Bh
#define Sortichip7 0x3C// binaire 3Ch
#define Sortichip8 0x3D// binaire 3Dh
#define Sortichip9 0x3F// binaire 3Eh
//#define LENGTH_REGISTER 8
int dd=200;
int val= B11111111;
int val1= B11111111;
int a,b,i,j;
byte x,y,u,v,w,s,z,p,t,m,n;
byte count;
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
Serial.begin(9600);
Serial.print("hello, world!");
}
void loop() {
Serial.print("bonjour");
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000);
for( int a=1 ; a<13 ; a++)
{
// mettre toutes les broches de win1 a l'état haut
Wire.beginTransmission(Entrechip4);
Wire.send(val);
Wire.send(val);
Wire.endTransmission();
Serial.print("val:");
Serial.print(x,BIN);
Serial.println();
// Lecture des valeurs
Wire.requestFrom(Entrechip3, 1);
x = Wire.receive();
y = Wire.receive();
Serial.println();
//delay(2000);
Serial.print(x,BIN);
Serial.print(y,BIN);
//Serial.print(val,BIN);
//byte c =bitRead( x,i);
//byte d =bitRead( y,j);
if( x== 111111111) { Serial.print(" PIN");Serial.print(a); //lcd.setCursor(0, 1);lcd.print(" pin");
}
//if( i== 1 && j==1){ Serial.print( "ok");}
//Serial.print(c);
}
}