Project showcase
Crossfader With Arduino For VirtualDJ

Crossfader With Arduino For VirtualDJ © CC BY-NC

Most easy way to make crossfader with Arduino.

  • 913 views
  • 0 comments
  • 5 respects

Components and supplies

About this project

Code

Final code for most basic HID crossfaderArduino
#include "Keyboard.h"


void setup() {

  Keyboard.begin();
}
int level=0;
void loop() {
 
  int sensorValue = analogRead(A0);
  if(sensorValue<=1)
  {
      Keyboard.press(KEY_LEFT_CTRL);
  Keyboard.press(KEY_PAGE_DOWN);
    Keyboard.releaseAll();
    level=100;
  }
  else if (sensorValue> 1022){
  Keyboard.press(KEY_LEFT_CTRL);
  Keyboard.press(KEY_PAGE_UP);
  Keyboard.releaseAll();
  level=0;
  }
 int val = map(sensorValue, 0, 1023, 0, 100);
   Serial.println(val);
      Serial.println(level);
 if(level< val)
 for (int i=0;i< val-level;i++){
 Keyboard.press(KEY_PAGE_UP);  Keyboard.releaseAll();
 level++;
 }
 else if(level > val)
 for (int i=0;i< level-val;i++){
 Keyboard.press(KEY_PAGE_DOWN);
  Keyboard.releaseAll();
 level--;
 }
}

Schematics

Read value from potentiometer
Read value from potentiometer with analogRead

Comments

Similar projects you might like

Stereo NeoPixel Ring VU Meter

Project showcase by ericBcreator

  • 29,195 views
  • 268 comments
  • 70 respects

I2S Theremin

Project tutorial by Arduino_Genuino

  • 19,248 views
  • 3 comments
  • 23 respects

Electronic Piano Keyboard With Preset Songs

Project tutorial by Lindsay Fox

  • 78,019 views
  • 60 comments
  • 150 respects

Infinity Mirror VU Meter Music Equalizer

Project showcase by TheTNR

  • 5,437 views
  • 4 comments
  • 27 respects

New TEA5767 Sketches to Make an FM Radio with Arduino

Project showcase by diamond2016

  • 3,276 views
  • 0 comments
  • 9 respects

Music Adaptive RGB LED with Arduino and Processing

Project in progress by ounane mohamed elfarouk

  • 2,959 views
  • 8 comments
  • 24 respects
Add projectSign up / Login