Tuesday, 28 June 2016

14 segment and16 segment using ARM

WAP to Display 'A' on 14 segment:

#include<lpc21xx.h>
//#include"delay.h"

void delay(unsigned int c)
{
    unsigned int a;
for(a=1;a<=60000;a++);
}
int main()
{ int i;
  PINSEL0=0x00000000;
    PINSEL1=0x00000000;
    IO0DIR=0xffffffff;
   
while(1)   
{
    i=0;
while(i<100)
{   
    IO0SET=0x2633;
    delay(100);
    IO0CLR=0x2633;
    delay(1);
    i++;
}
while(i<200)
{
    IO0SET=0x2237;
    delay(100);
    IO0CLR=0x2237;
    delay(1);
    i++;
}

while(i<300)
{
    IO0SET=0x0176;
    delay(100);
    IO0CLR=0x0176;
    delay(1);
    i++;
}
}
}

WAP to Display 'RAM' on 14 segment using multiplexing:

#include<lpc21xx.h>
//#include"delay.h"

void delay(unsigned int c)
{
    unsigned int a;
  for(a=1;a<=60000;a++);
}

int main()
{
  PINSEL0=0x00000000;
    PINSEL1=0x00000000;
    IO0DIR=0xffffffff;
   
while(1)   
{

    IO0SET=0x000e0000;
    IO0SET=0x2633;
    delay(100);
    IO0CLR=0x2633;
    IO0CLR=0x000e0000;


    IO0SET=0x000d0000;
    IO0SET=0x2237;
    delay(100);
    IO0CLR=0x2237;
    IO0CLR=0x000d0000;


  IO0SET=0x000b0000;
    IO0SET=0x0176;
    delay(100);
    IO0CLR=0x0176;
  IO0CLR=0x000b0000;
   
    IO0SET=0x00070000;
    IO0SET=0x2237;
    delay(100);
    IO0CLR=0x2237;
    IO0CLR=0x00070000;

}
}





0 comments:

Post a Comment

if you have any doubt please let me know