Skip to content

Instantly share code, notes, and snippets.

@jakabo27
Last active October 2, 2019 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakabo27/8332a6d03b593aea5ea6b08ebe9789e5 to your computer and use it in GitHub Desktop.
Save jakabo27/8332a6d03b593aea5ea6b08ebe9789e5 to your computer and use it in GitHub Desktop.
#include <plib.h>
void __ISR(3) function2(void){
//turn on indicator LED - useful to know when it should be communicating
for(m = 0; m < 150; m++) // delay for 150ms
for(j = 0; j < 312; j++);
//turn off indicator LED
//Pass data to SPI buffer
//increment loop around back to the beginning if past number of array values
//Reset flag
}
main(){
//Globally enable interrupts
//Remap pins
//Set pins to digital
//Set I/O pins
//Set up interrupt
//Set up SPI
//Disable SPI interrupts
//Turn SPI off
//Clear receive buffer
//Disable enhance buffer
//Clear SPI flags
//Set Baud Rate
//between 2 and 1000
//Clear the SPIROV bit
//SPI settings
//enable DIO
//turn it on
while(1)
{
//Jacob is cool
}
}
delay(int delayTime){
int k, j;
for(k = 0; k < delayTime; k++)
for(j = 0; j < 312; j++);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment