Coder Social home page Coder Social logo

arduino-lightsaber's Introduction

Arduino Lightsaber

This project is made to simulate a Light saber from Star Wars by using an Arduino Nano. This repository includes the Arduino code, the diagram and a pcb design

Materials

Materials that I used to make the Light saber:

  • Arduino Nano
  • WS2812B LED strip
  • Push button
  • 330 Ohm resistor
  • Resistor (1KOhm recommended)
  • 4 AA 1.5v (rechargeable) batteries
  • 4 AA battery holder

Diagram

Code

Before you upload the code to your Arduino, you should have the following libraries installed:

At the beginning of the code you will find a section to customize your Light saber:

// ------ Settings ------
#define LED_PIN       8
#define BUTTON_PIN    5
#define NUM_LEDS      50
#define DELAY         1

bool orange = true;
bool green = true;
bool red = true;
bool white = true;
bool purple = true;
bool yellow = true;
bool blue = true;

bool flickering = true;
// --------------------
  • You can change the pin numbers if you want to, but there is no need to if you have followed along with the diagram.
  • NUM_LEDS can be used to change the length of your Light saber
  • DELAY can be used to change the speed between each transition
  • You can disable any color by changing the boolean to false
  • flickering can be used to enable or disable flickering

How to use

  • With a single press on the button the LED will go on/off
  • With a double press on the button you can change the color of the LED

arduino-lightsaber's People

Contributors

sem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

arduino-lightsaber's Issues

'singleclick' was not declared in this scope

Hi, I'm trying your code but I'm getting the compilation error: 'singleclick' was not declared in this scope.

I'm still new to coding so have no clue how to fix this, any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.