For example I'd like to get the value back from an ambient light sensor, and it's encoded as 16-bit R,G,B values. The call I'd like to make would look something like:
Code: Select all
#include <stdint.h>
select {
...
case sensor[int i].ambientLight(uint8_t device) -> (uint16_t R, uint16_t G, uint16_t B):
{
...
break;
}
}
Code: Select all
typedef union
{
uint64_t rgba;
struct
{
uint16_t r;
uint16_t g;
uint16_t b;
uint16_t a;
} val;
} ALStype;
...
case sensor[int i].ambientLight(uint8_t device) -> ALStype RGB:
...
Cheers
Simon