Skip to content

Instantly share code, notes, and snippets.

@matael
matael / cacahuete.c
Created December 24, 2011 14:02 — forked from Aluriak/cacahuete.c
NXC : Cacahuete
#define gauche IN_4
#define devant IN_2
#define droite IN_1
#define paslibre_g (SensorUS(gauche) < 15)
#define paslibre_d (SensorUS(droite) < 15)
#define motors OUT_BC
#define VITESSE_ROT 75
void setup(){
SetSensorTouch(devant);
@matael
matael / dist.c
Created December 24, 2011 17:08
Distance télémetre
// On cherche à qualifier la précision du télémètre.
// Des marques bleues sont disposées sur la piste à intervale régulier.
// Le robot mesure la distance entre son point de départ et chacune des marques bleues rencontrées.
#define Telemetre IN_1
#define Couleur IN_2
#define Touch IN_3
#define motors OUT_BC
int distance = 0;
entity MUX1 is
port(E0, E1, E2, E3 : in bit;
SEL : in bit_vector(1 downto 0);
S : out bit);
end MUX1;
architecture COMPOR_MUX1 of MUX1 is
begin
process
begin
@matael
matael / fangio.c
Created January 3, 2012 14:22
Das Fangio Code !
/*
!========================================================================================!
! Programme de Mathieu GABORIT et Lucas BOURNEUF !
! pour le projet FANGIO (séquence 3) !
! Licence : WTFPL !
! Etat : Terminal 7.3.2 !
!========================================================================================!
//*/
@matael
matael / protocol.h
Created January 6, 2012 21:34
Bluetooth Abstraction Protocol For NXT Mindstorm
/*
* Protocole de communication bluetooth entre NXT.
* Lucas Bourneuf
* Mathieu Gaborit
*
* License : WTFPL
*/
#define MASTER 0
#define SLAVE 1
@matael
matael / gist:1870714
Created February 20, 2012 18:56
help qgi
#define N // tu mets la taille qu'il te faut
char courant;
char lecture[N];
i = 0;
courant = getchar();
while (courant != EOF && i < N) {
lecture[i] = courant;
i++;
courant = getchar();
@matael
matael / index.php
Created April 10, 2012 09:23
Un peu de PHP
<?php
// Quelques Variables
$title = 'Index';
$dir = './src/*';
// Affichage du début de la page
echo<<<END
<!doctype html>
<html lang="fr">
@matael
matael / gist.py
Created April 16, 2012 17:08
Gist fetcher
#!/usr/bin/env python
#-*-coding:utf8-*-
#
# File: gist.py
# Author: Mathieu (matael) Gaborit
# <[email protected]>
# Date: 2012
# License: WTFPL
import os
@matael
matael / create_page.sh
Created June 26, 2012 17:53
Creation d'une page pour répertorier les pages à migrer (wiki partipirate)
#!/bin/bash
#prepare
csplit -f "sub_" listePageWiki.txt /Directory/ {50} -k -s
rm sub_00
rm subs/*
mv sub* subs/
#process
@matael
matael / index.html
Created July 2, 2012 12:07
IRC Dataporn
<!DOCTYPE html>
<html lang=en>
<head>
<title>Dataporn</title>
<meta charset=utf-8/>
<meta robots="noindex,nofollow"/>
<!-- lESS CSS -->
<link rel="stylesheet/less" href="main.less" media="screen" type="text/css"/>
<script type="text/javascript" src="less.min.js"></script>