ofxArduinoDjShield, an addon to use the interface DJ Shield for Arduino
Openframeworks addon C++
Addon to use easily the DJ Shield for Arduino by Nootropic Design
https://nootropicdesign.com/djshield/
https://nootropicdesign.com/forum/viewtopic.php?f=42&t=2895
USAGE:
Get an Arduino Uno, Duemilanove, Mega or Leonardo http://arduino.cc/en/Main/arduinoBoardUno
Upload StandardFirmata on the arduino :
Open Arduino app (preferably Arduino 1.0) and navigate to File -> Examples -> Firmata and open StandardFirmata. Compile and upload StandardFirmata for your board, then close the Arduino application and run the application.
Get a DJ Shield for Arduino : https://nootropicdesign.com/djshield/
Add to your code :
in ofApp.h add :
#include "ofxArduinoDjShield.h"
and after public: :
ofxArduinoDjShield DjShield;
in ofApp.c add :
– in setup() { }
DjShield.setup("/dev/tty.usbmodem1d1421");
/*
Replace the string below with the serial port for your Arduino board
you can get this from the Arduino application or via command line
For OSX, in your terminal type "ls /dev/tty.*" to get a list of serial devices
or look the menu Tools>Port in Arduino app
*/
————————————–
– in update() {}
DjShield.udpate();
then use :
bool DjShield.bSetupArduino // if arduino ready
// Potentiometers A0-A2
float DjShield.PotA0(); // native, from 0 to 1
float DjShield.PotA1(TRUE, 0,255); // rescale from 0 to 255
float DjShield.PotA2(TRUE, 3, 10); // rescale from 3 to 10
// Buttons D2-D6
bool DjShield.ButtonD2();
bool DjShield.ButtonD3();
bool DjShield.ButtonD4();
bool DjShield.ButtonD5();
bool DjShield.ButtonD6();
// LED A4-A5
DjShield.LedA4(true);
DjShield.LedA4(false);
DjShield.LedA5(true);
DjShield.LedA5(false);