View Single Post
  #1   Spotlight this post!  
Unread 27-01-2016, 21:39
The Doctor's Avatar
The Doctor The Doctor is offline
Robotics is life
AKA: Hackson
FRC #3216 (MRT)
Team Role: Programmer
 
Join Date: Mar 2014
Rookie Year: 2013
Location: United States
Posts: 152
The Doctor is on a distinguished road
REV Digit Board library

I thought that now that Github is back up, I'd upload my library for driving the REV Robotics Digit Board MXP upgrade. I tested it tonight, and it can display strings and decimals optimized for battery voltage. It's by no means finalized.

https://github.com/red-green/REVDigitBoard

It was mostly based off the example code from here: http://www.chiefdelphi.com/forums/sh...d.php?t=142054

Functions implemented:

Code:
REVDigitBoard() : constructor
void display(String str) : displays the first four characters of the string (only alpha (converted to uppercase), numbers, and spaces)
void display(double batt) : displays a decimal number (like battery voltage) in the form of 12.34 (ten-one-decimal-tenth-hundredth)
void clear() : clears the display
boolean getButtonA() : button A on the board
boolean getButtonB() : button B on the board
double getPot() : potentiometer value
Example:

Code:
REVDigitBoard disp = new REVDigitBoard();
disp.clear();
disp.display("3216");
// run this repetitively to get voltage readout, assuming pdp is a PowerDistributionPanel object
disp.display(pdp.getVoltage());
I can't figure out decimal points yet, but I'll work on it. Also better documentation is coming here and on Github (assuming it's staying up).
__________________
Robots + Python + pentesting == me;
Blog ~ GitHub ~ Keybase
If you have a pressing issue to discuss with me, kik me at slush.puddles since I don't check CD very often.
Reply With Quote