Pages: [1]   Go Down
Author Topic: Project 003 Seven segments flip dot display  (Read 951 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a 7 segments display from alpha zeta, a very cool item.
I have an Uno with all the pins as outputs (2 coils for each segment, so 14 coils to drive).
2 and half L293 to improve amps.
1 pot for speed from 1 to 10 Hz

http://www.gueniffey.com/DSCN5259.JPG

And a video:

http://www.gueniffey.com/DSCN5261.AVI
The noise is the autofocus of the camera, the only noise from the display is a "clic/clic...." each time a dot is flip on or off.

With some multiplexers you may drive as much display as you want.

Here is the code :

Code:
/*
Pilotage de l'afficheur 7 segments A, B, C, D, E, F et G
Réglage de la vitesse par potentiomètre sur Analog 0

A on si pin 0  1 et pin 1 à 0
B on si pin 2 à 1 et pin 3 à 0
C on si pin 4 à 1 et pin 5 à 0
D on si pin 6 à 1 et pin 7 à 0
....

A off si pin 0  0 et pin 1 à 1
B off si pin 2 à 0 et pin 3 à 1
C off si pin 4 à 0 et pin 5 à 1
D off si pin 6 à 0 et pin 7 à 1
....

Disposition des segments:
        A
      F   B
        G
      E   C
        D

*/
int temps=1;  //temps d'impulsion

/*
la séquence représente les chiffres de 0 à 9, chaque combinaison indique
les segments à mettre à 1 dans l'ordre ABCDEFG
*/

int sequence[] = {
  B1111110,
  B0110000,
  B1101101,
  B1111001,
  B0110011,
  B1011011,
  B1011111,
  B1110000,
  B1111111,
  B1111011,
  };
int pas;
int actuel;
int potar;
 
 
void setup() {
 
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);


}
 
 void loop(){
    // raz
  for(pas=0; pas <10; pas = pas + 1){
 
    actuel = sequence[pas];
   
     if (actuel  == 0) {
    DOTA0();
     DOTB0();
     DOTC0();
    DOTD0();
  DOTE0();
     DOTF0();
    DOTG0(); }
   
    // segment A à afficher ?
   
 if (actuel  >= 64) {
    DOTA1();
 actuel = actuel - 64; }
    else {
    DOTA0();}
   
     // segment B à afficher ?

 if (actuel  >= 32) {
    DOTB1();
 actuel = actuel - 32; }
    else {
    DOTB0();}
   
     // segment C à afficher ?
   
  if (actuel  >= 16) {
    DOTC1();
 actuel = actuel - 16; }
    else {
    DOTC0();}
   
     // segment D à afficher ?

    if (actuel  >= 8) {
    DOTD1();
 actuel = actuel - 8; }
    else {
    DOTD0();}
   
     // segment E à afficher ?

    if (actuel >= 4) {
    DOTE1();
actuel = actuel - 4; 
}
    else {
    DOTE0();}
   
     // segment F à afficher ?
     
    if (actuel  >= 2) {
    DOTF1();
 actuel = actuel -2; }
    else {
    DOTF0();}
   
     // segment G à afficher ?
   
    if (actuel  >= 1) {
    DOTG1(); }
    else {
    DOTG0();}
potar = analogRead(0);
if (potar < 100){
  potar = 100; }
if (potar > 1000){
  potar = 1000; }
delay(potar);   
   
 
  }
   
   
  }
   
 
void DOTA1 () {

      digitalWrite(0, HIGH);
      digitalWrite(1, LOW);
      delay(temps);
      digitalWrite(0, LOW);
}
     
void DOTA0 () {

      digitalWrite(0, LOW);
      digitalWrite(1, HIGH);
      delay(temps);
      digitalWrite(1, LOW);
}

void DOTB1 () {

      digitalWrite(2, HIGH);
      digitalWrite(3, LOW);
      delay(temps);
      digitalWrite(2, LOW);
}
     
void DOTB0 () {

      digitalWrite(2, LOW);
      digitalWrite(3, HIGH);
      delay(temps);
      digitalWrite(3, LOW);
}

void DOTC1 () {

      digitalWrite(4, HIGH);
      digitalWrite(5, LOW);
      delay(temps);
      digitalWrite(4, LOW);
}
     
void DOTC0 () {

      digitalWrite(4, LOW);
      digitalWrite(5, HIGH);
      delay(temps);
      digitalWrite(5, LOW);
}

void DOTD1 () {

      digitalWrite(6, HIGH);
      digitalWrite(7, LOW);
      delay(temps);
      digitalWrite(6, LOW);
}
     
void DOTD0 () {

      digitalWrite(6, LOW);
      digitalWrite(7, HIGH);
      delay(temps);
      digitalWrite(7, LOW);
}

void DOTE1 () {

      digitalWrite(8, HIGH);
      digitalWrite(9, LOW);
      delay(temps);
      digitalWrite(8, LOW);
}
     
void DOTE0 () {

      digitalWrite(8, LOW);
      digitalWrite(9, HIGH);
      delay(temps);
      digitalWrite(9, LOW);
}

void DOTF1 () {

      digitalWrite(10, HIGH);
      digitalWrite(11, LOW);
      delay(temps);
      digitalWrite(10, LOW);
}
     
void DOTF0 () {

      digitalWrite(10, LOW);
      digitalWrite(11, HIGH);
      delay(temps);
      digitalWrite(11, LOW);
}
 
 void DOTG1 () {

      digitalWrite(12, HIGH);
      digitalWrite(13, LOW);
      delay(temps);
      digitalWrite(12, LOW);
}
     
void DOTG0 () {

      digitalWrite(12, LOW);
      digitalWrite(13, HIGH);
      delay(temps);
      digitalWrite(13, LOW);
}
Logged

Stone age was not finished due to a lack of stones

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interesting. First time seeing a "physical" 7 segment display in action.

How much current is required? A L293 seems a bit overkill.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The requested current is 335mA and the voltage is 12V, what do you suggest to  use?
Logged

Stone age was not finished due to a lack of stones

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The requested current is 335mA and the voltage is 12V, what do you suggest to  use?
Wow that's more than I expected but perhaps 2N2222 is good enough?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

May be but you need to build  2 half bridges for each coil. So it would need a lot of 2N2222!!!
Logged

Stone age was not finished due to a lack of stones

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some videos with the same harware but fitted on a 7 dot strip

http://www.gueniffey.com/alphazeta01.AVI
http://www.gueniffey.com/alphazeta02.AVI
http://www.gueniffey.com/alphazeta03.AVI
Logged

Stone age was not finished due to a lack of stones

Pages: [1]   Go Up
Jump to: