Skip to content

Instantly share code, notes, and snippets.

@RQF7
Created December 31, 2018 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RQF7/4027f2e6d6e03052beefd8bc0337ee91 to your computer and use it in GitHub Desktop.
Save RQF7/4027f2e6d6e03052beefd8bc0337ee91 to your computer and use it in GitHub Desktop.
Flashlight program for CULET. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
/**
* led.c
* Program for the light cube.
* CULET: a Turing machine with Cubelets and Lego.
*/
#include "cubelet.h"
#define CONTROLLER 85562
void setup()
{
block_value = 0;
}
void loop()
{
uint8_t instruction = get_block_value(CONTROLLER);
if (instruction == 0) {
set_flashlight(255);
} else {
set_flashlight(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment