====== Teensy ====== {{:materiel:teensy:teensy.jpg|}}
The Teensy is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard "Mini-B" USB cable and a PC or Macintosh with a USB port.(http://www.pjrc.com/teensy/)===== Installation ===== * Téléchargement : http://www.pjrc.com/teensy/td_download.html * http://www.pjrc.com/teensy/teensyduino.html * http://www.pjrc.com/teensy/first_use.html ===== Teensy Vs Arduino ===== * Tests de latence : http://neophob.com/2011/04/serial-latency-teensy-vs-arduino/ ===== Pins ===== * http://www.pjrc.com/teensy/pinout.html {{:materiel:teensy:wiring_pinout2h.png|}} {{:materiel:teensy:teensy31_front_pinout.png|}} ===== Teensy et Raspberry Pi ===== * http://www.teensypi.com/teensypi-board-version-5/ {{:materiel:teensy:teensypi-v5.jpg|}} ===== Ethernet ===== * http://pjrc.com/teensy/td_libs_Ethernet.html * http://www.tweaking4all.com/hardware/arduino/arduino-enc28j60-ethernet/ * https://bigdanzblog.wordpress.com/2015/01/01/wiring-teensy-3-1-and-enc28j60-ethernet-module-together/ {{:materiel:teensy:teensy-ethernet.png|}} {{:materiel:teensy:teensy-enc28j60-wiring.png|}} ===== Touch > Midi ===== Envoie de valeurs avec touchRead() en MIDI.
// adpapted from http://reso-nance.org/wiki/projets/teensymiditouchcontroller/
/* TOUCHPINS */
int const nbTouch = 6; // number of pins to use as touchpins, sending note values
int touch[nbTouch];
int touchOn[nbTouch];
int touchPins[] = {15,16,17,18,19,22,};
int touchPitch[] = {36,37,38,39,40,41}; // MIDI pitches
int touchThreshold = 3200;
const int channel = 1;
void setup() {
Serial.begin(38400);
}
void loop() {
for (int i = 0; i < nbTouch; i++) {
touch[i] = touchRead(touchPins[i]);
//Serial.print();
//Serial.print("\t");
if (touch[i] > touchThreshold && touchOn[i] == 0) {
usbMIDI.sendNoteOn(touchPitch[i], map(touch[i],1300, 6000, 0, 127), channel);
touchOn[i] = 1;
}
if (touch[i] < touchThreshold && touchOn[i] == 1) {
usbMIDI.sendNoteOff(touchPitch[i], 0, channel);
touchOn[i] = 0;
}
}
//Serial.println();
delay(10);
}
{{tag>teensy}}