I’m trying to get data from a depth sensor and sent to it but before i can send it to a file, i need to first of all add the captured and put it a buffer… Any ideas on how to achieve this … ?
The code below is what i used to get the data from the depth and it works perfectly fine… Now all i need is how to the data and put it in buffer … Thanks
#define MAX_BUFFER_LENGTH 4 // change this to how many bytes you'd like to have in the buffer
char buffer[MAX_BUFFER_LENGTH];
int pos = 0; // current position in the buffer
Push value to the buffer:
buffer[pos++] = value; // copies a value into buffer & increments pos
You need to make sure that you don't write outside the bounds of the buffer. One way to do this is to wrap back to beginning when the buffer gets full:
i need to first of all add the captured and put it a buffer.
Use a butterfly net. If you are trying to capture butterflies. Otherwise, use some English to describe what you are talking about. We aren't all smoking the same stuff you are.