Cubelets API Documentation 2.0
C API
Loading...
Searching...
No Matches
brightness.c File Reference

Detailed Description

Low Sensitivity

Renders the Brightness cubelet less sensitive to light.

#include "cubelet.h"
void setup()
{
}
void loop()
{
unsigned int tmp_block_value = get_brightness();
if (tmp_block_value < 128){
tmp_block_value = 0;
}
else {
tmp_block_value = (tmp_block_value - 128) * 2; // Half sensitivity
}
block_value = tmp_block_value;
}
void setup()
Function ran just a single time. Used for setting up variables or timers.
Definition bargraph.c:3
void loop()
The loop() function gets called repeatedly while a Cubelet is powered on.
Definition bargraph.c:8

Detailed line by line code explanation