SparkFun Forums 

Where electronics enthusiasts find answers.

General MicroView Support area - You have questions, find your answers here.

Moderators: Help@GeekAmmo, marcus@geekammo

By bl00p
Hello everyone,

I was just given a MicroView to play around with and I decided to build a temperature sensor. I'm using a raspberry pi to hook up the sensor too and python using pyserial to write the script to read the sensor and send it out to the MicroView. I can provide the python code if needed. My problem is with displaying it on the MicroView. My code as it stands now for some reason only displays one character at a time, for instance if the temperature is 86.1 the MicroView displays the 8 pauses then erases the 8 and displays the 6 pauses and so on and so forth. Here is the code for reference.
Code: Select all
#include <MicroView.h>

void setup() {

void loop() {
  char a;
  if (Serial.available()) {
    a =;
If I remove the setCursor function, it'll display the temperature (in full) and when it loops back it'll display the next temperature reading underneath the first one and so on and so forth. I added the setCursor function because I want the temperature to display in one spot and when it loops back replace the old one with the new reading but it doesn't seem to work. Any help would be very much appreciated. Thanks!
By scotta
You're only reading one character at a time. You should change char a to a string (or array) and then use Serial.readString(), instead of, to get all the characters sent. Instead of Serial.readString(), you could also consider using Serial.readStringUntil() or Serial.readBytesUntil() if one of them is more suitable.

You may also wish to put a uView.clear() before the uView.setCursor() or use some other means to clear the previous reading on the display.