初始化提交
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Follow us: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
Note: This requires ATtiny support package:
|
||||
https://github.com/damellis/attiny
|
||||
|
||||
Be sure to check ordinary Serial example first!!!
|
||||
|
||||
+-\/-+
|
||||
A0|6 (D 5) PB5 1| |8 Vcc
|
||||
A3|9 (D 3) PB3 2| |7 PB2 (D 2) A1|7
|
||||
A2|8 (D 4) PB4 3| |6 PB1 (D 1) pwm1
|
||||
GND 4| |5 PB0 (D 0) pwm0
|
||||
+----+
|
||||
|
||||
*************************************************************/
|
||||
|
||||
#include <SoftwareSerial.h>
|
||||
SoftwareSerial DebugSerial(1, 2); // RX, TX
|
||||
SoftwareSerial SwSerial(3, 4);
|
||||
|
||||
/* Comment this out to disable prints and save space */
|
||||
#define BLYNK_PRINT DebugSerial
|
||||
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
//#include <SoftwareServo.h>
|
||||
//SoftwareServo servo1;
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Debug console
|
||||
DebugSerial.begin(9600);
|
||||
|
||||
// Blynk will work through SoftwareSerial
|
||||
// Do not read or write this serial manually in your sketch
|
||||
SwSerial.begin(9600);
|
||||
Blynk.begin(SwSerial, auth);
|
||||
|
||||
// Sometimes you need to calibrate your ATtiny timer
|
||||
//OSCCAL = 175;
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Follow us: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
Feel free to apply it to any other example. It's simple!
|
||||
*************************************************************/
|
||||
|
||||
/* Comment this out to disable prints and save space */
|
||||
#define BLYNK_PRINT DebugSerial
|
||||
|
||||
|
||||
// You could use a spare Hardware Serial on boards that have it (like Mega)
|
||||
#include <SoftwareSerial.h>
|
||||
SoftwareSerial DebugSerial(2, 3); // RX, TX
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Debug console
|
||||
DebugSerial.begin(9600);
|
||||
|
||||
// Blynk will work through Serial
|
||||
// Do not read or write this serial manually in your sketch
|
||||
Serial.begin(9600);
|
||||
Blynk.begin(Serial, auth);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Follow us: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
Feel free to apply it to any other example. It's simple!
|
||||
*************************************************************/
|
||||
|
||||
/* Comment this out to disable prints and save space */
|
||||
#define BLYNK_PRINT Serial
|
||||
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
SoftwareSerial SwSerial(2, 3); // RX, TX
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Debug console
|
||||
Serial.begin(9600);
|
||||
|
||||
// Blynk will work through SoftwareSerial
|
||||
// Do not read or write this serial manually in your sketch
|
||||
SwSerial.begin(9600);
|
||||
Blynk.begin(SwSerial, auth);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Social networks: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
Feel free to apply it to any other example. It's simple!
|
||||
*************************************************************/
|
||||
|
||||
/* Comment this out to disable prints and save space */
|
||||
#define BLYNK_PRINT SerialUSB
|
||||
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Debug console
|
||||
SerialUSB.begin(9600);
|
||||
|
||||
// Blynk will work through Serial
|
||||
// Do not read or write this serial manually in your sketch
|
||||
Serial.begin(9600);
|
||||
Blynk.begin(Serial, auth);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Social networks: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
Note: This requires STM32duino support package:
|
||||
https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/Installation
|
||||
|
||||
Note: You may need to wait up to 30 seconds after board starts,
|
||||
to allow USB serial to initialize completely.
|
||||
|
||||
Feel free to apply it to any other example. It's simple!
|
||||
*************************************************************/
|
||||
|
||||
/* Comment this out to disable prints and save space */
|
||||
#define BLYNK_PRINT Serial1
|
||||
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Debug console
|
||||
Serial1.begin(9600);
|
||||
|
||||
// Blynk will work through Serial
|
||||
// Do not read or write this serial manually in your sketch
|
||||
Serial.begin(9600);
|
||||
Blynk.begin(Serial, auth);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Social networks: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
There is an USB issue on Linux:
|
||||
https://github.com/digistump/DigistumpArduino/issues/16
|
||||
|
||||
*************************************************************/
|
||||
|
||||
// Minimize size for non-Pro version
|
||||
#if !defined(ARDUINO_AVR_DIGISPARKPRO)
|
||||
#define BLYNK_NO_INFO
|
||||
#define BLYNK_NO_BUILTIN
|
||||
#endif
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
#include <DigiCDC.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Blynk will work through SerialUSB
|
||||
// Do not read or write this serial manually in your sketch
|
||||
SerialUSB.begin();
|
||||
Blynk.begin(SerialUSB, auth);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Social networks: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
Requires Energia IDE: http://energia.nu/download/
|
||||
|
||||
Feel free to apply it to any other example. It's simple!
|
||||
*************************************************************/
|
||||
|
||||
/* Comment this out to disable prints and save space */
|
||||
#define BLYNK_PRINT Serial1
|
||||
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Debug console
|
||||
Serial1.begin(9600);
|
||||
|
||||
// Blynk will work through Serial
|
||||
// Do not read or write this serial manually in your sketch
|
||||
Serial.begin(9600);
|
||||
Blynk.begin(Serial, auth);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Social networks: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
Feel free to apply it to any other example. It's simple!
|
||||
*************************************************************/
|
||||
|
||||
/* Comment this out to disable prints and save space */
|
||||
#define BLYNK_PRINT DebugSerial
|
||||
|
||||
// You could use a spare Hardware Serial on boards that have it (like Mega)
|
||||
#include <SoftwareSerial.h>
|
||||
SoftwareSerial DebugSerial(2, 3); // RX, TX
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Debug console
|
||||
DebugSerial.begin(9600);
|
||||
|
||||
// Blynk will work through Serial
|
||||
// Do not read or write this serial manually in your sketch
|
||||
Serial.begin(9600);
|
||||
Blynk.begin(Serial, auth);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*************************************************************
|
||||
Download latest Blynk library here:
|
||||
https://github.com/blynkkk/blynk-library/releases/latest
|
||||
|
||||
Blynk is a platform with iOS and Android apps to control
|
||||
Arduino, Raspberry Pi and the likes over the Internet.
|
||||
You can easily build graphic interfaces for all your
|
||||
projects by simply dragging and dropping widgets.
|
||||
|
||||
Downloads, docs, tutorials: http://www.blynk.cc
|
||||
Sketch generator: http://examples.blynk.cc
|
||||
Blynk community: http://community.blynk.cc
|
||||
Social networks: http://www.fb.com/blynkapp
|
||||
http://twitter.com/blynk_app
|
||||
|
||||
Blynk library is licensed under MIT license
|
||||
This example code is in public domain.
|
||||
|
||||
*************************************************************
|
||||
=>
|
||||
=> USB HOWTO: http://tiny.cc/BlynkUSB
|
||||
=>
|
||||
|
||||
Feel free to apply it to any other example. It's simple!
|
||||
*************************************************************/
|
||||
|
||||
/* Comment this out to disable prints and save space */
|
||||
#define BLYNK_PRINT Serial1
|
||||
|
||||
|
||||
#include <BlynkSimpleStream.h>
|
||||
|
||||
// You should get Auth Token in the Blynk App.
|
||||
// Go to the Project Settings (nut icon).
|
||||
char auth[] = "YourAuthToken";
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Debug prints on pins 39 (RX), 40 (TX)
|
||||
Serial1.begin(9600);
|
||||
|
||||
// Blynk will work through Serial
|
||||
// Do not read or write this serial manually in your sketch
|
||||
Serial.begin(9600);
|
||||
Blynk.begin(Serial, auth);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Blynk.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user