Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE GADTs, ExistentialQuantification #-}
module Main where
import Text.ParserCombinators.UU
--import Data.Char
import Text.ParserCombinators.UU.Utils
import Text.ParserCombinators.UU.BasicInstances hiding (Parser)
--import System.IO
--import GHC.IO.Handle.Types
@baragona
baragona / parse.hs
Created December 16, 2014 02:04
Parallel Numerical Language Compiler - Parser
{-# LANGUAGE GADTs, ExistentialQuantification #-}
module Main where
import Text.ParserCombinators.UU
--import Data.Char
import Text.ParserCombinators.UU.Utils
import Text.ParserCombinators.UU.BasicInstances hiding (Parser)
--import System.IO
--import GHC.IO.Handle.Types
@baragona
baragona / gist:e5798d0f694fe1a9fe1b
Created December 16, 2014 02:53
CNC machine control on bare metal - serial port communication...
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#define TMR0STEPS REGISTER(TIMERSBASE,4)
#define TMR0DESIRED REGISTER(TIMERSBASE,5)
#define TMR0QUAD REGISTER(TIMERSBASE,6)
#define TMR0MAXOVERSHOOT REGISTER(TIMERSBASE,7)
#define tim1off 64
@baragona
baragona / stream_cache.pm
Created December 16, 2014 02:59
Stream Cache - Flexible moving window buffer any objects
package stream_cache;
use strict;
use warnings;
sub new{
my $get_next_chunk_data = shift;
my $next_chunk_id = shift;
$next_chunk_id = 0 unless $next_chunk_id;
return {
@baragona
baragona / simple_move_cvtr.pm
Created December 16, 2014 03:02
Movement converter - convert high level movement commands into absolute motor positions.
package simple_move_cvtr;
use stream_cache;
use strict;
use warnings;
use List::Util qw(min max);
@baragona
baragona / gist:9c619f0f8141b677fd6a
Created December 16, 2014 05:21
Markov Chain Encoding
#!/usr/bin/perl -w
# created October 4, 2014
use strict;
use Data::Dumper;
#use JSON::PP;
$"=" ";