Hello world demo for WizFi250.

Dependencies:   WizFi250Interface mbed

This is hello world example for using WizFi250 with WIZwiki-W7500.

Hardware Connection

https://c1.staticflickr.com/1/321/18975716130_930024d665_z.jpg

/media/uploads/kaizen/20150731_083704.png

Run WizFi250-HelloWorld Program

WizFi250 library what you can use for mbed platform is already made by me. So I think you can use Wi-Fi module(WizFi250) on mbed platform without another work.

Source Code

You have to change the SSID and PASS value at source code in your web compiler.

WizFi250 hello world

#include <stdio.h>
#include "mbed.h"
#include "WizFi250Interface.h"

#define SECURE WizFi250::SEC_AUTO
#define SSID "ssid"
#define PASS "key"

#if defined(TARGET_WIZwiki_W7500)
    WizFi250Interface wizfi250(D1,D0,D7,D8,PA_12,NC,115200);
    Serial pc(USBTX, USBRX);
#endif

/**
 *  \brief Hello World
 *  \param none
 *  \return int
 */
int main()
{
    pc.baud(115200);

    printf("WizFi250 Hello World demo. \r\n");
    wizfi250.init();
    if ( wizfi250.connect(SECURE, SSID, PASS))      return -1;
    printf("IP Address is %s\r\n", wizfi250.getIPAddress());

    wizfi250.disconnect();
}

Result in serial terminal

After modifying the source code, you can compile this example on your web compiler, if you push “Ctrl+D” then if you download it to WIZwiki-W7500, You can show the result on Serial Terminal as below.(Serial Baudrate is 115200)

/media/uploads/kaizen/20150731_084054.png

For more detailed information, refer to this url.

http://www.life4iot.com/2015/06/30/wizfi250-hello-world-demo-on-wizwiki-w7500-of-mbed-platform/?lang=en

Committer:
kaizen
Date:
Fri Jun 26 04:21:51 2015 +0000
Revision:
1:cf22fab61838
Parent:
0:60014db244db
Child:
3:2f7c0c22a4fd
changed ssid and key to default value.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kaizen 0:60014db244db 1 /*
kaizen 0:60014db244db 2 * Copyright (C) 2015 Wiznet, MIT License
kaizen 0:60014db244db 3 *
kaizen 0:60014db244db 4 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
kaizen 0:60014db244db 5 * and associated documentation files (the "Software"), to deal in the Software without restriction,
kaizen 0:60014db244db 6 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
kaizen 0:60014db244db 7 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
kaizen 0:60014db244db 8 * furnished to do so, subject to the following conditions:
kaizen 0:60014db244db 9 *
kaizen 0:60014db244db 10 * The above copyright notice and this permission notice shall be included in all copies or
kaizen 0:60014db244db 11 * substantial portions of the Software.
kaizen 0:60014db244db 12 *
kaizen 0:60014db244db 13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
kaizen 0:60014db244db 14 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
kaizen 0:60014db244db 15 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
kaizen 0:60014db244db 16 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
kaizen 0:60014db244db 17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
kaizen 0:60014db244db 18 */
kaizen 0:60014db244db 19
kaizen 0:60014db244db 20 #include <stdio.h>
kaizen 0:60014db244db 21 #include "mbed.h"
kaizen 0:60014db244db 22 #include "WizFi250Interface.h"
kaizen 0:60014db244db 23
kaizen 0:60014db244db 24
kaizen 0:60014db244db 25 #define SECURE WizFi250::SEC_AUTO
kaizen 1:cf22fab61838 26 #define SSID "ssid"
kaizen 1:cf22fab61838 27 #define PASS "key"
kaizen 0:60014db244db 28
kaizen 0:60014db244db 29 #if defined(TARGET_WIZwiki_W7500)
kaizen 0:60014db244db 30 WizFi250Interface wizfi250(D1,D0,D7,D8,PA_12,NC,115200);
kaizen 0:60014db244db 31 Serial pc(USBTX, USBRX);
kaizen 0:60014db244db 32 #endif
kaizen 0:60014db244db 33
kaizen 0:60014db244db 34
kaizen 0:60014db244db 35 /**
kaizen 0:60014db244db 36 * \brief Hello World
kaizen 0:60014db244db 37 * \param none
kaizen 0:60014db244db 38 * \return int
kaizen 0:60014db244db 39 */
kaizen 0:60014db244db 40 int main()
kaizen 0:60014db244db 41 {
kaizen 0:60014db244db 42 pc.baud(115200);
kaizen 0:60014db244db 43
kaizen 0:60014db244db 44 printf("WizFi250 Hello World demo. \r\n");
kaizen 0:60014db244db 45 wizfi250.init();
kaizen 0:60014db244db 46 if ( wizfi250.connect(SECURE, SSID, PASS)) return -1;
kaizen 0:60014db244db 47 printf("IP Address is %s\r\n", wizfi250.getIPAddress());
kaizen 0:60014db244db 48
kaizen 0:60014db244db 49 wizfi250.disconnect();
kaizen 0:60014db244db 50 }