#include "LEDs.h"

// Show the amplitude of the data on the LEDs
void showLEDs(int buf, unsigned int * leds){
	*leds = OFF;

	if(buf < 0){
		buf *= -1;
	}
	if(buf > 0){
		*leds |= 0x01;
	}
	if(buf/(MAX_VALUE/32 * 1)){
		*leds |= 0x02;
	}
	if(buf/(MAX_VALUE/32 * 2)){
		*leds |= 0x04;
	}
	if(buf/(MAX_VALUE/32 * 3)){
		*leds |= 0x08;
	}
	if(buf/(MAX_VALUE/32 * 4)){
		*leds |= 0x10;
	}
	if(buf/(MAX_VALUE/32 * 5)){
		*leds |= 0x20;
	}
	if(buf/(MAX_VALUE/32 * 6)){
		*leds |= 0x40;
	}
	if(buf/MAX_VALUE){
		*leds |= 0x80;
	}
}
