Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Detect if Serial1 and Serial2 are defined, at compile time

HardwareSerial.h in Arduino AVR boards core defines HAVE_HWSERIALX

example

#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

Tags:

C Preprocessor

Serial

Related

What will happen if I set ARef to 3.3V and try to use adc connected to 5V NodeMCU - Vin pin as 5V output? Can't upload to my Nano after updating to Arduino AVR Boards 1.6.21 Can Arduino control 8 solenoids? Use LoLin V3 pins starting with 'S' in Arduino memory usage "dos and don'ts" Can I force Arduino not to be powered by USB? softwareserial between arduino uno and esp8266 How to get the firmware (hex) file from a .ino file containing the code "Stand-alone" serial monitor When Raspberry Pi is preferred over Arduino delay(time); vs if(millis()-previous>time); and drift

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy