Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SPI.h>
- #include <Ethernet.h>
- byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
- IPAddress ip(10,0,0,177);
- EthernetServer server(80);
- void setup() {
- // Open serial communications and wait for port to open:
- Serial.begin(9600);
- // SS must be output and disable any device using SS
- pinMode(53,OUTPUT);
- digitalWrite(53,HIGH); //any device on the SS pin will be disabled
- // disable w5100
- pinMode(10,OUTPUT);
- digitalWrite(10,HIGH); // disable W5100
- // disable SD
- pinMode(4,OUTPUT);
- digitalWrite(4,HIGH); // disable SD
- //Add code in function setup(), i'm success.
- pinMode(11,INPUT);
- pinMode(12,INPUT);
- pinMode(13,INPUT);
- // start the Ethernet connection and the server:
- // Try DHCP first, if that fails, try fixed ip.
- if (Ethernet.begin(mac) == 0)
- {
- Serial.println(F("DHCP failed"));
- Ethernet.begin(mac,ip);
- }
- server.begin();
- Serial.print("server is at ");
- Serial.println(Ethernet.localIP());
- }
- void loop() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement