Open up a web browser on the PC and type the IP address into the URL field that you entered into the WebServer sketch (10.0.0.12 in the video, if you have problems, then try the format using the IP address that you chose). On Windows computers, it may be necessary to push the reset button on the Ethernet shield after loading the sketch. This can be changed in this line of code: The MAC address should also be changed in the sketch to the numbers found on the sticker on the bottom side of the Ethernet shield. Now change the IP address in the sketch found at this line of code: In the Arduino IDE, open the WebServer example program found under File → Examples → Ethernet → WebServer In the video, the IP address of the PC is found to be 10.0.0.6 – this means that we must choose an IP address for the Arduino that has the value of 10.0.0.x, where x is a number that is not used on the network, e.g. To find the IP address of a Linux computer, enter the following at the command line: In the Network Connection Details dialog box that pops up, the IP address of the PC can be found next to IPv4 Address. Now click Local Area Connection and then Details. You may first need to click the small 'up arrow' for the network icon to be displayed (as shown in the video).Īfter clicking the Internet Access icon, click Open Network and Sharing Center in the box that pops up. In Windows 7, click the Internet Access icon on the bottom Windows bar. The Arduino will then be assigned an address within this range which will allow a web browser on the PC to connect to the Arduino web server. The address range that the PC is using must be determined. These values are updated every 5 seconds. The web browser then connects to the Arduino web server, and the values of the Arduino analog pins are displayed. The WebServer sketch is then modified to use a different IP address, but in the same range as the PC.Īfter loading the sketch to the Arduino, the IP address used in the sketch is entered into the URL field of the web browser. The WebServer sketch configures the Arduino / Ethernet shield as a tiny web server that serves up a web page containing the values of the Arduino analog pins.įirst the IP address of the PC is found. The video below shows how to load the built in WebServer example sketch to test the Ethernet shield. the two connectors are wired one-to-one (no wires in the cable are crossed over). The Ethernet cable used to connect the Ethernet shield to the router is the straight through type, i.e. a spare Ethernet port on a ADSL router that the PC that will be used to connect to the Ethernet shield is also plugged into). The other end of the Ethernet cable is plugged into a router (e.g. Finally the Ethernet cable is plugged into the Ethernet connector on the board.Īs an Amazon Associate I earn from qualifying purchases: Ethernet Cable Connection Power is then supplied to the two boards via a USB cable. This video shows how to plug the Ethernet shield into an Arduino Uno board.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |