- Why do we need this Blynk_Teensy library
- Changelog
- Prerequisites
- Installation
- How to use
- Examples
- Sample code
- Troubleshooting
- Issues
- TO DO
- DONE
- Contributions and Thanks
- Contributing
- License
- Copyright
Why do we need this Blynk_Teensy library
To enable Blynk support of Teensy boards, especially latest Teensy 4.1/4.0
Arduino IDE 1.8.19+
for Arduino.Blynk library 1.0.1+
. .Teensy core 1.56
for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC) boards.
The suggested way to install is to:
The best way is to use Arduino Library Manager
. Search for Blynk_Teensy
, then select / install the latest version. You can also use this link for more detailed instructions.
Then copy BlynkDetectDevice.h to folder ~/Arduino/libraries/Blynk/src/Blynk to overwrite the original file BlynkDetectDevice.h
.
- Navigate to Blynk_Teensy page.
- Download the latest release
Blynk_Teensy-master.zip
. - Extract the zip file to
Blynk_Teensy-master
directory - Copy whole
Blynk_Teensy-master/src
folder to Arduino libraries' directory such as~/Arduino/libraries/
.
The file BlynkSimpleShieldEsp8266_Teensy.h must be placed in Blynk libraries src
directory (normally ~/Arduino/libraries/Blynk/src
).
Then copy BlynkDetectDevice.h to folder ~/Arduino/libraries/Blynk/src/Blynk to overwrite the original file BlynkDetectDevice.h
. By doing this, the correct board type can be displayed correctly along with Blynk logo as follows:
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.6.1 on Teensy 4.1/4.0
not just unknown Arduino board type:
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.6.1 on Arduino
- Install VS Code
- Install PlatformIO
- Install Blynk_Teensy library by using Library Manager. Search for Blynk_Teensy in Platform.io Author's Libraries
- Please visit documentation for the other options and examples at Project Configuration File
In your code, just replace
BlynkSimpleShieldEsp8266.h
withBlynkSimpleShieldEsp8266_Teensy.h
That's it.
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
// You could use a spare Hardware Serial on boards that have it (like Mega)
#define HWSERIAL Serial2 // Pin RX2 : 7, TX2 : 8 for Teensy 4.0
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266_Teensy.h>
String cloudBlynkServer = "account.duckdns.org";
#define BLYNK_SERVER_HARDWARE_PORT 8080
char auth[] = "your-token";
#define SSID_MAX_LEN 32
#define PASS_MAX_LEN 64
// Your WiFi credentials.
char ssid[] = "ssid";
char pass[] = "pass";
#define EspSerial Serial2 //Serial2, Pin RX2 : 7, TX2 : 8
// Your Teensy <-> ESP8266 baud rate:
#define ESP8266_BAUD 115200
ESP8266 wifi(&EspSerial);
void setup()
{
// Debug console
Serial.begin(115200);
delay(1000);
Serial.println("\nStart Teensy 4.0");
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Serial.println("Start Blynk");
Blynk.begin(auth, wifi, ssid, pass, cloudBlynkServer.c_str(), BLYNK_SERVER_HARDWARE_PORT);
}
void loop()
{
Blynk.run();
}
and this is the terminal debug output when running the example
Start Teensy 4.0
Start Blynk
[1310]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.6.1 on Teensy 4.0
[1310] Connecting to HueNet1
[7876] AT version:0.40.0.0(Aug 8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04
OK
[15448] IP = 192.168.2.107
+CIFSR:STAMAC,5c:cf:7f:66:05:d2
[15448] Connected to WiFi
[25601] Ready (ping: 14ms).
Submit issues to: Blynk_Teensy issues
- Same features for other shields such as WiFi, Ethernet, BT/BLE, GSM/GPRS.
- Basic support for Teensy
Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.
If you want to contribute to this project:
- Report bugs and errors
- Ask for enhancements
- Create issues and pull requests
- Tell other people about this library
- The library is licensed under MIT
Copyright 2020- Khoi Hoang