Jump to content
43oh

supersonic

Members
  • Content Count

    2
  • Joined

  • Last visited

Everything posted by supersonic

  1. Thanks for the quick answer guys. It works now! I will use the "slower" version of the code. As I'll be familiar with pointers I will use the "faster" version.
  2. 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
×
×
  • Create New...