Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

7 segment 1.2" LED Brightness
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

7 segment 1.2" LED Brightness

by bmwflyboy on Tue Aug 18, 2020 9:27 am

I got this plugged in and working according to the directions but it doesn't seem to be very bright. I tried this from the tutorial:

"setBrightness(brighness)- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start"

but it seems I can't get that to work(prob user error). I also don't think it is starting up at level 15 brightness. I have attached a photo showing what I am seeing. Timing of the photo was in the evening so you'd think it would show even brighter for the camera exposure but it is pretty dim.

For comparison here is a link of a video with the same 7 segment display that is much brighter. Any suggestions?

https://youtu.be/nAmAzBAfGLA


1.jpg
1.jpg (973.05 KiB) Viewed 235 times
2.jpg
2.jpg (736.87 KiB) Viewed 235 times

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Re: 7 segment 1.2" LED Brightness

by adafruit_support_carter on Tue Aug 18, 2020 10:32 am

The video is of the 0.56" 7 segment display which can operate with 3V power:
https://learn.adafruit.com/adafruit-led ... uino-setup
However, the larger 1.2" 7 segment you have requires 5V power:
https://learn.adafruit.com/adafruit-led ... -and-setup

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: 7 segment 1.2" LED Brightness

by bmwflyboy on Tue Aug 18, 2020 11:30 am

Dang you are correct, it is a different one in the video. I thought it was the same. I have my display running from the 5v bus bar on the breadboard.

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Re: 7 segment 1.2" LED Brightness

by adafruit_support_carter on Tue Aug 18, 2020 11:35 am

OK, let's check your sketch and how it is setting brightness. Please post the complete code listing here.

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: 7 segment 1.2" LED Brightness

by bmwflyboy on Tue Aug 18, 2020 11:37 am

It's prob not very clean when it comes to code...I'm just trying to make it work. A lot of copy and paste....



Code: Select all | TOGGLE FULL SIZE

