Debugging your code can be tricky, and that Serial.print() comes in very handy. Unfortunately, you can't always connect your robot to your PC, because the cable is heavy and limited in length. A bluetooth or wifi module may help, but setting it all up is a pain. And adding a display to your robot makes the code that you were supposed to debug even more complex, not to mention the resources it takes.
To solve that, I made this simple serial terminal. It's just a Nokia display and an Arduino Pro Mini, all soldered together to form a compact little device. You connect it to your robot's serial, and can immediately see what is happening in its brains.
While this project pretty much works and serves its purpose, it's not the most ergonomic design on earth. So I decided to make an even smaller version, this time with a more thought out user interface. I called it #Nano TTY, because it's even smaller than the Micro TTY here. It uses pretty much the same idea, but has an OLED screen for display and a rotary encoder for scrolling.
A few lines of code later I have a nice 64-line buffer that I can scroll through using the buttons. I can scroll by line and by page, and I can also pause collecting data, and start it again.
So far, the buttons don't really do anything useful -- they send "Button n" over the serial. But that is going to change in the future software updates.
This tiny screen is really too small to see all the information that you need, so I will need to add a scroll buffer to this device, and then I can use the buttons to scroll the output.
Fun project. Just built one, and hit a couple of stumbling blocks that I write up to slightly different hardware.
I had to jumper VCC straight to the screen -- the (cheap, clone) Arduino mini that I was using didn't have enough juice to power the screen through the GPIOs.
I also had to tweak the contrast setting -- to 50 -- to get anything visible on the screen.
Finally, I needed to add a display.clearDisplay() into the display_buffer() function, just after setting the cursor position. Otherwise, it was overwriting lines all the time.
I haven't added buttons yet, because I'm thinking of putting the whole thing in a case, but so far, so good! Cool toy.
Great to hear you build it too. To be honest, I didn't even think about the current on the VCC, I just tried and it worked, so I left it that way. Mine is also a cheap clone, but apparently it happens to have a better voltage regulator. The contrast setting also depends on the light, etc. -- again, I used what worked for me. No idea why you had to clear the screen, each line should clear what was there before...
Having a case and putting buttons on the side would probably help a lot, right now they are pretty hard to use. Also, using a screen with higher resolution for more lines at once... Maybe some day.
Fun project. Just built one, and hit a couple of stumbling blocks that I write up to slightly different hardware.
I had to jumper VCC straight to the screen -- the (cheap, clone) Arduino mini that I was using didn't have enough juice to power the screen through the GPIOs.
I also had to tweak the contrast setting -- to 50 -- to get anything visible on the screen.
Finally, I needed to add a display.clearDisplay() into the display_buffer() function, just after setting the cursor position. Otherwise, it was overwriting lines all the time.
I haven't added buttons yet, because I'm thinking of putting the whole thing in a case, but so far, so good! Cool toy.