Advertisement
Guest User

sender.c

a guest
Apr 30th, 2018
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <project.h>
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6. int16 test=16789;
  7.     uint16 utest = (uint16)test;
  8.     uint8 hibyte = utest>>8;
  9.     uint8 lowbyte = utest;
  10.  
  11.     CyGlobalIntEnable; /* Enable global interrupts. */
  12.     UART_Start();
  13.  
  14.     for(;;) //Send the same info again and again
  15.     {
  16.         UART_ClearTxBuffer();
  17.         UART_PutChar(hibyte);
  18.         UART_PutChar(lowbyte);
  19.         CyDelay(500);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement