You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have problem
i am create test project in proteus Master:
` #include <ICSC.h>
const int buttonPin = 3;
const int ledPin = 4;
const int portreadyled = 5;
const int dePin = 2;
int buttonState = 0;
ICSC icsc(Serial,'A',dePin);
void setup() {
// put your setup code here, to run once:
// initialize the button pin as a input:
pinMode(buttonPin, INPUT);
// initialize the LED as an output:
pinMode(ledPin, OUTPUT);
pinMode(2,OUTPUT);
Serial.begin(9600);
icsc.begin();
icsc.registerCommand('G',&check);
delay(2000);
digitalWrite(ledPin, HIGH);
delay(100);
icsc.send('B', 'S');
Slave :
` #include <ICSC.h>
#include <String.h>
const int buttonPin = 3;
const int ledPin = 4;
const int dePin = 2;
int buttonState = 0;
ICSC icsc(Serial,'B',dePin);
void setup() {
// put your setup code here, to run once:
// initialize the button pin as a input:
pinMode(buttonPin, INPUT);
// initialize the LED as an output:
pinMode(ledPin, OUTPUT);
pinMode(2,OUTPUT);
Serial.begin(9600);
icsc.begin();
icsc.registerCommand('S',&stat);
}
void loop() {
I have problem
![1213123](https://user-images.githubusercontent.com/1639829/35193784-f6470d6e-feb8-11e7-981d-b8b144cd28ec.PNG)
i am create test project in proteus
Master:
` #include <ICSC.h>
const int buttonPin = 3;
const int ledPin = 4;
const int portreadyled = 5;
const int dePin = 2;
int buttonState = 0;
ICSC icsc(Serial,'A',dePin);
void setup() {
// put your setup code here, to run once:
// initialize the button pin as a input:
pinMode(buttonPin, INPUT);
// initialize the LED as an output:
pinMode(ledPin, OUTPUT);
pinMode(2,OUTPUT);
Serial.begin(9600);
icsc.begin();
icsc.registerCommand('G',&check);
delay(2000);
digitalWrite(ledPin, HIGH);
delay(100);
icsc.send('B', 'S');
}
void loop() {
icsc.process();
}
void check(unsigned char src, char command, unsigned char len, char *data)
{
digitalWrite(ledPin, LOW);
} `
Slave :
` #include <ICSC.h>
#include <String.h>
const int buttonPin = 3;
const int ledPin = 4;
const int dePin = 2;
int buttonState = 0;
ICSC icsc(Serial,'B',dePin);
void setup() {
// put your setup code here, to run once:
// initialize the button pin as a input:
pinMode(buttonPin, INPUT);
// initialize the LED as an output:
pinMode(ledPin, OUTPUT);
pinMode(2,OUTPUT);
Serial.begin(9600);
icsc.begin();
icsc.registerCommand('S',&stat);
}
void loop() {
icsc.process();
//icsc.send('A', 'G');
}
void stat(unsigned char src, char command, unsigned char len, char *data)
{
delay(1000);
for (int i=0; i <= 15; i++){
icsc.send('A', 'G');
icsc.process();
delay(50);
}
} `
Algorithm:
master send to slave command and led is high
slave recieve command wait and 15times try send to master command for led is LOW
master react only on 5
why ?
The text was updated successfully, but these errors were encountered: