summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c')
-rw-r--r--Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c b/Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c
index afb520e..6908811 100644
--- a/Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c
+++ b/Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c
@@ -79,11 +79,7 @@ PIN_Config buttonPinTable[] = {
79 79
80void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) { 80void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) {
81 81
82 PIN_setOutputValue(ledPinHandle, Board_LED0,0); 82 CPUdelay(8000*200);
83 PIN_setOutputValue(ledPinHandle, Board_LED1,0);
84 CPUdelay(8000*200);
85 PIN_setOutputValue(ledPinHandle, Board_LED0,1);
86 PIN_setOutputValue(ledPinHandle, Board_LED1,1);
87 83
88 //Event_post(myEvent,Event_Id_02); 84 //Event_post(myEvent,Event_Id_02);
89 Semaphore_post(semHandle); 85 Semaphore_post(semHandle);
@@ -126,12 +122,15 @@ Void taskFxn(UArg arg0, UArg arg1)
126 if (i2c == NULL) { 122 if (i2c == NULL) {
127 System_abort("Error Initializing I2C\r\n"); 123 System_abort("Error Initializing I2C\r\n");
128 } 124 }
129
130 System_printf("I2C Initialized\r\n"); 125 System_printf("I2C Initialized\r\n");
131 126
132 System_printf("Press button:\r\n"); 127 /* Wait Semaphore */
133 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER); 128 System_printf("Press Button:\r\n");
129
130 PIN_setOutputValue(ledPinHandle, Board_LED0,1);
131 PIN_setOutputValue(ledPinHandle, Board_LED1,1);
134 132
133 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
135 134
136 /* Start test */ 135 /* Start test */
137 PIN_setOutputValue(ledPinHandle, Board_LED0,0); 136 PIN_setOutputValue(ledPinHandle, Board_LED0,0);
@@ -155,7 +154,7 @@ Void taskFxn(UArg arg0, UArg arg1)
155 Event_post(myEvent, Event_Id_00); 154 Event_post(myEvent, Event_Id_00);
156 flagerr=1; 155 flagerr=1;
157 } 156 }
158 System_printf("OPT3001 ID 0x5449: %x\r\n",data); 157 System_printf("OPT3001 Device ID [0x5449]: %x\r\n",data);
159 }else{ 158 }else{
160 System_printf("OPT3001 I2c Transaction Failed\r\n"); 159 System_printf("OPT3001 I2c Transaction Failed\r\n");
161 Event_post(myEvent, Event_Id_00); 160 Event_post(myEvent, Event_Id_00);
@@ -180,7 +179,7 @@ Void taskFxn(UArg arg0, UArg arg1)
180 flagerr=1; 179 flagerr=1;
181 } 180 }
182 //System_printf("HDC1080 Manufactured ID 0x5449: %x\n",data); 181 //System_printf("HDC1080 Manufactured ID 0x5449: %x\n",data);
183 System_printf("HDC1080 Device ID 0x1050: %x\r\n",data); 182 System_printf("HDC1080 Device ID [0x1050]: %x\r\n",data);
184 } 183 }
185 else{ 184 else{
186 System_printf("HDC1080 I2c Transaction Failed\r\n"); 185 System_printf("HDC1080 I2c Transaction Failed\r\n");
@@ -225,7 +224,7 @@ Void taskFxn(UArg arg0, UArg arg1)
225 Event_post(myEvent, Event_Id_00); 224 Event_post(myEvent, Event_Id_00);
226 flagerr=1; 225 flagerr=1;
227 } 226 }
228 System_printf("TMP007 Device ID 0x0078: %x\r\n",data); 227 System_printf("TMP007 Device ID [0x0078]: %x\r\n",data);
229 }else{ 228 }else{
230 System_printf("TMP007 I2c Transaction Failed\r\n"); 229 System_printf("TMP007 I2c Transaction Failed\r\n");
231 Event_post(myEvent, Event_Id_00); 230 Event_post(myEvent, Event_Id_00);
@@ -249,7 +248,7 @@ Void taskFxn(UArg arg0, UArg arg1)
249 Event_post(myEvent, Event_Id_00); 248 Event_post(myEvent, Event_Id_00);
250 flagerr=1; 249 flagerr=1;
251 } 250 }
252 System_printf("BMP280 ID 0x58: %x\r\n",data); 251 System_printf("BMP280 Device ID [0x58]: %x\r\n",data);
253 }else{ 252 }else{
254 System_printf("BMP280 I2c Transaction Failed\r\n"); 253 System_printf("BMP280 I2c Transaction Failed\r\n");
255 Event_post(myEvent, Event_Id_00); 254 Event_post(myEvent, Event_Id_00);
@@ -271,7 +270,7 @@ Void taskFxn(UArg arg0, UArg arg1)
271 Event_post(myEvent, Event_Id_00); 270 Event_post(myEvent, Event_Id_00);
272 flagerr=1; 271 flagerr=1;
273 } 272 }
274 System_printf("MPU9250 WHOIAM 0x71: %x\r\n",data); 273 System_printf("MPU9250 WHOIAM [0x71]: %x\r\n",data);
275 }else{ 274 }else{
276 System_printf("MPU9250 I2c Transaction Failed\r\n"); 275 System_printf("MPU9250 I2c Transaction Failed\r\n");
277 Event_post(myEvent, Event_Id_00); 276 Event_post(myEvent, Event_Id_00);
@@ -294,7 +293,7 @@ Void taskFxn(UArg arg0, UArg arg1)
294 Event_post(myEvent, Event_Id_00); 293 Event_post(myEvent, Event_Id_00);
295 flagerr=1; 294 flagerr=1;
296 } 295 }
297 System_printf("LISHH12 WHOIAM 0x41: %x\r\n",data); 296 System_printf("LISHH12 WHOIAM [0x41]: %x\r\n",data);
298 }else{ 297 }else{
299 System_printf("LISHH12 I2c Transaction Failed\r\n"); 298 System_printf("LISHH12 I2c Transaction Failed\r\n");
300 Event_post(myEvent, Event_Id_00); 299 Event_post(myEvent, Event_Id_00);