아두이노를 인터넷에 연결해보자 - arduino ethernet shield 호환모듈 WIZ811MJ
Arduino/AVR/2. Arduino프로젝트 2009/06/08 13:40
2009/05/19 arduino에 사용가능한 이더넷 모듈에서 소개했던 WIZ811MJ이 도착했습니다.
blog comments powered by Disqus
사실 벌써 도착했는데 만질 시간이 없어서 못하고 있었다는...
WIZ811MJ 모델은 2.54mm 간격의 40핀으로 핀이 구성되어 있습니다. 듀얼핀이라 브레드보드에 직접은 안되네요.
아두이노와 각 핀의 연결은 위의 그림과 같이 D10~D13, 3V3, GND 6개의 핀을 연결합니다.
아두이노 두에밀라노브(데시밀라)에는 3.3v 출력이 있어서 직접 연결이 가능합니다.
WIZ811MJ는 arduino ethernet shield와 같은 칩을 사용하기 때문에 라이브러리도 호환된다는것이 최대 장점이라고 할 수 있습니다. 이미 만들어져 있는 아두이노 이더넷 라이브러리를 가져다 쓰기만 하면 됩니다. 예제까지도....
아두이노 소스는 아두이노 웹서버로 Examples/Library-Ethernet/WebServer 에 있는 예제를 사용해봤습니다.
/* * Web Server * * A simple web server that shows the value of the analog input pins. */ #includebyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; byte ip[] = { 192, 168, 0, 20 }; Server server(80); void setup() { Ethernet.begin(mac, ip); server.begin(); } void loop() { Client client = server.available(); if (client) { // an http request ends with a blank line boolean current_line_is_blank = true; while (client.connected()) { if (client.available()) { char c = client.read(); // if we've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so we can send a reply if (c == '\n' && current_line_is_blank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(); // output the value of each analog input pin for (int i = 0; i < 6; i++) { client.print("analog input "); client.print(i); client.print(" is "); client.print(analogRead(i)); client.println("
"); } break; } if (c == '\n') { // we're starting a new line current_line_is_blank = true; } else if (c != '\r') { // we've gotten a character on the current line current_line_is_blank = false; } } } // give the web browser time to receive the data delay(1); client.stop(); } }
소스의 빨간색부분을 공유기의 IP 수동할당에 추가하고, 오른쪽에 추가버튼을 누르면 왼쪽에 추가 됩니다.
이제 아두이노에 달린 날개를 잘 활용하는 일만 남았네요. ^^
'Arduino/AVR > 2. Arduino프로젝트' 카테고리의 다른 글
| 소리 감지를 위한 마이크 센서(앰프) 회로들(mic, sound sensor) (0) | 2009/07/14 |
|---|---|
| processing을 이용한 아두이노 오실로스코프(oscilloscope) (0) | 2009/06/18 |
| 아두이노를 인터넷에 연결해보자 - arduino ethernet shield 호환모듈 WIZ811MJ (1) | 2009/06/08 |
| 아두이노(arduino)를 이용한 도트매트릭스(dotmatrix 8x8 2색) (15) | 2009/06/03 |
| 아두이노(arduino)를 이용한 자전거 속도계 (8) | 2009/05/10 |
| arduino 전압계 (0) | 2009/05/04 |



