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

Detailed Description

#include "cubelet.h"
void setup()
{
}
void loop()
{
think();
act();
}
void think()
{
block_value = weighted_average();
}
void act()
{
set_flashlight(block_value);
}
uint8_t weighted_average(void)
Calculates a block value based on the on the weighted average of neighbors block values.
void setup()
Function ran just a single time. Used for setting up variables or timers.
Definition bargraph.c:3
void act()
Using to perform an action based on a previously calculated block value.
Definition bargraph.c:19
void think()
Used in Action and Think Cubelets to calculate their block value.
Definition bargraph.c:14
void loop()
The loop() function gets called repeatedly while a Cubelet is powered on.
Definition bargraph.c:8