#include <LPC213X.H>#define a (1<<16)#define b (1<<17)#define c (1<<18)#define d (1<<19)#define e (1<<20)#define f (1<<21)#define g (1<<22)#define SSD (a|b|c|d|e|f|g)#define ZERO (a|b|c|d|e|f) #define ONE (b|c)#define TWO (a|b|g|e|d)#define THREE (a|b|g|c|d)#define FOUR (b|c|f|g)#define FIVE (a|c|d|f|g)#define SIX (a|c|d|e|f|g)#define SEVEN (a|b|c)#define EIGHT (a|b|c|d|e|f|g)#define NINE (a|b|c|f|g)void delay(void){unsignedint i;for(i=0;i<50000;i++);}void ssd_display(int val){
IOCLR1|=SSD;if(val==0){
IOSET1|=ZERO;}elseif(val==1){
IOSET1|=ONE;}elseif(val==2){
IOSET1|=TWO;}elseif(val==3){
IOSET1|=THREE;}elseif(val==4){
IOSET1|=FOUR;}elseif(val==5){
IOSET1|=FIVE;}elseif(val==6){
IOSET1|=SIX;}elseif(val==7){
IOSET1|=SEVEN;}elseif(val==8){
IOSET1|=EIGHT;}elseif(val==9){
IOSET1|=NINE;}}int main(){int i;
IODIR1|=0Xffffffff|SSD;while(1){for(i=1;i<10;i++){
ssd_display(i);
delay();}}}
Only you know what "doesn't work" means
Please tell us what your circuit or code is supposed to do and why it "doesn't work".When you come in and say "it doesn't work" or just "it has errors", that means NOTHING. There could be a million things wrong and no one will know where to look.