Example of use myEthernet: Request button pressed


    In this example the myEthernet is connected to a myAVR Board MK2 USB. It is analysed if a button is pressed or not.
    The command is replaced by the condition of the selected pins. Depending on the configuration of pins, different values are shown.

    Pin13 on the myEthernet relates to PORT C.1 on the myAVR Board MK2 USB. Is the pin e.g. configured as digital input

Required hardware

    then only 0 or 1 can be outputted. By configurations as analogue input values from 0 to 1024.


    This example refers to the "Example of use myEthernet: Pin configuration". We recommend you to look at first to the "Example of use myEthernet: Pin configuration" .


    Step 1:
    Create a HTM-file with the name button.htm.

    Step 2:
    Write the following source code in the HTM-file.

    Step 3:
    Copy the file on the microSD-card.
    Step 4:
    Insert the microSD-card in the myEthernet, connect the power supply on the myEthernet and connect it via the network cable with a PC.

    Step 5:
    Connect the myEthernet with the myAVR Board MK2 USB like it is shown in the picture and put a cable from button 1 to port C.1. After that connect the myAVR Board MK2 USB via a usb cable with the PC.

    Step 6:
    Configure pin13 as analogue input. This is explained more detailed in the "Example of use myEthernet: Pin configuration".

    Step 7:
    Open the created HTM-page in a web browser. Write in the address line the IP address and the name of the htm-file e.g.
    On the page you see if the button is pressed. If so then you see a 0. Is the button not pressed then you see a 1.


Shopping list:

««« Back to the picture gallery  

Our regional partners

Business partner wanted!

To expand our sales area we are looking for partners to represent our products and interests of the Laser & Co. Solutions GmbH.

XMC product line

mySmartUSB MK2

For beginners