/***************************************************
  This is a library for our I2C LED Backpacks

  Designed specifically to work with the Adafruit LED 7-Segment backpacks
  ----> http://www.adafruit.com/products/881
  ----> http://www.adafruit.com/products/880
  ----> http://www.adafruit.com/products/879
  ----> http://www.adafruit.com/products/878

  These displays use I2C to communicate, 2 pins are required to
  interface. There are multiple selectable I2C addresses. For backpacks
  with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
  with 3 Address Select pins: 0x70 thru 0x77

  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries. 
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include <Wire.h> // Enable this line if using Arduino Uno, Mega, etc.
#include <Adafruit_GFX.h>
#include <Adafruit_LEDBackpack.h>

Adafruit_7segment matrix = Adafruit_7segment();

const int ledRed = 11;
const int ledGreen = 10;
const int buttonRed = 9;
const int buttonGreen = 8;
const int relay = 12;


int buttonStateRed = 0;
int buttonStateGreen = 0;
int brightnessRed = 0;
int brightnessGreen = 0;
int fadeAmountRed = 5;
int fadeAmountGreen = 5;



void setup() {
#ifndef __AVR_ATtiny85__
  //Serial.begin(9600);
  //Serial.println("Rocket Launcher Initializing");
#endif
  matrix.begin(0x70);
  pinMode(ledRed, OUTPUT);
  pinMode(ledGreen, OUTPUT);
  pinMode(buttonRed, INPUT);
  pinMode(buttonGreen, INPUT);
  pinMode (relay, OUTPUT);
 
 
}

void loop() {

 
  analogWrite(ledRed, brightnessRed);
  brightnessRed = brightnessRed + fadeAmountRed;
  if (brightnessRed <= 0 || brightnessRed >=255) {
    fadeAmountRed = -fadeAmountRed;
  }
    analogWrite(ledGreen, brightnessGreen);
  brightnessGreen = brightnessGreen + fadeAmountGreen;
  if (brightnessGreen <= 0 || brightnessGreen >=255) {
    fadeAmountGreen = -fadeAmountGreen;
  }
  delay(50);
  buttonStateGreen = digitalRead(buttonGreen);
  buttonStateRed = digitalRead(buttonRed);
    matrix.print(10000, DEC);
    matrix.writeDisplay();
    Serial.println(buttonStateGreen);
    Serial.println(buttonStateRed);
   
 if (buttonStateGreen == HIGH) {
    matrix.print(10, DEC);
    matrix.writeDisplay();
    digitalWrite(ledRed, HIGH);
    digitalWrite(ledGreen, HIGH);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);

  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
    digitalWrite(ledRed, LOW);
  }else{
    matrix.print(9, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, LOW);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }

  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(8, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, HIGH);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }

  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(7, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, LOW);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }

  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(6, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, HIGH);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }

  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(5, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, LOW);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }

  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(4, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, HIGH);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }

  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(3, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, LOW);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }

  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(2, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, HIGH);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }
 
  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(1, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, LOW);
    buttonStateRed = digitalRead(buttonRed);
    delay(1000);
  }
 
  if (buttonStateRed == HIGH) {
    Serial.println("ABORT!");
  }else{
    matrix.print(0, DEC);
    matrix.writeDisplay();
    digitalWrite(ledGreen, HIGH);
    digitalWrite(ledRed, LOW);
    delay(250);
    digitalWrite(relay, HIGH);
    digitalWrite(ledGreen, LOW);
    digitalWrite(ledRed, HIGH);
    delay(250);
    digitalWrite(ledGreen, HIGH);
    digitalWrite(ledRed, LOW);
    delay(250);
    digitalWrite(ledGreen, LOW);
    digitalWrite(ledRed, HIGH);
    delay(250);
    digitalWrite(ledGreen, HIGH);
    digitalWrite(ledRed, LOW);
    delay(250);
    digitalWrite(ledGreen, LOW);
    digitalWrite(ledRed, HIGH);
    delay(250);
    digitalWrite(ledGreen, HIGH);
    digitalWrite(ledRed, LOW);
    delay(250);
    digitalWrite(ledGreen, LOW);
    digitalWrite(ledRed, HIGH);
    delay(250);
    digitalWrite(ledGreen, HIGH);
    digitalWrite(ledRed, LOW);
    digitalWrite(relay, LOW);
    delay(250);
    digitalWrite(ledGreen, LOW);
    digitalWrite(ledRed, HIGH);
    delay(250);
  }
} else {}

}

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Re: 7 segment 1.2" LED Brightness

by adafruit_support_carter on Tue Aug 18, 2020 11:47 am

Looks like more going on than just the matrix. Let's focus on just that though. Try running this simple sketch:
Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_LEDBackpack.h>

Adafruit_7segment matrix = Adafruit_7segment();

void setup() {
  matrix.begin(0x70);
  matrix.setBrightness(15);
  matrix.print(0xBEEF, HEX);
  matrix.writeDisplay();
}

void loop() {
}

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: 7 segment 1.2" LED Brightness

by bmwflyboy on Tue Aug 18, 2020 12:00 pm

I will try it when I get home from work tonight and update. Thank you for the help so far.

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Re: 7 segment 1.2" LED Brightness

by bmwflyboy on Tue Aug 18, 2020 9:18 pm

So I copied just the matrix.setBrightness(15); line from your post. I tried 0 and 15. There wasn't much difference. I guess it just isn't really that bright of a display. I added two files one set at zero, the other set at fifteen. You can see a faint extra glow on the 15 around the red led's compared to the zero.
Attachments
set fifteen.jpg
set fifteen.jpg (917.05 KiB) Viewed 223 times
set zero.jpg
set zero.jpg (846.98 KiB) Viewed 223 times

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Re: 7 segment 1.2" LED Brightness

by XRAD on Tue Aug 18, 2020 9:41 pm

Try the BEEF code provided. And when you get the backpack working, check out the arduino tutorial on button state. You could just increment or decrement button state changes to do your countdown....

https://www.arduino.cc/en/Tutorial/StateChangeDetection

XRAD
 
Posts: 591
Joined: Sat Nov 19, 2016 3:28 pm

Re: 7 segment 1.2" LED Brightness

by bmwflyboy on Tue Aug 18, 2020 10:05 pm

So I tried the whole sketch that was posted and it was still really dim. Photo attached. I might look into the State Change Detection tutorial...I don't have a ton of time for these little side projects so usually once I get something working I'll just leave it alone unless I have to change it.
Attachments
beef.jpg
beef.jpg (873.77 KiB) Viewed 220 times

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Re: 7 segment 1.2" LED Brightness

by bmwflyboy on Tue Aug 18, 2020 10:08 pm

I also just noticed that going from the BEEF code to the Rocket Launcher code, the LED's get brighter (than when set to BEEF)...maybe/prob because BEEF uses more of the LEDs?

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Re: 7 segment 1.2" LED Brightness

by adafruit_support_carter on Wed Aug 19, 2020 10:56 am

Maybe it's power related. Where exactly are you sourcing the 5V power for the LED display?

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: 7 segment 1.2" LED Brightness

by bmwflyboy on Wed Aug 19, 2020 11:11 am

Just from the 5v pin on the Metro board.

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Re: 7 segment 1.2" LED Brightness

by adafruit_support_carter on Wed Aug 19, 2020 11:12 am

What is powering the Metro?

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: 7 segment 1.2" LED Brightness

by bmwflyboy on Wed Aug 19, 2020 11:15 am

The USB cable to my computer and when that isn't plugged in it is coming from a 9v battery that is plugged into the Metro with a 2.1mm plug. Either power source seems to be the same brightness on the 7 segment.

bmwflyboy
 
Posts: 15
Joined: Wed Dec 07, 2016 1:27 pm

Please be positive and constructive with your questions and comments.