Skip to content

Instantly share code, notes, and snippets.

/**
* Cabezal de lectura de la máquina.
*
* Programa para el bloque rotador. Es desde este bloque desde donde se controla
* la operación de toda la máquina: sube o baja el sensor de luz para leer
* o escribir en la cinta; con su valor de bloque controla la dirección de las
* los motores.
*/
#include "cubelet.h"
@RQF7
RQF7 / left_motor.c
Created September 20, 2021 04:23
Autonomus car with Cubelets
#include "cubelet.h"
/**
* Sensor izquierdo: 88467
* Sensor centro: 88373
* Sensor derecho: 83755
*/
void setup()
{
@RQF7
RQF7 / gate_input.c
Last active August 19, 2019 04:44
Majority gate with Cubelets
// Program for the wire: a flashlight cube.
#include "cubelet.h"
void setup() {
block_value = 0;
}
void loop() {
if (weighted_average() >= 128) {
@RQF7
RQF7 / meta_sensor.c
Created May 3, 2019 19:05
Programs for a robotic caterpillar with Cubelets
#include "cubelet.h"
void setup() {
block_value = 0;
}
void loop() {
block_value = maximum();
}
/**
* led.c
* Program for the light cube.
* CULET: a Turing machine with Cubelets and Lego.
*/
#include "cubelet.h"
#define CONTROLLER 85562
/**
* motor.c
* Program for the two drive cubes.
* CULET: a Turing machine with Cubelets and Lego.
*/
#include "cubelet.h"
#define CONTROLLER 85562
#define MOTOR_POWER 80
@RQF7
RQF7 / duplicator.c
Created December 31, 2018 07:46
CULET program for duplicator Turing machine. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
#include "cubelet.h"
#define DOWN_SENSOR 83755
#define UP_SENSOR 88467
#define THRESHOLD_CERCANY 250
#define DESCENT_TIME_ONE 1200
#define DESCENT_TIME_CERO 700
#define POWER_ROTATOR 76
#define POWER_ROTATOR_RISE 75
@RQF7
RQF7 / rule_110.c
Created December 31, 2018 07:44
CULET program for rule 110 emulator. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
#include "cubelet.h"
#define DOWN_SENSOR 83755
#define UP_SENSOR 88467
#define THRESHOLD_CERCANY 250
#define DESCENT_TIME_ONE 1200
#define DESCENT_TIME_CERO 700
#define POWER_ROTATOR 76
#define POWER_ROTATOR_RISE 75
@RQF7
RQF7 / duplicator.json
Created December 31, 2018 07:42
The duplicator Turing machine for CULET. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
{
"states": [
"s1",
"s2",
"s3",
"s4",
"s5",
"s6"
],
"initial_state": "s1",
@RQF7
RQF7 / rule_110_7x2.json
Created December 31, 2018 07:40
The ECA Rule 110 emulator Turing machine. http://www.comunidad.escom.ipn.mx/ALIROB/CULET
{
"states": [
"S_x0",
"S_01",
"S_11",
"S_L",
"T_x0",
"T_01",
"T_11"
],