ofxArduinoDjShield, un addon pour utiliser l’interface DJ Shield pour Arduino

Addon Openframeworks C++

 

Un addon pour utiliser l’interface DJ Shield pour Arduino de Nootropic Design

https://nootropicdesign.com/djshield/
https://nootropicdesign.com/forum/viewtopic.php?f=42&t=2895

 

 

UTILISATION:

 

Acheter un Arduino Uno, Duemilanove, Mega or Leonardo http://arduino.cc/en/Main/arduinoBoardUno

 

Uploader StandardFirmata sur l’arduino :

 

Ouvrir l’application Arduino et naviguer jusqu’au fichier -> Examples -> Firmata and open StandardFirmata. Compiler et uploader StandardFirmata sur l’Arduino.

 

687474703a2f2f7777772e666c756174652e6e65742f6d656469612f626c6f672f6f667841726475696e6f446a536869656c645f6669726d6174615f6578656d706c652e706e67

Acheter/Fabriquer un DJ Shield pour Arduino : https://nootropicdesign.com/djshield/

 

Ajouter à votre code :

 

dans ofApp.h ajouter :

 

#include "ofxArduinoDjShield.h"

 

et après public: :

 

ofxArduinoDjShield DjShield;

 

dans ofApp.c ajouter :

 

– dans 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
 */

 

687474703a2f2f7777772e666c756174652e6e65742f6d656469612f626c6f672f6f667841726475696e6f446a536869656c645f706f72745f6578656d706c652e706e67

————————————–

– dans update() {}

 

DjShield.udpate();

 

ensuite utiliser :

 

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);

 

 

octocat_small Source sur Github

 

Téléchargez