Hi all,
My original problem arose when I added widget code to DS18B20 demo code. The Serial Monitor started showing garbage. Testing the Microview demos with Serial Monitor added produced mixed results, until I noticed that the placement of the Serial.begin in Setup made a difference.
Placing it before the uView.begin() is a problem, placing it after is OK!!
I’m not an expert programmer, but I’m guessing that uView.begin() is messing up interrupts or timers.
Sample code based on the Cube demo is here (paste the setup() and loop() into the original):
/******************************************************************************
MicroViewCube.ino
Rotating a 3-D Cube on the MicroView Display
Jim Lindblom @ SparkFun Electronics
Original Creation Date: June 9, 2014
*/
#include <MicroView.h>
// code cut for brevity
void setup()
{
Serial.begin(9600); // Serial.begin here causes garbage in Serial Monitor
uView.begin();
uView.clear(ALL);
uView.display();
// Serial.begin(9600); // Serial.begin here and Serial Monitor is OK
}
void loop()
{
drawCube();
delay(ROTATION_SPEED);
Serial.println("hmmm ");
}
// Draw cube removed... paste the setup() and loop() into the original MicroViewCube demo