Troubleshooting - board doesn't load new program

Status
Not open for further replies.

RandyR

Member
I just got the Teensyduino 3, and spent the last few hours trying to get the tutorial Blink program to work. (Teensyduino with headers and breadboard, and tutorial kit.)
At first, I wasn't able to get the led to light up at all, till I made the jumpers a little longer for ground and +5V.
Then I tried to get the Blink program to load, but nothing happened when I hit the reset button. I had previously gotten the board to show up in the loader program.
After checking my connections and retrying to load the program, I read the troubleshooting steps on the website: http://www.pjrc.com/teensy/troubleshoot.html and read the following
If the LED blinks, and the pushbutton stops the blinking, but Teensy Loader never detects your board, and you've followed the steps above, the problem is almost certainly a faulty USB cable. Many USB cables made for charging devices have only power wires but no data lines.
This turned out to be my problem. I had switched from a short USB cable to a longer one I usually use for charging my phone. The short one let me load the Blink program, and everything worked as it should.
I was sure I had a dead board, thankfully I don't!

My next step is to make some controls for flight simulator.
 
I was able to figure out how to do all the tutorials, up till Tutorial 4, Analog Input Example. Is the coding for analog input from a pot different for Teensyduino 3? My first project is going to be selecting radio frequencies, course and heading (autopilot,) using rotary switches and pots, for flight simulator, adding buttons and leds later.

I forgot to mention how I had the pot connected. The middle pin is connected to pin 14 which is labeled as A0 on the pinout that came with the board. I ran the example Analog Input program without any changes.

Code:
void setup()
{                
  Serial.begin(38400);
}

int val;

void loop()                     
{
  val = analogRead(0);
  Serial.print("analog 0 is: ");
  Serial.println(val);
  delay(250);
}
 
Last edited:
Here is my modified AnalogRGBColor (only the pins the leds are connected to are changed.)

Code:
int redPin = 21;
int greenPin =  23;
int bluePin =  22;

void setup() {
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

int redIntensity = 0;

void loop()                     
{
  // read the pot position
  redIntensity = analogRead(0) / 4;
  
  // set all 3 pins to the desired intensity
  analogWrite(redPin, redIntensity);
  analogWrite(greenPin, 255 - redIntensity);
  analogWrite(bluePin, 0);

  // remain at this color, but not for very long
  delay(10);
}

To be complete, here is a picture of my complete set-up:
eFkIrAD.jpg

Oops, looking at the picture, I found my problem and it works now. I was missing the short between 5v and the pot.
 
Last edited:
Status
Not open for further replies.
Back
Top