Example of use: Switch on and off the status LED

Project

    The myEthernet has 21 pins which can be all configurated as input or as output as well as 2 LEDs which can only be used as output. Pins which are configurated as output can be switched on and off.

    In this example the green LED will be switched on and off. The LED has the pin number 20.

Required hardware

    With help of the current status of the pin is queried. If you want to change the state of the pin then you have to send a command to the myEthernet web server. This happens when you add
    , e.g. ?myChangeCmd=o20~1 at the end of the address line or via HTML link.

    If you want to add a HTML link then you have to pay attention that you have to replace the characters ~ and by the code of the character (~ = %7E, = %B0) because the myEthernet web server interprets all included text between the degree signs as replacement. A reference must e.g. look like this:

Procedure

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

    Step 2:
    Write the source code which is below in the htm-file.



    Step 3:
    Copy the file ledanaus.htm 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:
    Open a page in a web browser. Write in the address line the IP address and the name of the htm-file e.g. http://192.168.178.96/ledanaus.htm

    If you click "switch on" then the LED lights. If you click switch off then the LED go out.

Downloads

Shopping list


««« Back to 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.

myAVR Board MK3

Develop games with

XMC product line

For beginners