Skip navigation
2015

    Bored to death. Sick of waiting for robot parts and WiFi modules. I decided to break something. So I started searching around for ways to display data from the Arduino to a monitor.

 

I found this video: https://www.youtube.com/watch?v=WlBXiZpuncg

And this instructable: http://www.instructables.com/id/TV-Out-with-Arduino/

 

I suggest you guys check it out and I will do my best to teach you here.

 

Here's a demo of how it worked out for me:

 

(Hope you don't mind my phone camera )

 

Let's get started!

Here's what you need:

  • A Yellow Video Cable (I don't exactly know what they are called)
  • An Arduino Uno R3
  • 4 Jumper Wires (I used 3 jumpers and 1 breadboard wire. It doesn't matter)
  • A 10kΩ resistor and a 560Ω resistor (A brown, black, orange one (10k) and a green, blue, brown one (560))
  • (Optional, but recommended) a wall power source for your Arduino. It makes the thing a bit more mobile so you don't have to carry around a laptop


20150228_144600.jpg


Step 1: Chop up some cables!

    What I did here was take my lovely video cable and cut off one end. From there it exposes 2 wires and a little bit of white insulation. One wire will be insulated with yellow rubber and one is just stranded copper wire. From there I stripped both wires and then soldered some solid copper wires that I cut to the end to make it work better with my solderless-breadbaord.

 

20150228_145038.jpg

 

Step 2: Breadboard set-up

    Now we need to setup the breadboard. This circuit is courtesy of the youtube video I listed above. It works just fine. Basically put the stranded copper wire into the breadboard and wire it to ground. Then put the yellow wire into the breadboard and then have that run into the 10kΩ and the 560Ω resistor then take those two leads and wire them to pins 7 and 9 with the jumpers. Now I know that made absolutely no sense so here is a diagram in Fritzing and then I have a picture of my actual breadboard:

 

Screen Shot 2015-02-28 at 2.17.26 PM.png

The gold wire being the copper stranded and the yellow being the well, yellow wire.

 

20150228_145934.jpg


Step 3: Time for code!

Here comes the hard part. Or well, the super easy part. Kinda a bit of both.

 

Install the TVout library for Arduino here: https://code.google.com/p/arduino-tvout/downloads/detail?name=TVoutBeta1.zip&can=2&q=

Don't know how to install libraries on Arduino? Check it out here: http://arduino.cc/en/Guide/Libraries

 

Now the TVout library comes with a few examples that I recommend you look at but if not, here is my example:

 

Screen Shot 2015-02-28 at 3.07.19 PM.png

Just upload that baby to the Arduino and your ready for the next step.

 

(Here is all the commands for the entire library if you want to learn more: https://code.google.com/p/arduino-tvout/wiki/FunctionalDescription)

 

Your done!

     Alright guys, we're all done. Time to try it out! All you have to do is supply power to the Arduino and then plug the yellow video cable into the yellow video jack on your TV. Set the TV's source to video and enjoy the action.

 

     There is a lot you can do with this. I hope this helped some of you out and I'd love for you guys to show me your creations right here on element14. I'd also love some feedback on my tutorial as this is my first one. Have fun guys! Happy Hacking.

This is part III of a three part post.

Please read Part I QLab Midi Controller for an introduction to the project

and Part II QLab MIDI Controller - The Build for the build.

 

After a short delay, the current version of the MIDI Controller code is now ready.

TeensyDuino is required in order to use the Arduino IDE, the software is available from the pjrc website here: https://www.pjrc.com/teensy/td_download.html

 

/*
  QLab MIDI Controller v2.0

  Created: 10 Dec 2015 by Paul Ellison
  Updated: 25 Feb 2015 - Cleaned up code


  You must select MIDI from the "Tools > USB Type" menu
  To view the raw MIDI data on Linux: aseqdump -p "Teensy MIDI"
*/


#include <Bounce.h>


// the MIDI channel number to send messages
const int channel = 1;


int blinkGo = 0;
int blinkStop = 0;


int goLEDstate = HIGH;
int stopLEDstate = HIGH;


long previousGoMillis = 0;
long previousStopMillis = 0;


long goBlinkInt = 200;
long stopBlinkInt = 500;


int goLED = 2;
int stopLED = 3;
int nextLED = 4;


// Create Bounce objects for each button.  The Bounce object
// automatically deals with contact chatter or "bounce", and
// it makes detecting changes very simple.
Bounce goButton = Bounce(10, 5);
Bounce stopButton = Bounce(11, 5);
Bounce nextButton = Bounce(12, 5);


void setup() {
  // Setup input pins for "active low"
  pinMode(10, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);

  // Setup output pins
  pinMode(goLED, OUTPUT);
  pinMode(stopLED, OUTPUT);
  pinMode(nextLED, OUTPUT);

  // Set initial LED values.
  digitalWrite(goLED, HIGH);
  digitalWrite(stopLED, HIGH);
}


void loop() {
  // Update all the buttons.
  goButton.update();
  stopButton.update();
  nextButton.update();


  // Check each button for "falling" edge.
  // Send a 'MIDI Note On' message when each button is pressed
  if (goButton.fallingEdge()) {
    usbMIDI.sendNoteOn(62, 99, channel);  // 62 = D4
    blinkGo = 4;
  }

  if (stopButton.fallingEdge()) {
    usbMIDI.sendNoteOn(63, 99, channel);  // 63 = D#4
    if (blinkStop == 0) {
      blinkStop = 6;
    } else {
      blinkStop = 0;
      digitalWrite(stopLED, HIGH);
    }
  }

  if (nextButton.fallingEdge()) {
    usbMIDI.sendNoteOn(64, 99, channel);  // 64 = E4
    digitalWrite(nextLED, LOW);
  }

  // Check each button for "rising" edge
  // Send a 'MIDI Note Off' message when each button is released
  if (goButton.risingEdge()) {
    usbMIDI.sendNoteOff(62, 0, channel);  // 62 = D4
  }
  if (stopButton.risingEdge()) {
    usbMIDI.sendNoteOff(63, 0, channel);  // 63 = D#4
  }
  if (nextButton.risingEdge()) {
    usbMIDI.sendNoteOff(64, 0, channel);  // 64 = E4
    digitalWrite(nextLED, HIGH);
  }


  // MIDI Controllers should discard incoming MIDI messages.
  // Read more at the following url:
  // http://forum.pjrc.com/threads/24179-Teensy-3-Ableton-Analog-CC-causes-midi-crash
  while (usbMIDI.read()) {
    // Ignore incoming messages
  }

  unsigned long currentGoMillis = millis();
  unsigned long currentStopMillis = millis();

  if ((blinkGo > 0) || (goLEDstate == LOW)) {
    if(currentGoMillis - previousGoMillis > goBlinkInt) {
      // save the last time you blinked the LED
      previousGoMillis = currentGoMillis;  


      // if the LED is off turn it on and vice-versa:
      if (goLEDstate == LOW) {
        goLEDstate = HIGH;
      } else {
        goLEDstate = LOW;
      }
      // set the LED with the ledState of the variable:
      digitalWrite(goLED, goLEDstate);
      blinkGo--;
    }
  }

  if ((blinkStop > 0) || (stopLEDstate == LOW)) {
    if(currentStopMillis - previousStopMillis > stopBlinkInt) {
      // save the last time you blinked the LED
      previousStopMillis = currentStopMillis;  


      // if the LED is off turn it on and vice-versa:
      if (stopLEDstate == LOW) {
        stopLEDstate = HIGH;
      } else {
        stopLEDstate = LOW;
      }
      // set the LED with the ledState of the variable:
      digitalWrite(stopLED, stopLEDstate);
      blinkStop--;
    }
  }
}

 

An improved version of the controller is in progress, build and code to follow in an additional post.

 

Would be interested to hear if anybody has any comments/suggestions/improvement ideas for the code (or project as a whole). Any additions will be credited.

Have you seen these low-cost robot for Arduino, yet, at:

 

                     www.arduinorobot.ca

 

Great way to learn about them and have fun using them!

Many thanks to all who participated in the Internet of Holiday Lights RoadTest Plus.  In a little over 6 weeks, 112 fascinating, interesting and challenging blog posts were created and we got to see a glimpse of the future of Holiday Lights applications.
It hasn't been easy to select a winner.  Indeed, it was so problematic that we have picked two grand prize recipients.
Grand Prize Winner #1: Peter Oakes
Peter Oakes' BYOB Party was an inspiration to others, and indeed a lot of other competitors cited his work in their builds.  It is our pleasure to follow up his coterie of Holiday Lights Party-goers with a Robox 3D printer.
Grand Prize Winner #2: Inderpreet Singh
Inderpreet Singh has turned his living room into a permanent holiday lights display, complete with dancing minions.  Such dedication and single-mindedness deserves recognition with the 3D printer.
And finally...
Thank you to all our participants. Those who finished their projects will receive a copy of The Internet of Things with the Arduino Yún by Marco Schwarz.  I encourage everyone who found this challenge intriguing and exciting to participate in our now enrolling Enchanted Objects IoT Challenge.

Filter Blog

By date: By tag: