제조사 | OEM |
---|---|
브랜드 | 에듀이노 |
판매가 | 11,000원 |
적립금 | 110원 |
자체상품코드 | D-2 |
상품요약정보 | ENC28J60 |
국내·해외배송 | 국내배송 |
배송방법 | 택배 |
수량 |
COMMENT |
(최소주문수량 1개 이상 / 최대주문수량 0개 이하)
사이즈 가이드현재 상품과 관련된 상품들입니다. 함께 구매해보세요^^
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #include <EtherCard.h> //0은 DHCP, 1은 Static으로 설정 #define STATIC 0 // set to 1 to disable DHCP (adjust myip/gwip values below) //Static IP 일 경우 설정 #if STATIC // ethernet interface ip address static byte myip[] = { 192,168,0,6 }; // gateway ip address static byte gwip[] = { 192,168,0,204 }; #endif // ethernet mac address - must be unique on your network static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; byte Ethernet::buffer[500]; // tcp/ip send and receive buffer //요청이 왔을 경우 뿌려줄 HTML 소스 const char page[] PROGMEM = "HTTP/1.0 503 Service Unavailable\r\n" "Content-Type: text/html\r\n" "Retry-After: 600\r\n" "\r\n" "<html>" "<head><title>" "Ethernet Module Test_EDUINO" "</title></head>" "<body>" "<h3>Eduino Ethernet Module Test</h3>" "<p><em>" "Let's Play With Arduino<br />" "</em></p>" "</body>" "</html>" ; void setup(){ Serial.begin(57600); Serial.println("\n[backSoon]"); if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) Serial.println( "Failed to access Ethernet controller"); #if STATIC ether.staticSetup(myip, gwip); #else if (!ether.dhcpSetup()) Serial.println("DHCP failed"); #endif ether.printIp("IP: ", ether.myip); ether.printIp("GW: ", ether.gwip); ether.printIp("DNS: ", ether.dnsip); } #define STATIC 0 // set to 1 to disable DHCP (adjust myip/gwip values below) void loop(){ //웹브라우저의 요청이 들어왔을 경우 page 의 내용을 보내줌 // wait for an incoming TCP packet, but ignore its contents if (ether.packetLoop(ether.packetReceive())) { memcpy_P(ether.tcpOffset(), page, sizeof page); ether.httpServerReply(sizeof page - 1); } } | cs |
상품에 대해 궁금한 점을 해결해 드립니다.
글읽기 권한이 없습니다.
"19세 미만의 미성년자"는 출입을 금합니다!
no | category | title | write | date | hit |
---|---|---|---|---|---|
2 | 모듈 2개 연결도 가능한가요? [1] | 심정용 | 2023-01-18 | 6 | |
1 | 온습도센서로 측정한 내용을 웹페이지에서 볼 수 있는 코드를 만드는데 도와주세요 [2] | 기린 | 2021-07-31 | 479 |