PDA

View Full Version : Arduino voltage indicator



brianwilliamson
05-15-2018, 02:10 AM
I have been trying to find out how switch the colon on, but so far no luck anywhere.
If someone has a clue how to do this, I would be most grateful .

Here is the code so far :

//To display 28.3v___needs colon installed
//Using 7segments x4 & 1637 arduino UNO

#include <Arduino.h>
#include <TM1637Display.h>
// Module connection pins (Digital Pins)
#define CLK 2
#define DIO 3
// The amount of time (in milliseconds) between tests
//#define TEST_DELAY 2000
const uint8_t SEG_DONE[] = {
SEG_A | SEG_B | SEG_G | SEG_E | SEG_D, //2
SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F | SEG_G, // 8
SEG_A | SEG_B | SEG_C | SEG_D | SEG_G, // 3
SEG_E |SEG_D | SEG_C // v
};
TM1637Display display(CLK, DIO);
void setup()
{
}
void loop()
{
int k;
uint8_t data[] = { 0xff, 0xff, 0xff, 0xff };
display.setBrightness(0x0f);
// On/Off test
for(k = 0; k < 1; k++) {
display.setBrightness(2, false); // Turn off
display.setSegments(data);
display.setBrightness(2, true); // Turn on
display.setSegments(data);

}
// Done!
display.setSegments(SEG_DONE);
while(1);
}
//***************************************************

Regards..............Brian W.

iwik
05-15-2018, 03:26 AM
Brian,
Not familiar with Arduino code. Dont you just need to connect the dp to an output and then pull it high when
wanting to display it.
Les