Skip to content

Instantly share code, notes, and snippets.

@chukitow
Created April 5, 2014 18:48
Show Gist options
  • Select an option

  • Save chukitow/9996233 to your computer and use it in GitHub Desktop.

Select an option

Save chukitow/9996233 to your computer and use it in GitHub Desktop.
#include <16f877a.h>
#fuses XT, PUT, NODEBUG , NOBROWNOUT , NOPROTECT , NOLVP
#use delay(clock=4000000)
void main()
{
int num_c;
int num_d;
int16 suma;
//Entredas
set_tris_d(0xFF);
set_tris_c(0xFF);
//Salidas
set_tris_b(0XF0);
set_tris_a(0X00);
while(true)
{
num_c = input_c();
num_d = input_d();
suma = (int16) num_c + (int16)num_d;
output_a(suma);
output_b(suma >> 6);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment