Hmmm, Pertama kali saya mengoprek ARM ini, waduh bikin kepala saya pusing banget alias tak mudeng ane,wkkwkwkkwkw. Tp karena kegigihan saya mempelajari ini n bertanya2 pada forum, lama kelamaan jadi enak n terasa lebih mudah oprek ARM ini. Mungkin bagi newbie, mungkin terasa susah banget dalam coding programnya.
Yang harus disiapkan:
1. Software Keil Vision 4
2. Proteus 7.8 SP 2
3. Secangkir Teh Es
4. Bagi yang punya pacar, lihat foto pacarnya.suit2

Ini adalah scematicnya:


Ini Adalah Hasilnya:





Source codenya:

#include <LPC213x.H> 
                 /* LPC21xx definitions */
#define LED0 (1<<8)
#define LED1 (1<<9)
#define LED2 (1<<10)
#define LED3 (1<<11)
#define LED4 (1<<12)
#define LED5 (1<<13)
#define LED6 (1<<14)
#define LED7 (1<<15)

#define DIR_LED (LED0)


void sabanta (void)  {                        /* wait function */
  int  d;
  for (d = 0; d < 1000000; d++);           /* only to delay for LED flashes */
                          }

int main(void)
{
unsigned int i,y;
IODIR0 = 0x0000FF00;
while(1)
{
      
     
      for (i = 1<<8; i < 1<<15; i <<= 1) { 
      IOSET0 = i;                         
      sabanta();                            
      IOCLR0 = i;                        
       }

      for (i = 1<<15; i > 1<<8; i >>= 1) { 
      IOSET0 = i;                         
      sabanta();                            
      IOCLR0 = i;

        }
      for(y=0;y<5;y++)
      {
      IOSET0 = IODIR0;                         
      sabanta();                            
      IOCLR0 = IODIR0;
      sabanta();
      }

      for(y=0;y<5;y++)
      {
      IOSET0 = 0x0000F000;
                            
      sabanta();                            
      IOCLR0 = 0x0000F000;
     
      sabanta();
      }
};
}
Diposting oleh skywalker

0 komentar:

Visit the Site
MARVEL and SPIDER-MAN: TM & 2007 Marvel Characters, Inc. Motion Picture © 2007 Columbia Pictures Industries, Inc. All Rights Reserved. 2007 Sony Pictures Digital Inc. All rights reserved. blogger template by blog forum.