Skip to content

Commit bf2dab4

Browse files
committed
Developed Arduino Ethernet MQTT subsriber and display for Arduino Ethernet with Adadfruit LCD shield
1 parent b2da4d9 commit bf2dab4

File tree

72 files changed

+1607
-3226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1607
-3226
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Arduino_Ethernet_DHCP_and_LCD_display/Arduino_Ethernet_DHCP_and_LCD_display.ino

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,23 @@ void setup() {
3131

3232
// set up the LCD's number of columns and rows:
3333
lcd.begin(16, 2);
34+
lcd.setBacklight(RED);
3435

3536
randomSeed(analogRead(0));
36-
}
3737

38-
void loop() {
39-
// set random MaAC
38+
// set random MAC
4039
for (byte i = 1; i < 6; ++i) {
4140
mac[i] = random(0,255);
4241
}
4342

44-
Serial.println("DHCP...");
45-
Serial.print("MAC: ");
46-
for (byte i = 0; i < 6; ++i) {
47-
Serial.print(mac[i], HEX);
48-
if (i < 5)
49-
Serial.print(':');
50-
}
51-
Serial.println();
43+
// Serial.println("DHCP...");
44+
// Serial.print("MAC: ");
45+
// for (byte i = 0; i < 6; ++i) {
46+
//Serial.print(mac[i], HEX);
47+
//if (i < 5)
48+
//Serial.print(':');
49+
//}
50+
//Serial.println();
5251

5352
lcd.clear();
5453
lcd.setCursor(0, 0);
@@ -61,31 +60,21 @@ void loop() {
6160
}
6261

6362
// start the Ethernet connection:
64-
if (Ethernet.begin(mac) == 0) {
63+
while (Ethernet.begin(mac) == 0) {
6564
Serial.println("Failed to configure Ethernet using DHCP");
6665
lcd.clear();
6766
lcd.setCursor(0, 0);
6867
lcd.print("DHCP failed");
69-
delay(2500);
68+
delay(2500);
7069
} else {
71-
// print your local IP address:
72-
Serial.print("My IP address: ");
73-
lcd.clear();
74-
lcd.setCursor(0, 0);
75-
lcd.print("My IP address: ");
76-
lcd.setCursor(0, 1);
77-
for (byte thisByte = 0; thisByte < 4; thisByte++) {
78-
// print the value of each byte of the IP address:
79-
Serial.print(Ethernet.localIP()[thisByte], DEC);
80-
lcd.print(Ethernet.localIP()[thisByte], DEC);
81-
if (thisByte < 3) {
82-
Serial.print(".");
83-
lcd.print(".");
84-
}
85-
}
86-
Serial.println();
87-
}
88-
delay(5000);
70+
71+
// print your local IP address:
72+
// Serial.print("My IP address: ");
73+
74+
75+
void loop () {
76+
8977
}
9078

9179

80+

libraries/.DS_Store

0 Bytes
Binary file not shown.

libraries/AQERF_Base/AQERF_Base.cpp

Lines changed: 0 additions & 193 deletions
This file was deleted.

libraries/AQERF_Base/AQERF_Base.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)