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
***You can buy the Watermarkd sensor directly from our [store](https://store-usa.arduino.cc/products/soil-humidity-sensor-watermark-2-m-75-cm-pack-).***
755
+
754
756
## Outputs
755
757
### Latching Outputs
756
758
@@ -872,10 +874,140 @@ Relay.off(RELAY_CH01); // this command opens the channel 1 relay contacts
872
874
```
873
875

874
876
875
-
### Power Outputs
877
+
The example code shown below closes and opens the first channel `Relay Contact` repetitively, turning on and off the connected load:
878
+
879
+
```cpp
880
+
#include"Arduino_EdgeControl.h"
881
+
882
+
// #define SSR_POLL
883
+
884
+
constexprunsignedlong onInterval = { 5000 };
885
+
constexpr unsigned long offInterval = { 5000 };
886
+
constexpr unsigned long pollInterval = { 1000 };
887
+
unsigned long offTime;
888
+
unsigned long onTime;
889
+
unsigned long pollTime;
890
+
bool on = false;
891
+
892
+
int relayChannel { RELAY_CH01 };
893
+
894
+
void setup()
895
+
{
896
+
Serial.begin(9600);
897
+
while (!Serial)
898
+
;
899
+
900
+
delay(2000);
901
+
902
+
Serial.println("Hello, SolidStateRelay!");
903
+
904
+
Power.on(PWR_3V3);
905
+
Power.on(PWR_VBAT);
906
+
907
+
Wire.begin();
908
+
Serial.print("Waiting for IO Expander Initialization...");
909
+
while (!Expander) {
910
+
Serial.print(".");
911
+
delay(100);
912
+
}
913
+
Serial.println(" done.");
914
+
Expander.pinMode(EXP_LED1, OUTPUT);
915
+
916
+
for (auto i = 0; i < 3; i++) {
917
+
Expander.digitalWrite(EXP_LED1, LOW);
918
+
delay(50);
919
+
Expander.digitalWrite(EXP_LED1, HIGH);
920
+
delay(100);
921
+
}
922
+
923
+
Relay.begin();
924
+
}
925
+
926
+
void loop()
927
+
{
928
+
if (millis() > onTime && !on) {
929
+
Serial.println("RELAY ON");
930
+
931
+
Relay.on(RELAY_CH01);
932
+
933
+
Expander.digitalWrite(EXP_LED1, LOW);
934
+
935
+
on = true;
936
+
offTime = onInterval + millis();
937
+
}
938
+
939
+
if (millis() > offTime && on) {
940
+
Serial.println("RELAY OFF");
941
+
942
+
Relay.off(RELAY_CH01);
943
+
944
+
Expander.digitalWrite(EXP_LED1, HIGH);
945
+
946
+
on = false;
947
+
onTime = millis() + offInterval;
948
+
}
949
+
950
+
#if defined(SSR_POLL)
951
+
if (millis() > pollTime && on) {
952
+
Serial.println("POLLING");
953
+
954
+
Relay.poll(relayChannel);
955
+
956
+
pollTime = millis() + pollInterval;
957
+
}
958
+
#endif
959
+
}
960
+
```
876
961
877
962
## Edge Control Enclosure Kit
878
963
964
+

965
+
966
+
Designed for industrial and smart agriculture applications, the Arduino Edge Control Enclosure Kit is the perfect companion for Arduino Edge Control. It provides the module with a sturdy case that protects it from the elements, dust, and accidental blows. It is IP40-certified and compatible with DIN rails, making it safe and easy to fit in any standard rack or cabinet.
967
+
968
+
On top of this, the Arduino Edge Control Enclosure Kit features a 2-row/16-character LCD display with white backlight and a programmable push button, so it can be customized by users to instantly visualize sensor data, such as weather conditions and soil parameters. Different data can be displayed at every push of the button, on the spot and in real time, without requiring connectivity.
969
+
970
+
### LCD Control
971
+
972
+
The functions to control the LCD are mostly the same as the ones we are used to in the Arduino ecosystem.
973
+
974
+
We need to include the `Arduino_EdgeContro.h` library and then, initialize the LCD with the `LCD.begin(16, 2)` function and start printing data on it.
975
+
976
+
With `LCD.backlight()` and `LCD.noBacklight()` we can turn on or off the LCD backlight respectively.
977
+
978
+
To define the cursor position, `LCD.setCursor(x, y)` is used, and to clear the display, `LCD.clear()`.
979
+
980
+
To display text, we use the `LCD.print(text)` function.
981
+
982
+
The example code below prints "Edge Control" in the first row and starts a seconds counter in the second one:
983
+
984
+
```cpp
985
+
#include <Arduino_EdgeControl.h>
986
+
987
+
void setup() {
988
+
989
+
// set up the LCD's number of columns and rows:
990
+
LCD.begin(16, 2);
991
+
LCD.backlight();
992
+
// Print a message to the LCD.
993
+
LCD.home(); // go home
994
+
LCD.print("Edge Control");
995
+
996
+
}
997
+
998
+
void loop() {
999
+
1000
+
LCD.setCursor(0, 1);
1001
+
LCD.print(millis() / 1000);
1002
+
delay(1000);
1003
+
}
1004
+
```
1005
+

0 commit comments