Created
April 5, 2014 18:48
-
-
Save chukitow/9996233 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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