Collision: Added C Src and Example

This module was initially known as GroveCollision. It has been
now changed to Collision. C source and examples added.

Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
Abhishek Malik
2016-09-12 14:37:53 -07:00
committed by Noel Eck
parent 2a63e97533
commit 0f7bb5573c
20 changed files with 186 additions and 105 deletions

22
examples/c/collision.c Normal file
View File

@ -0,0 +1,22 @@
//Modified: Abhishek Malik <abhishek.malik@intel.com>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "collision.h"
int main()
{
collision_context dev = collision_init(2);
bool abc = 0;
while(1){
if(collision_is_colliding(dev, &abc) != UPM_SUCCESS){
printf("an error has occured\n");
}
upm_delay(1);
printf("value retrieved: %d\n", abc);
}
collision_close(dev);
}