cant believe i missed that long day lol.
ard sending
Serial3.print('<');
Serial3.write((byte *)&sendBuff,sizeof(sendBuff));
Serial3.print('>');
pi recieveing ( chopped up the triggers but still not triggering)
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <wiringSerial.h>
#include <stdlib.h>
void serialRead();
void gStart();
void gEnd();
struct MyStruct_t {
float yaw;
float pitch;
float roll;
}MyStruct;
int fd;
int i, x, sDA, cChar;
char recbuff[100];
int main ()
{
if ((fd = serialOpen ("/dev/ttyAMA0", 57600)) < 0)
{
fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
return 1 ;
}
for (;;)
{
serialRead();
}//for
}//main
void serialRead(){//*
cChar = serialGetchar(fd);
sDA = serialDataAvail(fd); // is Serial avail?
if (sDA > 0 ) {//*
x=0;
if ( cChar == '<'){//* // is it the start char?
printf("got <\n");
gStart();
}// if cchar ==<
}// sDA >0
}//serialRead
void gStart(){//*
cChar = serialGetchar(fd);
if (cChar != '>'){//*
recbuff[x] = cChar;
x++;}// if cChar!= >
else{//*
gEnd();
}//else
}//gStart
void gEnd(){
cChar = serialGetchar(fd);
if(cChar =='>'){//*
recbuff[x] = '\0';
memcpy(&MyStruct, recbuff, sizeof(MyStruct));
printf("Yaw :%lf\n", MyStruct.yaw);
printf("Pitch: %lf\n", MyStruct.pitch);
printf("Roll: %lf\n", MyStruct.roll);
} // if cchar == >
serialFlush(fd);
return;
}//gEnd
thinking im going to have to use something other than serialGetchar because that's just going to grab gibberish from a binary stream? (yes my brain is officially fried by this point)