Geekboy

Untitled

May 9th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. void slowSPIwrite(uint8_t d) {
  3.  for (int8_t i=7; i>=0; i--) {
  4.    P3OUT &= ~BIT3;  //set clk low
  5.    if (d & (1<<i) ) {
  6.      P3OUT |= BIT1; // if 1 set
  7.    } else {
  8.      P3OUT &= ~BIT1; // if 0 res
  9.    }
  10.    P3OUT |= BIT3;   // set clock hi then reset
  11.  }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment