www.emrahbudak.com
  Havada Yazı Yazmak
 

Havada Yazı Yazmak

Çok hayret verici bir şey olduğunu hissetmiştim ilk duyduğumda. 8 tane led alt alta sıralanıyor ve bir yazı oluşturuyor. Hayret verici bir şey olmasına karşın çok kolay bir mantığı var havada yazı yazmanın. Elimizi salladığımızda havayı sütun sütun taramış oluyor ve her bir sütun da gerekli olan bilgiyi göndererek anlamlı yazılar yazabiliyoruz.

Yukarıda gördüğünüz simülasyonu ben oluşturdum havada yazı yazmanın mantığını anlamak için bu animasyona bakmak yeterlidir diye düşünüyorum. Devreyi yaparken zorlanacağınızı zannetmiyorum. Çok basit bir mantığı var. Picimizin B portuna ledleri A portunada butonları bağladım. Böylelikle devre bitmiş oldu. J Eğer pic16f628a kullanırsanız kristal takmanıza gerek kalmıyor ve daha fazla hafızaya sahip olduğu için (2kbyte) daha fazla yazı yazabilirsiniz.

İndir
Örnek bir kod. Eger pic basic'te biraz bilgin varsa bunun üzerinden kontrol edebilirsiniz. Pic ve pic basic konusunda bilginiz yoksa sitemizde pic'e yeni baslayanlar bölümünde örnek devrelerle kisaca açklayacagim.
Not: program Proton IDE de yazilmistir.Bu programi program indir bölümünde bulabilirsiniz.

'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : Emrah BUDAK *
'* Notice : Copyright (c) 2007 Emrahse Elektronik *
'* : All Rights Reserved *
'* Date : 05.12.2007 *
'* Version : 1.0 *
'****************************************************************   

DEVICE  16F84

    TRISA=%11111111

    TRISB=%00000000   

basla:

    IF  PORTA.1=0   THEN    buton1

    IF  PORTA.2=0   THEN    buton2

    GOTO    basla

buton1:

    IF  PORTA.0=0   THEN    basla

    PORTB=%00000000 :    DELAYMS '

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%00000110 :    DELAYMS '         [][]

    PORTB=%00011000 :    DELAYMS '     [][]

    PORTB=%00000110 :    DELAYMS '         [][]

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01000001 :    DELAYMS ' []          []

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%00011001 :    DELAYMS '     [][]    []

    PORTB=%00101001 :    DELAYMS '   []  []    []

    PORTB=%01000110 :    DELAYMS ' []      [][]

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%00001000 :    DELAYMS '       []

    PORTB=%00001000 :    DELAYMS '       []

    PORTB=%00001000 :    DELAYMS '       []

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111110 :    DELAYMS ' [][][][][][]

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%01111110 :    DELAYMS ' [][][][][][]

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%00110110 :    DELAYMS '   [][]  [][]

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111110 :    DELAYMS ' [][][][][][]

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%01111110 :    DELAYMS ' [][][][][][]

   

    PORTB=0 :   DELAYMS 200

    GOTO    buton1

buton2:

    IF  PORTA.0=0   THEN    basla

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01000001 :    DELAYMS ' []          []

   

    PORTB=%00000000 :    DELAYMS

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%00000110 :    DELAYMS '         [][]

    PORTB=%00011000 :    DELAYMS '     [][]

    PORTB=%00000110 :    DELAYMS '         [][]

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%00011001 :    DELAYMS '     [][]    []

    PORTB=%00101001 :    DELAYMS '   []  []    []

    PORTB=%01000110 :    DELAYMS ' []      [][]

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111110 :    DELAYMS ' [][][][][][]

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%00001001 :    DELAYMS '       []    []

    PORTB=%01111110 :    DELAYMS ' [][][][][][]

  

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%00001000 :    DELAYMS '       []

    PORTB=%00001000 :    DELAYMS '       []

    PORTB=%00001000 :    DELAYMS '       []

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%00100110 :    DELAYMS '   []    [][]

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%00110010 :    DELAYMS '   [][]    []

   

    PORTB=%00000000 :    DELAYMS 1

    PORTB=%01111111 :    DELAYMS ' [][][][][][][]

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01001001 :    DELAYMS ' []    []    []

    PORTB=%01000001 :    DELAYMS ' []          []

    PORTB=0 :   DELAYMS 300

    GOTO    buton2

 
 
 
  Bugün 12 ziyaretçi (15 klik) kişi burdaydı!  
 
Bu web sitesi ücretsiz olarak Bedava-Sitem.com ile oluşturulmuştur. Siz de kendi web sitenizi kurmak ister misiniz?
Ücretsiz kaydol