Hi,
I'm new to this platform, I love it, it's cheap and powerful enough for my needs. I'm also trying to improve my C knowledge, I've using PicBasic a lot and I'm much more familiar with it
I'm trying to assign the 4 bytes of a long int to 4 different variables. I've been looking on the Internet for a solution and apparently I found it. Here's the code that SHOULD work:
byte aa,bb,cc,dd;
long int cast = 0xAABBCCDD;
void loop(){
aa = (byte) cast >> 24;
bb = (byte) cast >> 16;
cc = (byte) cast >> 8;
dd = (byte) cast;
Serial.print("cast= ");
Serial.pri