I am building a replica of the remote control that Doc Brown uses in the Film, Back To The Future.
I figured this would be a great Arduino project to try.
My goal is to turn on the unit and see 00.0 on the display. I flip a toggle switch and the Led display will count up from 00.0 to 88.0 in 8 seconds then stop at 88.0.
I am new to Arduino and have been searching the forums for helpful info on 7 segment display code.
I uploaded this:
( Arduino Playground - SevenSegmentLibrary )
to test my setup.
I tried this example code but the pin out must be different than my setup. I got a first 4 segments
to light up but that was it. also I have no idea what the code needs to be to do the 8 second count up to 88.0
Here is the pin out for the display I have:
PART NO. : UN(M)4043-13 EWRS 0.4"(10.2mm)THREE DIGIT DISPLAY
3digit 7 segment 12 pin LED (common Anode I believe?)
Digit1 - pin12
Digit2 - pin9
Digit3 - pin8
a11
b7
c4
d2
e1
f10
g5
dp3
none6
Any advice or links to info would be greatly appreciated. I have a feeling that once I see how the code works for this It will help me understand the language better for future projects.
You do know the number increases as Doc slowly pushes the joystick further and further up. Maybe you can add that in too, its certainly not difficult to do code wise.\
As far as wiring goes, each pin on the display has a number, to find which one is pin 1 (which is in one of the four corners), you need to look for either a small notch or dot, then wire it based on your values ie (a11, b7 ... dp3)
Great, you found the pin layout, now were you able to wire it and see some numbers on the display?
If you would like to move your post, you can kindly ask a moderator they can would be willing to move it. There is a little link under every reply that says Report to Moderator, click it and ask to move the post.
Or one might see your reply and move it without needing to be asked.
I figured it out!
Got the numbers to display correctly on the LED.
Now. The Code so far.
#include "SevSeg.h"
SevSeg sevseg; //Instantiate a seven segment controller object
void setup() {
byte numDigits = 3;
byte digitPins[] = {2, 3, 4};
byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13};
sevseg.begin(COMMON_ANODE, numDigits, digitPins, segmentPins);
sevseg.setBrightness(90);
}
void loop() {
static unsigned long timer = millis();
static int deciSeconds = 0;
if (millis() >= timer) {
deciSeconds++; // 100 milliSeconds is equal to 1 deciSecond
timer += 100;
if (deciSeconds == 10000) { // Reset to 0 after counting for 1000 seconds.
deciSeconds=0;
}
sevseg.setNumber(123, 1);
}
sevseg.refreshDisplay(); // Must run repeatedly
}
/// END ///
I would like to get the numbers to just count up from 00.0 to 88.0 in about 8 seconds for now.
and have it triggered by a switch. The remaining pins on the digital side of the UNO are (1, 2, and 5)
I assume I would wire the switch to one of those remaining numbers?
The code I posted above is giving me three numbers. I attached an image to that post to show it was working.
I have no coding knowledge but I am learning as I put this project together.
I have seen "loop" referenced before but I don't know where it would go. is it the void loop part of the code?
So far I have learned how to load a library example and upload it to the arduino
How to use a breadboard to wire the LED display,
How to change the sevseg.setNumber to display a 3 digit number.
Now I need help with the code I can add to count up from 0-88 in 8 seconds. Then I will take that code and figure out how to change the variables to make it count faster or slower etc.
I'm realizing I just really need someone to write the program for me so I can finish the fabrication of the prop.
I know my strengths and programming isn't one of them so I am going to post my need for a programmer in gigs and collaborations.