I have made my own tactile pressure sensor and and have got it to work using this code and an arduino uno. The data is sent to processing where i have a nice visualization.
I am now trying to use a teensy 3.5 instead of the arduino uno. I have got some simpler code to work where its prints data into the serial monitor. Now i am trying to use the code above so i can get the visualization with the teensy. However with the teensy the visualization of the data in processing isn't correct. I was hoping someone could help me understand why the code would work for the arduino uno but not for the teensy. Additionally i had to comment out the following lines to get it to work with the teensy.
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
. . . . .
sbi(ADCSRA,ADPS2); //set ADC prescaler to CLK/16
cbi(ADCSRA,ADPS1);
cbi(ADCSRA,ADPS0);