Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Enable Blynk support of Teensy boards, especially latest Teensy 4.0, using WiFi, Ethernet, BT/BLE and GSM/GPRS shield

License

NotificationsYou must be signed in to change notification settings

khoih-prog/Blynk_Teensy

Repository files navigation

arduino-library-badgeGitHub releaseGitHubcontributions welcomeGitHub issues



Table of Contents



Why do we need thisBlynk_Teensy library

Features

To enable Blynk support of Teensy boards, especially latest Teensy 4.1/4.0



Prerequisites

  1. Arduino IDE 1.8.19+ for Arduino.GitHub release
  2. Blynk library 1.0.1+.Latest release.
  3. Teensy core 1.56 for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC) boards.

Installation

The suggested way to install is to:

Use Arduino Library Manager

The best way is to useArduino Library Manager. Search forBlynk_Teensy, then select / install the latest version. You can also use this linkarduino-library-badge for more detailed instructions.

Then copyBlynkDetectDevice.h to folder ~/Arduino/libraries/Blynk/src/Blynk to overwrite the original fileBlynkDetectDevice.h.

Manual Install

  1. Navigate toBlynk_Teensy page.
  2. Download the latest releaseBlynk_Teensy-master.zip.
  3. Extract the zip file toBlynk_Teensy-master directory
  4. 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 librariessrc directory (normally~/Arduino/libraries/Blynk/src).

Then copyBlynkDetectDevice.h to folder ~/Arduino/libraries/Blynk/src/Blynk to overwrite the original fileBlynkDetectDevice.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

VS Code & PlatformIO:

  1. InstallVS Code
  2. InstallPlatformIO
  3. InstallBlynk_Teensy library by usingLibrary Manager. Search forBlynk_Teensy inPlatform.io Author's Libraries
  4. Please visit documentation for the other options and examples atProject Configuration File


How to use

In your code, just replace

  1. BlynkSimpleShieldEsp8266.h withBlynkSimpleShieldEsp8266_Teensy.h

That's it.


Examples

  1. Teensy40_ESP8266Shield
  2. Teensy40_Serial_USB

Sample code

/* Comment this out to disable prints and save space*/#defineBLYNK_PRINT Serial// You could use a spare Hardware Serial on boards that have it (like Mega)#defineHWSERIAL        Serial2// Pin RX2 : 7, TX2 : 8 for Teensy 4.0#include<ESP8266_Lib.h>#include<BlynkSimpleShieldEsp8266_Teensy.h>String cloudBlynkServer ="account.duckdns.org";#defineBLYNK_SERVER_HARDWARE_PORT8080char auth[] ="your-token";#defineSSID_MAX_LEN32#definePASS_MAX_LEN64// Your WiFi credentials.char ssid[] ="ssid";char pass[] ="pass";#defineEspSerial Serial2//Serial2, Pin RX2 : 7, TX2 : 8// Your Teensy <-> ESP8266 baud rate:#defineESP8266_BAUD115200ESP8266wifi(&EspSerial);voidsetup() {// 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);}voidloop(){  Blynk.run();}

and this is the terminal debug output when running the example

Start Teensy 4.0Start 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.0Ai-Thinker Technology Co.,Ltd.Build:1.3.0.2 Sep 11 2015 11:48:04OK[15448] IP = 192.168.2.107+CIFSR:STAMAC,5c:cf:7f:66:05:d2[15448] Connected to WiFi[25601] Ready (ping: 14ms).


Issues

Submit issues to:Blynk_Teensy issues


TO DO

  1. Same features for other shields such as WiFi, Ethernet, BT/BLE, GSM/GPRS.

DONE

  1. Basic support for Teensy


Contributions and Thanks

Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.


Contributing

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

License

  • The library is licensed underMIT

Copyright

Copyright 2020- Khoi Hoang


[8]ページ先頭

©2009-2025 Movatter.jp