v1ckery
Published © GPL3+

LEGO + Arduino pincher

My first attempt at integrating LEGO and Arduino together

IntermediateShowcase (no instructions)789
LEGO + Arduino pincher

Things used in this project

Hardware components

LEGO
×1
9V 1A Switching Wall Power Supply
9V 1A Switching Wall Power Supply
×1
Analog joystick (Generic)
×1
Arduino UNO
Arduino UNO
×1
28BYJ-48 Stepper Motor and ULN2003 Driver Board
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Story

Read more

Schematics

Schematic

Code

Code

Arduino
Really basic, but suitable for my purposes
#include <Stepper.h>
int stepsPerRevolution=1024;
Stepper myStepper(stepsPerRevolution, 8,10,9,11);

int joystickPin=A0;
int joystickVal;

void setup() {
  // put your setup code here, to run once:
myStepper.setSpeed(15);
}

void loop() {
  // put your main code here, to run repeatedly:
joystickVal = analogRead(joystickPin);

if(joystickVal>900){
  
  myStepper.step(1);
}

if(joystickVal<100){
  myStepper.step(-1);
}

}

Credits

v1ckery

v1ckery

2 projects • 3 followers

Comments