JM Badge Board Applications - small mistake

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

JM Badge Board Applications - small mistake

1,203 Views
AndreiBoeru
Contributor I
I found a little mistake in the demo Applications. In the file accelerometer.c starting from line 486, the original code is:
switch(sensitivity)
  {
    case Range15g:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 0;
      break;
    case Range2g:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 1;
      break;
    case Range4g:
      PTCD_PTCD4 = 1; 
      PTCD_PTCD5 = 0;
      break;
    case Range6g:
      PTCD_PTCD4 = 1; 
      PTCD_PTCD5 = 1;
      break;
    default:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 0;
      break;                 
  }

The problem is that Range2g and Range4g are misplaced. So the correct code would be
switch(sensitivity)
  {
    case Range15g:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 0;
      break;
    case Range4g:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 1;
      break;
    case Range2g:
      PTCD_PTCD4 = 1; 
      PTCD_PTCD5 = 0;
      break;
    case Range6g:
      PTCD_PTCD4 = 1; 
      PTCD_PTCD5 = 1;
      break;
    default:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 0;
      break;                 
  }

Happy coding!


Message Edited by Andrei Boeru on 2008-12-27 01:00 AM
Labels (1)
0 Kudos
1 Reply

278 Views
anthony_huereca
NXP Employee
NXP Employee
Thanks for catching that! The change will be uploaded to the website soon.
0 Kudos