Treehouse Mbed Team / Mbed 2 deprecated APS_1U5x

Dependencies:   mbed

src/lut.cpp

Committer:
mfwic
Date:
2018-11-29
Revision:
4:db38665c3727
Child:
5:09be5bbb5020

File content as of revision 4:db38665c3727:

//-------------------------------------------------------------------------------
// 
//  Treehouse Designs Inc.
//  Colorado Springs, Colorado
// 
//  Copyright (c) 2016 by Treehouse Designs Inc. 
//  Copyright (c) 2018 by Agility Power Systems Inc. 
// 
//  This code is the property of Treehouse Designs, Inc. (Treehouse) and
//  Agility Power Systems Inc. (Agility) and may not be redistributed
//  in any form without prior written permission from 
//  both copyright holders, Treehouse and Agility.
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
//   
//-------------------------------------------------------------------------------
// 
//  REVISION HISTORY:
//  
//   $Author: $
//   $Rev: $
//   $Date: $
//   $URL: $
// 
//-------------------------------------------------------------------------------

#include "mbed.h"
#include "lut.h"

//unsigned int binCode[6];

void dec2bin(int dec){
   
   int k;
   int n=5;
   
   for (int c = 5; c >= 0; c--)
   {
      k = dec >> c;
 
      if (k & 1)
         binCode[n] = 1;
      else
         binCode[n] = 0;
         
      n--;
   }
}


void dec2therm(int dec){
 
   for (int i = 0; i <= 16; i++)
   {
      thermCode[i] = 0;
   }
   
   for (int i = 0; i <= dec; i++)
   {
      thermCode[i] = 1;
   }

}

void getLUTcode(void){
    

}