Thursday, November 24, 2016

Arduino Stepper with ULN2003 driver

// stepper1 -- repeat 1 CW and CCW revolution
/*
https://arduino-info.wikispaces.com/SmallSteppers
5v 28YBJ-48 Stepper Motor with Gear Reduction
ULN2003 driver board
*/

#include

// internal motor steps per revolution in 4-step mode
#define STEPS_PER_MOTOR_REVOLUTION 32

// steps per OUTPUT SHAFT of gear reduction
#define STEPS_PER_OUTPUT_REVOLUTION (STEPS_PER_MOTOR_REVOLUTION*64)

//The pin connections need to be 4 pins connected
// to Motor Driver In1, In2, In3, In4  and then the pins entered
// here in the sequence 1-3-2-4 for proper sequencing
Stepper s(STEPS_PER_MOTOR_REVOLUTION, 8, 10, 9, 11);

void setup()
{
  s.setSpeed(500);  // 700 good max?
}

void loop()
{
  s.step(2 * STEPS_PER_OUTPUT_REVOLUTION);  // CW 1 turn
  s.step(-STEPS_PER_OUTPUT_REVOLUTION); // CCW 1 turn
  delay(500);
}

Friday, November 4, 2016

Perfect SSL Score with Go

Peter Lambert makes it look easy!

https://blog.bracelab.com/achieving-perfect-ssl-labs-score-with-go
https://gist.github.com/denji/12b3a568f092ab951456#perfect-ssl-labs-score-with-go

Arduino Encryption

I've been looking at encryption libraries that would run on an Arduino.  This looks like something worth looking into.
This library contains a cryptographic pseudo-random number generator, cryptographic hash and message authentication code (MAC) functions, can perform symmetric-key authenticated data encryption, and general-purpose functions for timing-safe comparison and wiping data from memory.
https://hackaday.io/project/8244-arduino-spritz-cipher-library
https://github.com/abderraouf-adjal/ArduinoSpritzCipher
https://people.csail.mit.edu/rivest/pubs/RS14.pdf