crey YouTubers here is the guy with a
Swiss accent again some of my viewers
ask me how can I use the next on an
esp8266 or on an arino UNO Watchers of
my video number 56 and number 59 know
that I used an Arduino Omega for my
tests because this sport has more than
one serial connector so I was able to
connect my next gen to serial 2 and use
serial for debugging very simple other
arduinos including the Uno only have one
cereal and the
esp8266 has two cereals but one is not
completely usable in this video I will
show you how to use a NextGen display
also on these platforms let's first
start with the NextGen Library it
supports two serial connections one for
the next itself and one for debugging
the definition of the two connections is
done in the file next config Doh in the
Arduino libraries folder here you can
open the file next config Doh with your
preferred text editor for this video you
find three important defines in this
file first debug cereal
enable second next cereal and third DB
cereal for the Arduino Omega we defined
debug serial enable set the next seral
to serial 2 and DB serial to serial the
next gen was then connected to serial 2
and we were able to see the debug
messages in serial monitor if you do not
Define debug serial enable or comment it
you will not get any debug messages and
can live with one serial connection I
show you this concept with an Arduino
Uno the next config Doh looks like this
we commment the Define debug cereal
enable and set the Define next cereal to
seral the DB serial does not matter
because debug serial enable is not
defined to make sure we create no
problems later we Define it to a Serial
which does not exist on this board for
Arduino Uno this is serial one or serial
2 in our sketch we also have to comment
all DB serial statements because we
defined DB serial to an unavailable
serial connection the compiler helps us
to find these statements because we get
errors if we forget to comment one of
these statements for our tests I use the
example of video number
59 I connect the next gen display to the
RX and TX pins and pay attention that I
connect RX of the Arduino to the TX of
the next gen and vice versa now I try to
upload the sketch it compiles but
unfortunately does not upload I only get
error messages why is this the heart of
our uino Uno is an 80 Mega 328 P chip
because this chip does not have a USB
connection the Uno Port contains a USB
to serial chip this chip is connected to
the two serial pins RX and TX of the
chip if we connect our next gen display
to the Uno we have to use the very same
pins because the 328p only off off this
single serial connection now we have two
conflicting informations coming to the
same pin and this screws the whole
communication up the simple solution to
this problem is to disconnect the
nection during
upload now it works perfectly after the
upload we reconnect the next display
because no signal is coming from the USB
connector the display works now as
expected if we look to the serial
monitor we even see the raw messages
coming from the display the same
scenario works also with the
esp8266 here we also connect the next to
the RX and TX pins we also have to
disconnect the nection for upload this
is what I call the productive version
which I use for my devices if they are
debugged and are used in a productive
environment in this scenario I do not
want to create any debug messages but if
our sketch does not work yet and we need
some debugging information in this case
we have to find a way to get a second
serial connection for our debugging
information for arduinos it is possible
to create a second serial connection
using the software C
library with this Library you can Define
two other pins as RX and TX for
debugging unfortunately I was not able
to get software serial working with an
action Library so the only possibility I
found was to disable the debug function
in the next gen library and create a new
serial connection directly in our sketch
and put it on pin two and three I call
this connection debug
serial now we can print some debug
messages to display the messages we have
to connect pin three to a Serial adapter
and install a small program like putty
on our computer now we can see the debug
messages in addition we still can see
the raw messages coming from the nection
in our serial monitor with this setup we
can debug our sketch how can we connect
the nection to the ESP
the
esp8266 like the Arduino mea has two
serial connections unfortunately one pin
of the second connections cannot be used
because it is connected internally to
the flash Ram but good for us it is the
RX pin which is not usable so we can
still use the TX pin to produce our
debug messages the basic setup is the
same as with the Arduino Uno we connect
the next to serial for the debug
connection we use serial 1 the tx1 pin
is either gpi2 on the esp12 modules or
D4 on the Node MCU boards and again we
have to disconnect the next gen display
during upload the next config Doh file
looks like this we keep the Define debug
serial enable and set the next cial to
serial the DB serial is now set to
serial 1 using this method we can now
use the nection displays on all our
arduinos and also on the
esp8266 thanks for watching I hope this
video was useful or at least interesting
for you bye