12.07.2015 Views

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

const char * terminate,const char * ignore);/*************************************************************************ADC FUNCTIONS - ADC FUNCTIONS - ADC FUNCTIONS - ADC FUNCTIONS**************************************************************************/// returns a 10 bit result from an AD conversion from a certain ADC channel//Channels 0-13// A 10 bit result needs to be loaded in an integer variableunsigned int READ_ADC_INT_CHANNEL( unsigned char channel );// returns a 8 bit result from an AD conversion from a certain ADC channel//Channels 0-13// A 8 bit result needs to be loaded in a BYTE variableunsigned char READ_ADC_BYTE_CHANNEL( unsigned char channel );AVR_PROTON_LIB.c/*************************************************************************I2C/TWI FUNCTIONS - I2C/TWI FUNCTIONS - I2C/TWI FUNCTIONS - I2C/TWI FUNCTIONS**************************************************************************/#include #include //Initiali<strong>se</strong> PIC16F887 for Hardware I2C operationvoid I2C_INIT(){TWBR = 90; //(19660800/10000 -16)/2 - 100kHz operationTWSR = 0; // no prescaler//DDRC = 0b00000011;//PORTC = 0b00000011;}// <strong>se</strong>nd a start bit <strong>se</strong>quencevoid I2C_START(){TWCR = (1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!