diff --git a/afsk/main.c b/afsk/main.c
index 832e850e..157214c1 100644
--- a/afsk/main.c
+++ b/afsk/main.c
@@ -19,6 +19,10 @@
* along with this program. If not, see .
*/
+//#include //Needed for I2C port
+#include //Needed for I2C port
+//#include //Needed for I2C port
+
#include
#include
#include
@@ -80,8 +84,19 @@ int main(void) {
}
timestamp = time(NULL);
- tempSensor = wiringPiI2CSetupInterface("/dev/i2c-3", 0x48);
-
+ int file_i2c;
+ //char *filenam1e = (char*)"/dev/i2c-3";
+ if ((file_i2c = open("/dev/i2c-3", O_RDWR)) < 0)
+ {
+ printf("ERROR: /dev/ic2-3 bus not present\n");
+ tempSensor = -1;
+ } else
+ {
+ tempSensor = wiringPiI2CSetupInterface("/dev/i2c-3", 0x48);
+ }
+
+ printf("tempSensor: %d \n",tempSensor);
+
setSpiChannel(SPI_CHANNEL);
setSpiSpeed(SPI_SPEED);
initializeSpi();