doorbell v3
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
DFRobotDFPlayerMini dfPlayer;
|
||||
int volume = 22;
|
||||
|
||||
byte mac[] = { 0x02, 0x60, 0x0D, 0xF0, 0x0D, 0x04 };
|
||||
//byte mac[] = { 0x02, 0x60, 0x0D, 0xF0, 0x0D, 0x04 };
|
||||
byte mac[] = { 0x80, 0x7d, 0x3a, 0x66, 0xd1, 0x62 };
|
||||
IPAddress ip(192, 168, 178, 60);
|
||||
EthernetServer server(80);
|
||||
|
||||
@@ -30,11 +31,20 @@ void setup() {
|
||||
Serial.println();
|
||||
Serial.println("Starting server");
|
||||
|
||||
Serial1.begin(9600);// TX liegt auf Pin D4 RX geht nicht !!
|
||||
dfPlayer.begin(Serial1);
|
||||
delay(100);
|
||||
dfPlayer.setTimeOut(500); // Set serial communication time out 500ms
|
||||
dfPlayer.volume(volume); // Set volume value (0~30).
|
||||
dfPlayer.EQ(DFPLAYER_EQ_NORMAL);
|
||||
dfPlayer.outputDevice(DFPLAYER_DEVICE_SD);
|
||||
|
||||
Ethernet.init(5); // W5500 CS PIN auf D1
|
||||
Ethernet.begin(mac, ip);
|
||||
|
||||
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
|
||||
Serial.println("Ethernet shield not found");
|
||||
dfPlayer.play(3);
|
||||
while (true) {
|
||||
delay(5000);
|
||||
}
|
||||
@@ -45,19 +55,10 @@ void setup() {
|
||||
delay(5000);
|
||||
}
|
||||
|
||||
Serial1.begin(9600);// TX liegt auf Pin D4 RX geht nicht !!
|
||||
|
||||
dfPlayer.begin(Serial1);
|
||||
delay(100);
|
||||
dfPlayer.setTimeOut(500); // Set serial communication time out 500ms
|
||||
dfPlayer.volume(volume); // Set volume value (0~30).
|
||||
dfPlayer.EQ(DFPLAYER_EQ_NORMAL);
|
||||
dfPlayer.outputDevice(DFPLAYER_DEVICE_SD);
|
||||
dfPlayer.play(2);
|
||||
|
||||
server.begin();
|
||||
Serial.println(Ethernet.localIP());
|
||||
|
||||
dfPlayer.play(2);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Reference in New Issue
Block a user