Skip to content

Instantly share code, notes, and snippets.

@rafacouto
rafacouto / 2pass.bash
Created January 2, 2020 01:30
2pass - a bash importer from raw password list (exported from revelation)
#!/bin/bash
# Requirements: xml2 package
# Export the Revelation file as XML and:
# cat exported.xml | xml2 | 2pass
reset_entry()
{
a_fields=()
a_values=()
TARGET_EXEC ?= simul
TARGET_PLATFORM ?= linux
SRC_DIRS ?= . ../src
SRCS := $(shell find $(SRC_DIRS) -name '*.s')
SRCS += $(shell find $(SRC_DIRS) -name '*.c')
SRCS += $(shell find $(SRC_DIRS) -name '*.cpp')
OBJS := $(SRCS:%=%.o)
// 2x SNx4HC595 using N bits
#include <Arduino.h>
#define PIN_SER 8
#define PIN_LAT 9
#define PIN_CLK 10
#define TOTAL_BITS 12
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

Betatesting OVM20lite

Posibles melloras:

  • (!) Estandarización dos drill dos parafusos en placa: 3.0mm --> 3.2mm ([referencia][ARD01]).
  • T0 e T1 na silk deberían estar próximos aos pins (separar un pouco os condensadores para a silk?).
  • Igualmente na silk, as indicacións dos drivers X, Y, Z, E deberían estar ao lado do conector (non do condensador).
  • Publicar o esquema da placa.
  • Indicar na silk inferior información como: os micropasos dos motores.
  • (pro) Conector hotbed sen pasar polo FET para as camas quentes 220V.
  • (!) Revisar a fortaleza das soldaduras dos pots (desoldóuseme o Z).
@rafacouto
rafacouto / Configuration.h
Last active April 5, 2017 22:08
Marlin RC8 configuration for Foldarap Moco
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

SPI

The module support SPI communications with following features (mode 3):

  • module is slave
  • SS signal is not used
  • clock signal at 1 MHz maximum
  • clock polarity is HIGH
  • clock phase is HIGH
  • byte codification is 8 bits MSB
void init_pwm() {
// outputs
DDRB |= (1 << 2); // PB2
DDRD |= (1 << 5); // PD5
// Waveform Generation Mode to Fast PWM (WGM0[0:2]=7)
-- clock_div: SPI clock divider, f(SPI) = 80 MHz / clock_div
function spi_test(clock_div)
spi.setup(1, spi.MASTER, spi.CPOL_HIGH, spi.CPHA_HIGH, 8, clock_div, spi.FULLDUPLEX)
for n=0,256 do
r = { spi.send(1, n) }
--print(n, r[2])
if n > 0 and ((n-1)*2) % 256 ~= r[2] then print("ERROR!") ; return end