blynk & neopixelring & w7500
Dependencies: BlynkNeopixelW7500 Blynk_Example_WIZwiki-W7500 WIZnetInterface_ WS2812 mbed
Fork of Blynk_Example_WIZwiki-W7500 by
main.cpp@0:decc160be69d, 2017-08-02 (annotated)
- Committer:
- jcm931213
- Date:
- Wed Aug 02 02:04:39 2017 +0000
- Revision:
- 0:decc160be69d
- Child:
- 1:030843f74e27
Blynk-program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jcm931213 | 0:decc160be69d | 1 | /************************************************************* |
jcm931213 | 0:decc160be69d | 2 | Download latest Blynk library here: |
jcm931213 | 0:decc160be69d | 3 | https://github.com/blynkkk/blynk-library/releases/latest |
jcm931213 | 0:decc160be69d | 4 | Blynk is a platform with iOS and Android apps to control |
jcm931213 | 0:decc160be69d | 5 | Arduino, Raspberry Pi and the likes over the Internet. |
jcm931213 | 0:decc160be69d | 6 | You can easily build graphic interfaces for all your |
jcm931213 | 0:decc160be69d | 7 | projects by simply dragging and dropping widgets. |
jcm931213 | 0:decc160be69d | 8 | Downloads, docs, tutorials: http://www.blynk.cc |
jcm931213 | 0:decc160be69d | 9 | Sketch generator: http://examples.blynk.cc |
jcm931213 | 0:decc160be69d | 10 | Blynk community: http://community.blynk.cc |
jcm931213 | 0:decc160be69d | 11 | Social networks: http://www.fb.com/blynkapp |
jcm931213 | 0:decc160be69d | 12 | http://twitter.com/blynk_app |
jcm931213 | 0:decc160be69d | 13 | Blynk library is licensed under MIT license |
jcm931213 | 0:decc160be69d | 14 | This example code is in public domain. |
jcm931213 | 0:decc160be69d | 15 | ************************************************************* |
jcm931213 | 0:decc160be69d | 16 | This example shows how to use Arduino.org Ethernet Shield 2 (W5500) |
jcm931213 | 0:decc160be69d | 17 | to connect your project to Blynk. |
jcm931213 | 0:decc160be69d | 18 | NOTE: You may have to install Arduino.ORG IDE to get it working: |
jcm931213 | 0:decc160be69d | 19 | http://www.arduino.org/software |
jcm931213 | 0:decc160be69d | 20 | Pins 10, 11, 12 and 13 are reserved for Ethernet module. |
jcm931213 | 0:decc160be69d | 21 | DON'T use them in your sketch directly! |
jcm931213 | 0:decc160be69d | 22 | Feel free to apply it to any other example. It's simple! |
jcm931213 | 0:decc160be69d | 23 | *************************************************************/ |
jcm931213 | 0:decc160be69d | 24 | |
jcm931213 | 0:decc160be69d | 25 | /* Comment this out to disable prints and save space */ |
jcm931213 | 0:decc160be69d | 26 | #define BLYNK_PRINT Serial |
jcm931213 | 0:decc160be69d | 27 | |
jcm931213 | 0:decc160be69d | 28 | #include "mbed.h" |
jcm931213 | 0:decc160be69d | 29 | #include <SPI.h> |
jcm931213 | 0:decc160be69d | 30 | #include "EthernetInterface.h" |
jcm931213 | 0:decc160be69d | 31 | #include <BlynkSimpleEthernet2.h> |
jcm931213 | 0:decc160be69d | 32 | |
jcm931213 | 0:decc160be69d | 33 | |
jcm931213 | 0:decc160be69d | 34 | EthernetInterface eth; |
jcm931213 | 0:decc160be69d | 35 | |
jcm931213 | 0:decc160be69d | 36 | // You should get Auth Token in the Blynk App. |
jcm931213 | 0:decc160be69d | 37 | // Go to the Project Settings (nut icon). |
jcm931213 | 0:decc160be69d | 38 | char auth[] = "f6e02fba337e45f19f9c51567323ea8d"; |
jcm931213 | 0:decc160be69d | 39 | |
jcm931213 | 0:decc160be69d | 40 | |
jcm931213 | 0:decc160be69d | 41 | void setup() |
jcm931213 | 0:decc160be69d | 42 | { |
jcm931213 | 0:decc160be69d | 43 | uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0xff, 0xff, 0x25}; |
jcm931213 | 0:decc160be69d | 44 | eth.init(mac_addr); |
jcm931213 | 0:decc160be69d | 45 | eth.connect(); |
jcm931213 | 0:decc160be69d | 46 | |
jcm931213 | 0:decc160be69d | 47 | Blynk.begin(auth); |
jcm931213 | 0:decc160be69d | 48 | // You can also specify server: |
jcm931213 | 0:decc160be69d | 49 | //Blynk.begin(auth, "blynk-cloud.com", 8442); |
jcm931213 | 0:decc160be69d | 50 | //Blynk.begin(auth, IPAddress(192,168,1,100), 8442); |
jcm931213 | 0:decc160be69d | 51 | // For more options, see Boards_Ethernet/Arduino_Ethernet_Manual example |
jcm931213 | 0:decc160be69d | 52 | } |
jcm931213 | 0:decc160be69d | 53 | |
jcm931213 | 0:decc160be69d | 54 | void loop() |
jcm931213 | 0:decc160be69d | 55 | { |
jcm931213 | 0:decc160be69d | 56 | //Blynk.run(); |
jcm931213 | 0:decc160be69d | 57 | } |
jcm931213 | 0:decc160be69d | 58 | |
jcm931213 | 0:decc160be69d | 59 | int main(void) { |
jcm931213 | 0:decc160be69d | 60 | printf("Hello\r\n"); |
jcm931213 | 0:decc160be69d | 61 | setup(); |
jcm931213 | 0:decc160be69d | 62 | printf("Blynk init!\r\n"); |
jcm931213 | 0:decc160be69d | 63 | while(1){ |
jcm931213 | 0:decc160be69d | 64 | loop(); |
jcm931213 | 0:decc160be69d | 65 | } |
jcm931213 | 0:decc160be69d | 66 | } |