Resolução feita em CCS C Compiler
#include <16F877A.h>
#include <math.h>
#use delay(clock = 20M)
#define size 10
#include <lcd.c>
const unsigned char matriz[size][size] = {
{0, 16, 32, 48, 64, 80, 96, 112, 128, 144},
{1, 17, 33, 49, 65, 81, 97, 113, 129, 145},
{2, 18, 34, 50, 66, 82, 98, 114, 130, 146},
{3, 19, 35, 51, 67, 83, 99, 115, 131, 147},
{4, 20, 36, 52, 68, 84, 100, 116, 132, 148},
{5, 21, 37, 53, 69, 85, 101, 117, 133, 149},
{6, 22, 38, 54, 70, 86, 102, 118, 134, 150},
{7, 23, 39, 55, 71, 87, 103, 119, 135, 151},
{8, 24, 40, 56, 72, 88, 104, 120, 136, 152},
{9, 25, 41, 57, 73, 89, 105, 121, 137, 153}
};
int a, b, c, d, e, f, g, decimal;
unsigned int8 aux, dezena, unidade;
void main(void){
for(int i = 0; i < size; i++){
for(int j = 0; j < size; j++){
output_c(matriz[i][j]);
delay_ms(100);
}
}
delay_ms(500);
lcd_init();
while(TRUE){
a = input(PIN_B0);
b = input(PIN_B1);
c = input(PIN_B2);
d = input(PIN_B3);
e = input(PIN_B4);
f = input(PIN_B5);
g = input(PIN_B6);
decimal = (a<<6)|(b<<5)|(c<<4)|(d<<3)|(e<<2)|(f<<1)|(g<<0);
printf(lcd_putc,"\fBINARIO = %u%u%u%u%u%u%u \nDECIMAL = %u"a, b, c, d, e, f, g, decimal);
delay_ms(100);
aux = decimal / 10;
dezena = (int)floor(aux);
aux = decimal - (10 * dezena);
unidade = (int)floor(aux);
output_c(matriz[dezena][unidade]);
delay_ms(100);
}
}
Palavras chave:
Decoder 4511 with PIC16F877A using array
Декодер 4511 с PIC16F877A с использованием массива
Dekoder 4511 med PIC16F877A som bruker array
Dekoder 4511 z PIC16F877A za pomocą tablicy
מפענח 4511 עם PIC16F877A באמצעות מערך
Decoder 4511 le PIC16F877A sebelisa hlophisitsoeng
어레이를 사용하는 PIC16F877A가 있는 디코더 4511
Dekodētājs 4511 ar PIC16F877A, izmantojot masīvu
Декодер 4511 с PIC16F877A, използващ масив
Dekodér 4511 s PIC16F877A pomocí pole
Bộ giải mã 4511 với PIC16F877A sử dụng mảng
Nenhum comentário:
Postar um comentário