Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   REV Digit Board library (http://www.chiefdelphi.com/forums/showthread.php?t=142675)

The Doctor 27-01-2016 21:39

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).


All times are GMT -5. The time now is 03:56.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi