-
AuthorPosts
-
21/12/2016 at 11:55 pm #46837
Andries Malherbe
MemberHi,
I’m testing the DS18B20 One Wire Digital Temperature Sensor and DHT22 and experiencing OPC BAD status intermittently. There has been a question with regards the DS18B20 in the past but no resolution for the intermittent OPC BAD status when connection is made to the OPC server with Matrikon OPC Explorer (Or any OPC browser).
Issue experienced:
The OPC explorer reports variables connected to the DS18B20 and DHT22 sensors as “BAD” intermittently.Libraries and Configuration:
The following libraries are used to read information from the DS18B20 and DHT22 sensors.#include
// Tempreture sensors
#include// Tempreture sensors
#include// Humidity Sensor Links to instrumentation.
DS18B20:
http://www.hobbytronics.co.uk/ds18b20-arduinoQuestions:
Feedback function shared between OPC Items
Which of the following two scenarios are the more preferred one and what are the deference?
These Feedback functions is both for OPC Read.Option 1:
float item_float(const char *itemID, const opcOperation opcOP, const float value)
{
if (opcOP == opc_opwrite)
{}
else
{
Sensors.requestTemperatures(); // Requesting Temperatures
Temperature = Sensors.getTempC(DuctThermometerAddr); // Reading Temperature
return Temperature;
}
}Option 2:
float item_float(const char *itemID, const opcOperation opcOP, const float value)
{
Sensors.requestTemperatures(); // Requesting Temperatures
Temperature = Sensors.getTempC(DuctThermometerAddr); // Reading Temperature
return Temperature;
}Thanks in advance for your help and support.
Best regards,
Andries
27/12/2016 at 12:18 pm #47498ariel
MemberSOLUCIÓN AL PROBLEMA CON EL SENSOR DS18B20, Y LA LIBRERÍA DALLASTEMPERATURE.H .
COLOCAR ESTA SENTENCIA
void setup() {
Serial.begin(9600); //Iniciamos la comunicación serie a 9600 baudios
// indicamos que espera la coversion de la temperatura para evitar problemas de comunicación
sensores.setWaitForConversion(false);Y LISTO. SE VAN LOS PROBLEMAS
PRUEBEN Y AVISEN SI FUNCIONO, A MI SI
11/01/2017 at 7:49 pm #47501i.martinez
KeymasterThank you for the solution!
09/04/2017 at 2:59 pm #47529Javier Duron
MemberHello everyone:
I am just new with OPC, but I have been playing with Duino for 2 years. I am not an expert anyway…
I have been trying to solve the same problem with the DHT11: I am using it for both reading Temperature and Humidity, but I find allways the same problem with BAD lectures on the OPC explorer.
Anyone could help me a little bit. I have been looking everywhere and trying some kind of variations, but still remains.
Any help will be very wellcome!
code code:#include <OPC.h>
#include <Bridge.h>
#include <Ethernet.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
/*#include <DHT.h>
#include <DHT_U.h>*/
#include "DHT.h"#define DHTPIN 3 // Pin which is connected to the DHT sensor.
#define DHTTYPE DHT11 // DHT 11
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete//DHT_Unified dht(DHTPIN, DHTTYPE);
DHT dht(DHTPIN, DHTTYPE);OPCSerial aOPCSerial;
int ledPin = 13;
int ledControl = 12;
float temp;
float humi;
boolean sensorOK = false;bool callback1(const char *itemID, const opcOperation opcOP, const bool value){
static bool ledValue1 = false;
delay(1);if (opcOP == opc_opwrite) {
ledValue1 = value;if (ledValue1)
digitalWrite(ledPin, HIGH);
else
digitalWrite(ledPin, LOW);
}
elsereturn ledValue1;
}//Declaracion del ledControl segun el valor de sensorOK
bool callback2(const char *itemID, const opcOperation opcOP, const bool value){
static bool ledValue2 = false;
delay(1);if (opcOP == opc_opwrite) {
ledValue2 = value;if (ledValue2)
digitalWrite(ledControl, HIGH);
else
digitalWrite(ledControl, LOW);
}
elsereturn ledValue2;
}
float callbackTemp(const char *itemID, const opcOperation opcOP, const float value){
//delay(250); //Funciona mejor sin el delay
// Get temperature event and print its value.
/*sensors_event_t event;
dht.temperature().getEvent(&event);*/
temp = dht.readTemperature();
delay(1);
if (isnan(temp))
sensorOK = false;
else
//temp = event.temperature;
sensorOK = true;
return temp;
//return event.temperature;}
float callbackHumi(const char *itemID, const opcOperation opcOP, const float value){
//delay(250); //Funciona mejor sin el delay
// Get temperature event and print its value.
/*sensors_event_t event;
dht.humidity().getEvent(&event);*/
humi = dht.readHumidity();
delay(1);
if (isnan(humi))
sensorOK = false;
else
//humi = event.relative_humidity;
sensorOK = true;
return humi;
//return event.relative_humidity;
}
void setup() {
Serial.begin(115200);pinMode(ledPin, OUTPUT);
pinMode(ledControl, OUTPUT);
inputString.reserve(200);dht.begin();
DHT.setWaitForConversion(false);
//sensor_t sensor;
/*dht.temperature().getSensor(&sensor);
dht.humidity().getSensor(&sensor);*/aOPCSerial.setup();
aOPCSerial.addItem("led1",opc_readwrite, opc_bool, callback1);
aOPCSerial.addItem("led2",opc_readwrite, opc_bool, callback2);
aOPCSerial.addItem("Temp",opc_read, opc_float, callbackTemp);
aOPCSerial.addItem("Humi",opc_read, opc_float, callbackHumi);
}void loop() {
/*
* OPC process commands
*/
aOPCSerial.processOPCCommands();
}10/04/2017 at 12:07 am #47531Andries Malherbe
MemberHi JDuron,
Are the “BAD lectures on the OPC explorer” intermittent?
Try setting the OPC browser to read OPC information at a slower interval (screen shot attached).
The other option is to read the DHT11 only every 1 or 2 seconds and only pass a variable to the CallBack function, allowing time for the Arduino to send information to OPC server.
If too much OPC items is sent to the OPCserial, too fast, the OPC server and Arduino get out of sych and data is mixed up.
10/04/2017 at 2:39 pm #47532Javier Duron
MemberHi An3s,
Thank you for the tips, but the first one is what I have been playing with… I have intermitently BAD lectures anyway… Sometimes, when changing the dealy() inside the callbacks functions, I get less bad lectures.
So I will try second option. Do you mean to create a global varible and use it to transfer the value from the sensor to the callback function?
Keep trying!
11/04/2017 at 10:01 pm #47533Andries Malherbe
MemberHi JDuron,
Please see below the code I used to minimize the intermittently BAD lectures (intermittently BAD OPC data).
What the code does it reads each sensor at a 1 second interval. Thus if you have 3 sensors as the example below, it will take 1 second to read each sensor, thus every sensors data will only be updated every 3 seconds. Hope it makes sense.
Set Matricon OPC Explorer (OPC client) to read OPC data every 3 seconds.
Hope it helps.
code code:// **************************************************************************************************
// Includes
// **************************************************************************************************#include <OPC.h>
#include <Bridge.h>
#include <Ethernet.h>
#include <SPI.h>
#include <OneWire.h> // Tempreture sensors DS18B20
#include <DallasTemperature.h> // Tempreture sensors DS18B20
#include "DHT.h" // Humidity Sensor DHT22// **************************************************************************************************
// Create an instance
// **************************************************************************************************OPCSerial aOPC; // Declaring the OPC object
// **************************************************************************************************
// Define Pins
// **************************************************************************************************#define DHTPIN 3 // Humidity sensor
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321 (Humidity Sensor)
#define ONE_WIRE_BUS 4 // Tempreture DS18B20// **************************************************************************************************
// Define Variables
// **************************************************************************************************float CabinetteHumidity; // Humidity DHT 22
float CabinetteTemperature; // Temperature DHT 22double DuctTemperature; // Temperature DS18B20
bool ReceivedData = 0;
int CountNext = 0;
unsigned long lastTickInt=0; // Variable "Interupt"
// **************************************************************************************************
// Declaring Objects
// **************************************************************************************************OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices
DallasTemperature Sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature.
DeviceAddress DuctThermometerAddr = { 0x28, 0xB5, 0x18, 0xBD, 0x4, 0x00, 0x00, 0x22 }; // Assign the addresses of your 1-Wire temp sensors.
DHT dht(DHTPIN, DHTTYPE); // Initialize DHT sensor.// **************************************************************************************************
// Main Setup
// **************************************************************************************************void setup()
{aOPC.setup(); // OPC Object initialization
aOPC.addItem("CH_OPC",opc_read, opc_float, item_CabInturnal); // OPCItem declaration
aOPC.addItem("CT_OPC",opc_read, opc_float, item_CabInturnal); // OPCItem declaration
aOPC.addItem("DT_OPC",opc_read, opc_float, item_CabInturnal); // OPCItem declarationSerial.begin(9600); // start serial port
Sensors.setResolution(DuctThermometerAddr, 12); // set the resolution to 12 bitdht.begin(); // Humidity Sensor
}
// **************************************************************************************************
// Main Loop
// **************************************************************************************************void loop()
{
aOPC.processOPCCommands();if ( Serial.available() && ReceivedData == 0 )
{
ReceivedData = 1;
lastTickInt = millis();
}ReadIO();
WriteIO();
}
// **************************************************************************************************
// create a OPC function for the OPCItem(s) - float
// **************************************************************************************************float item_CabInturnal(const char *itemID, const opcOperation opcOP, const float value){
if (opcOP == opc_opwrite)
{}
else
{
if (!strcmp(itemID, "DT_OPC"))
{
if (Serial.available() < 1 )
{
return DuctTemperature;
}
}
else if (!strcmp(itemID, "CT_OPC"))
{
if (Serial.available() < 1 )
{
return CabinetteTemperature;
}
}
else if (!strcmp(itemID, "CH_OPC"))
{
if (Serial.available() < 1 )
{
return CabinetteHumidity;
}
}}
}// **************************************************************************************************
// create a OPC function for the OPCItem(s) - bool
// **************************************************************************************************bool item_CabControl(const char *itemID, const opcOperation opcOP, const bool value){
if (opcOP == opc_opwrite)
{}
else
{}
}// **************************************************************************************************
// Read IO
// **************************************************************************************************void ReadIO()
{switch(CountNext)
{
case 0:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
Sensors.requestTemperatures(); // Getting Temperatures
DuctTemperature = Sensors.getTempC(DuctThermometerAddr); // Reading Duct Temperature from bus
CountNext=1; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}
case 1:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CabinetteTemperature = dht.readTemperature(); // Read Cabinette Temperature
CountNext=2; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}
case 2:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CabinetteHumidity = dht.readHumidity(); // Read Cabinette Humidity
CountNext=0; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}
}}
// **************************************************************************************************
// Write IO
// **************************************************************************************************void WriteIO()
{}
26/04/2017 at 11:21 am #47540Javier Duron
MemberGood afternoon makers,
Finally I got wotking properly the OPC script with both OPC explorer and SCADA software. After doing a lot of tests, I could set the refresh interval every 2 seconds 🙂
Thank you so much An3s for being so helpful. In fact, I just adapted your code to the my sensors and added it 2 boolean items to turn on/off two leds. About this, I think that you use the “Write I/O” function on your script. Could you tell me how to do it? I got it working by creating one boolean item for each led, but I am sure that it’s posible to do it the same way as the “item_CabInturnal” function for the three sensors. Please, help me with at least one basic example and I will study it.
Here is the code. It works very good with the HMI-SCADA software. If somebody is interested in get the SCADA file, I could post it here or send it by email.
code code:// **************************************************************************************************
// Includes
// **************************************************************************************************#include <OPC.h>
#include <Bridge.h>
#include <Ethernet.h>
#include <SPI.h>
#include "DHT.h" // Humidity Sensor DHT22// **************************************************************************************************
// Create an instance
// **************************************************************************************************OPCSerial aOPC; // Declaring the OPC object
// **************************************************************************************************
// Define Pins
// **************************************************************************************************#define DHTPIN1 2 // Humidity sensor
#define DHTPIN2 7
#define DHTPIN3 11
#define DHTTYPE1 DHT11 // DHT 22 (AM2302), AM2321 (Humidity Sensor)
#define DHTTYPE2 DHT22// **************************************************************************************************
// Define Variables
// **************************************************************************************************float CH1;
float CT1;
float CH2;
float CT2;
float CH3;
float CT3;
static bool ledValue1 = false;
static bool ledValue2 = false;bool ReceivedData = 0;
int CountNext = 0;
int CountBool = 0;unsigned long lastTickInt=0; // Variable "Interupt"
int ledControl1 = 13;
int ledControl2 = 12;// **************************************************************************************************
// Declaring Objects
// **************************************************************************************************DHT dht1(DHTPIN1, DHTTYPE1); // Initialize DHT sensor.
DHT dht2(DHTPIN3, DHTTYPE1);
DHT dht3(DHTPIN2, DHTTYPE2);// **************************************************************************************************
// Main Setup
// **************************************************************************************************void setup()
{pinMode(ledControl1, OUTPUT);
pinMode(ledControl2, OUTPUT);aOPC.setup(); // OPC Object initialization
aOPC.addItem("R1_OPC",opc_readwrite, opc_bool, item_CabControl1); // OPCItem declaration
aOPC.addItem("R2_OPC",opc_readwrite, opc_bool, item_CabControl2); // OPCItem declarationaOPC.addItem("CH_OPC1",opc_read, opc_float, item_CabInturnal); // OPCItem declaration
aOPC.addItem("CT_OPC1",opc_read, opc_float, item_CabInturnal); // OPCItem declaration
aOPC.addItem("CH_OPC2",opc_read, opc_float, item_CabInturnal); // OPCItem declaration
aOPC.addItem("CT_OPC2",opc_read, opc_float, item_CabInturnal); // OPCItem declaration
aOPC.addItem("CH_OPC3",opc_read, opc_float, item_CabInturnal); // OPCItem declaration
aOPC.addItem("CT_OPC3",opc_read, opc_float, item_CabInturnal); // OPCItem declarationSerial.begin(9600); // start serial port
dht1.begin(); // Humidity Sensor
dht2.begin();
dht3.begin();}
// **************************************************************************************************
// Main Loop
// **************************************************************************************************void loop()
{
aOPC.processOPCCommands();if ( Serial.available() && ReceivedData == 0 )
{
ReceivedData = 1;
lastTickInt = millis();
}ReadIO();
WriteIO();
}
// **************************************************************************************************
// create a OPC function for the OPCItem(s) - float
// **************************************************************************************************float item_CabInturnal(const char *itemID, const opcOperation opcOP, const float value){
if (opcOP == opc_opwrite)
{}
else
{
if (!strcmp(itemID, "CT_OPC1"))
{
if (Serial.available() < 1 )
{
return CT1;
}
}
else if (!strcmp(itemID, "CH_OPC1"))
{
if (Serial.available() < 1 )
{
return CH1;
}
}
else if (!strcmp(itemID, "CT_OPC2"))
{
if (Serial.available() < 1 )
{
return CT2;
}
}
else if (!strcmp(itemID, "CH_OPC2"))
{
if (Serial.available() < 1 )
{
return CH2;
}
}
else if (!strcmp(itemID, "CT_OPC3"))
{
if (Serial.available() < 1 )
{
return CT3;
}
}
else if (!strcmp(itemID, "CH_OPC3"))
{
if (Serial.available() < 1 )
{
return CH3;
}
}}
}// **************************************************************************************************
// create a OPC function for the OPCItem(s) - bool
// **************************************************************************************************bool item_CabControl1(const char *itemID, const opcOperation opcOP, const bool value){
static bool ledValue1 = false;
delay(1);if (opcOP == opc_opwrite) {
ledValue1 = value;if (ledValue1)
digitalWrite(ledControl1, HIGH);
else
digitalWrite(ledControl1, LOW);
}
else
return ledValue1;
}//Declaracion del ledControl segun el valor de sensorOK
bool item_CabControl2(const char *itemID, const opcOperation opcOP, const bool value){
static bool ledValue2 = false;
delay(1);if (opcOP == opc_opwrite) {
ledValue2 = value;if (ledValue2)
digitalWrite(ledControl2, HIGH);
else
digitalWrite(ledControl2, LOW);
}
else
return ledValue2;
}// **************************************************************************************************
// Read IO
// **************************************************************************************************void ReadIO()
{switch(CountNext)
{
case 0:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CT1 = dht1.readTemperature();
//delay(200);
CT2 = dht2.readTemperature();
//delay(200);
CT3 = dht3.readTemperature();
CountNext = 1;
ReceivedData = 0; // Reset Data Received*/
}
}
case 1:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CH1 = dht1.readHumidity();
CH2 = dht2.readHumidity(); // Read Cabinette Temperature
CH3 = dht3.readHumidity();
CountNext=0; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}}
}
// **************************************************************************************************
// Write IO
// **************************************************************************************************void WriteIO()
{}
27/04/2017 at 8:51 pm #47541Andries Malherbe
MemberHi JDuron,
Please see updated code below. I’ve renamed the OPC items to “float item_Float” and “bool item_Bool“.
I have not tested the OPC Write function for OPCSerial but have implemented it successful with OPCEthernet.
Hoop this sample helps you.
Kind regards.
code code:// **************************************************************************************************
// Includes
// **************************************************************************************************#include <OPC.h>
#include <Bridge.h>
#include <Ethernet.h>
#include <SPI.h>
#include "DHT.h" // Humidity Sensor DHT22// **************************************************************************************************
// Create an instance
// **************************************************************************************************OPCSerial aOPC; // Declaring the OPC object
// **************************************************************************************************
// Define Pins
// **************************************************************************************************#define DHTPIN1 2 // Humidity sensor
#define DHTPIN2 7
#define DHTPIN3 11
#define DHTTYPE1 DHT11 // DHT 22 (AM2302), AM2321 (Humidity Sensor)
#define DHTTYPE2 DHT22// **************************************************************************************************
// Define Variables
// **************************************************************************************************float CH1;
float CT1;
float CH2;
float CT2;
float CH3;
float CT3;bool ReceivedData = 0;
bool ledValue1 = false;
bool ledValue2 = false;int CountNext = 0;
int CountBool = 0;
int ledControl1 = 13;
int ledControl2 = 12;unsigned long lastTickInt=0; // Variable "Interupt"
// **************************************************************************************************
// Declaring Objects
// **************************************************************************************************DHT dht1(DHTPIN1, DHTTYPE1); // Initialize DHT sensor.
DHT dht2(DHTPIN3, DHTTYPE1);
DHT dht3(DHTPIN2, DHTTYPE2);// **************************************************************************************************
// Main Setup
// **************************************************************************************************void setup()
{pinMode(ledControl1, OUTPUT);
pinMode(ledControl2, OUTPUT);aOPC.setup(); // OPC Object initialization
aOPC.addItem("R1_OPC",opc_readwrite, opc_bool, item_Bool); // OPCItem declaration
aOPC.addItem("R2_OPC",opc_readwrite, opc_bool, item_Bool); // OPCItem declarationaOPC.addItem("CH_OPC1",opc_read, opc_float, item_Float); // OPCItem declaration
aOPC.addItem("CT_OPC1",opc_read, opc_float, item_Float); // OPCItem declaration
aOPC.addItem("CH_OPC2",opc_read, opc_float, item_Float); // OPCItem declaration
aOPC.addItem("CT_OPC2",opc_read, opc_float, item_Float); // OPCItem declaration
aOPC.addItem("CH_OPC3",opc_read, opc_float, item_Float); // OPCItem declaration
aOPC.addItem("CT_OPC3",opc_read, opc_float, item_Float); // OPCItem declarationSerial.begin(9600); // start serial port
dht1.begin(); // Humidity Sensor
dht2.begin();
dht3.begin();}
// **************************************************************************************************
// Main Loop
// **************************************************************************************************void loop()
{
aOPC.processOPCCommands();if ( Serial.available() && ReceivedData == 0 )
{
ReceivedData = 1;
lastTickInt = millis();
}// PLC logic execution functionality are as follow
// 1 - Read from Input ports "void ReadIO()"
// 2 - Control programs for accessing “ControlLogic()"
// 3 - Write to Output Ports "WriteIO()"ReadIO();
ControlLogic();
WriteIO();}
// **************************************************************************************************
// create a OPC function for the OPCItem(s) - float
// **************************************************************************************************float item_Float(const char *itemID, const opcOperation opcOP, const float value){
if (opcOP == opc_opwrite)
{}
else
{
if (!strcmp(itemID, "CT_OPC1"))
{
if (Serial.available() < 1 )
{
return CT1;
}
}
else if (!strcmp(itemID, "CH_OPC1"))
{
if (Serial.available() < 1 )
{
return CH1;
}
}
else if (!strcmp(itemID, "CT_OPC2"))
{
if (Serial.available() < 1 )
{
return CT2;
}
}
else if (!strcmp(itemID, "CH_OPC2"))
{
if (Serial.available() < 1 )
{
return CH2;
}
}
else if (!strcmp(itemID, "CT_OPC3"))
{
if (Serial.available() < 1 )
{
return CT3;
}
}
else if (!strcmp(itemID, "CH_OPC3"))
{
if (Serial.available() < 1 )
{
return CH3;
}
}}
}// **************************************************************************************************
// create a OPC function for the OPCItem(s) - bool
// **************************************************************************************************bool item_Bool(const char *itemID, const opcOperation opcOP, const bool value){
if (opcOP == opc_opwrite)
{
if (!strcmp(itemID, "R1_OPC"))
{
ledValue1 = value;
}
if (!strcmp(itemID, "R2_OPC"))
{
ledValue2 = value;
}
}
else
{
if (!strcmp(itemID, "R1_OPC"))
{
if (Serial.available() < 1 )
{
return ledValue1;
}
}
if (!strcmp(itemID, "R2_OPC"))
{
if (Serial.available() < 1 )
{
return ledValue2;
}
}
}
}// **************************************************************************************************
// Read IO
// **************************************************************************************************void ReadIO()
{switch(CountNext)
{
case 0:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CT1 = dht1.readTemperature();
CountNext = 1;
ReceivedData = 0; // Reset Data Received*/
}
}
case 1:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CT2 = dht2.readTemperature();
CountNext=2; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}
case 2:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CT3 = dht3.readTemperature();
CountNext=3; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}
case 3:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CH1 = dht1.readHumidity();
CountNext=4; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}
case 4:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CH2 = dht2.readHumidity(); // Read Cabinette Temperature
CountNext=5; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}
case 5:
if (Serial.available() < 1 && ReceivedData == 1 )
{
if (millis() - lastTickInt >= 1000)
{
CH3 = dht3.readHumidity();
CountNext=0; // Load Next Case Number
ReceivedData = 0; // Reset Data Received
}
}}
}
// **************************************************************************************************
// Control Logic
// **************************************************************************************************void ControlLogic()
{
// Add control code here.}
// **************************************************************************************************
// Write IO
// **************************************************************************************************void WriteIO()
{
if (ledValue1)
{
digitalWrite(ledControl1, HIGH);
}
else
{
digitalWrite(ledControl1, LOW);
}if (ledValue2)
{
digitalWrite(ledControl2, HIGH);
}
else
{
digitalWrite(ledControl2, LOW);
}}
08/06/2017 at 8:44 pm #47551Javier Duron
MemberThanks a lot for sharing your knowledge, An3s. Finally is working perfectly.
Tomorrow I will performance a new test with the whole system assembled. While simulating it, everything worked as expected… We will see tomorrow.
I wish you all the best.
And also thanks to I.Martínez. Your great job make all this possible! Hope someday reach your programming skills.
Best regards for everyone,
Javier.
11/06/2017 at 9:58 pm #47552Andries Malherbe
MemberHi JDuron,
Glad your project is working perfectly. Keep up the good work.
Yes, and thanks to Martinez for the great software. Well engineered!!
Best regards.
-
AuthorPosts
- You must be logged in to reply to this topic.