I've just started a new project with the Teensy 3.2 where I am rolling my own capacitive sensor. When I set the pins to input, the pull up resistor seems to come without using PULL-UP. I have tried several different pins to the same effect. I'm a long-time Teensy 2 user and think I have done this before on the 2.0 with no problem.
Here is a simplified program that I tried. The circuit is a 100 M resistor from pin 19 to 22, with oscilliscope on pin 22 which shows a continous high state (small voltage divider effect ripple). Pin 19 shows the expected square wave. Thanks for any insight.
Teensyduino 1.42/ Teensy 3.2/ 96MHz/USB MIDI
Here is a simplified program that I tried. The circuit is a 100 M resistor from pin 19 to 22, with oscilliscope on pin 22 which shows a continous high state (small voltage divider effect ripple). Pin 19 shows the expected square wave. Thanks for any insight.
Teensyduino 1.42/ Teensy 3.2/ 96MHz/USB MIDI
Code:
//teensy 3.2
long int lasttime=0;
const int driver = 19;
const int in = 22;
bool toggle = false;
//********setup***************
void setup()
{
pinMode(driver, OUTPUT);
pinMode(in, INPUT);
//digitalWrite(in, LOW); //tried this too, no luck
}
//*********Main Loop ***************
void loop()
{
//**************************************************
if (millis() > lasttime) //run this once every 2000 ms
{
lasttime = millis() + 2000;
if (toggle == true)
{
digitalWrite(driver, HIGH);
toggle = false;
}
else
{
digitalWrite(driver, LOW);
toggle = true;
}
}
}// end of main
Last edited by a moderator: