Teensyduino 1.31 Beta #2 Available

Status
Not open for further replies.
Hello,i have the version 1.6.12 of arduino and 1.31 of teensyduino.
I have written this code

Code:
volatile byte channel_1, channel_2, channel_3, channel_4, channel_5, channel_6;
volatile int transmitter_channel_1, transmitter_channel_2, transmitter_channel_3, transmitter_channel_4, transmitter_channel_5, transmitter_channel_6;
volatile unsigned long current_time, time_channel_1, time_channel_2, time_channel_3, time_channel_4, time_channel_5, time_channel_6;

void setup() {

  pinMode(2, INPUT);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(14, INPUT);
  pinMode(20, INPUT);

  while(!Serial);
  Serial.begin(9600);

  attachInterrupt(digitalPinToInterrupt(2), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(6), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(7), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(8), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(14), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(20), transmitter_signals, CHANGE);
  
}

void loop() {
  
   Serial.println(transmitter_channel_1);
   Serial.println(transmitter_channel_2);
   Serial.println(transmitter_channel_3);
   Serial.println(transmitter_channel_4);
   Serial.println(transmitter_channel_5);
   Serial.println(transmitter_channel_6);
   delay(100);

}

void transmitter_signals(){ 
  
  current_time = micros();
  
  if(channel_1 == 0 && GPIOD_PDIR & (1<<0)){    
    channel_1 = 1;                                
    time_channel_1 = current_time;                                 
  }
  else if(channel_1 == 1){  
    channel_1 = 0;                                 
    transmitter_channel_1 = current_time - time_channel_1;      
  }

   if(channel_2 == 0 && GPIOD_PDIR & (1<<1)){         
    channel_2 = 1;                                
    time_channel_2 = current_time;                                 
  }
  else if(channel_2 == 1){  
    channel_2 = 0;                                 
    transmitter_channel_2 = current_time - time_channel_2;      
  }

   if(channel_3 == 0 && GPIOD_PDIR & (1<<2)){         
    channel_3 = 1;                                
    time_channel_3 = current_time;                                 
  }
  else if(channel_3 == 1){  
    channel_3 = 0;                                 
    transmitter_channel_3 = current_time - time_channel_3;      
  }
  
   if(channel_4 == 0 && GPIOD_PDIR & (1<<3)){       
    channel_4 = 1;                                
    time_channel_4 = current_time;                                 
  }
  else if(channel_4 == 1){  
    channel_4 = 0;                                 
    transmitter_channel_4 = current_time - time_channel_4;      
  }

  if(channel_5 == 0 && GPIOD_PDIR & (1<<4)){         
    channel_5 = 1;                                
    time_channel_5 = current_time;                                 
  }
  else if(channel_5 == 1){  
    channel_5 = 0;                                 
    transmitter_channel_5 = current_time - time_channel_5;      
  }
  
   if(channel_6 == 0 && GPIOD_PDIR & (1<<5)){       
    channel_6 = 1;                                
    time_channel_6 = current_time;                                 
  }
  else if(channel_6 == 1){  
    channel_6 = 0;                                 
    transmitter_channel_6 = current_time - time_channel_6;      
  }
}

when i do compile i have this error

Arduino: 1.6.12 (Windows 7), TD: 1.31, Πλακέτα:"Teensy 3.6, Serial, 180 MHz, US English"

receiver_tennsy: In function 'void setup()':
receiver_tennsy:19: error: 'transmitter_signals' was not declared in this scope
receiver_tennsy: In function 'void loop()':
'transmitter_signals' was not declared in this scope


What is the problem?
 
Last edited:
put a line

Code:
void transmitter_signals();
before setup()

I cannot see why print_signals is flagged as an error, it does not show up in your code. Are you sure you show all code or the right code?
 
WMXZ is that what you mean?

Code:
volatile byte channel_1, channel_2, channel_3, channel_4, channel_5, channel_6;
volatile int transmitter_channel_1, transmitter_channel_2, transmitter_channel_3, transmitter_channel_4, transmitter_channel_5, transmitter_channel_6;
volatile unsigned long current_time, time_channel_1, time_channel_2, time_channel_3, time_channel_4, time_channel_5, time_channel_6;

[COLOR="#FF0000"]void transmitter_signals();
[/COLOR]
void setup() {

  pinMode(2, INPUT);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(14, INPUT);
  pinMode(20, INPUT);

  while(!Serial);
  Serial.begin(9600);

  attachInterrupt(digitalPinToInterrupt(2), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(6), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(7), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(8), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(14), transmitter_signals, CHANGE);
  attachInterrupt(digitalPinToInterrupt(20), transmitter_signals, CHANGE);
  
}

void loop() {
  
   Serial.println(transmitter_channel_1);
   Serial.println(transmitter_channel_2);
   Serial.println(transmitter_channel_3);
   Serial.println(transmitter_channel_4);
   Serial.println(transmitter_channel_5);
   Serial.println(transmitter_channel_6);
   delay(100);

}

void transmitter_signals(){ 
  
  current_time = micros();
  
  if(channel_1 == 0 && GPIOD_PDIR & (1<<0)){    
    channel_1 = 1;                                
    time_channel_1 = current_time;                                 
  }
  else if(channel_1 == 1){  
    channel_1 = 0;                                 
    transmitter_channel_1 = current_time - time_channel_1;      
  }

   if(channel_2 == 0 && GPIOD_PDIR & (1<<1)){         
    channel_2 = 1;                                
    time_channel_2 = current_time;                                 
  }
  else if(channel_2 == 1){  
    channel_2 = 0;                                 
    transmitter_channel_2 = current_time - time_channel_2;      
  }

   if(channel_3 == 0 && GPIOD_PDIR & (1<<2)){         
    channel_3 = 1;                                
    time_channel_3 = current_time;                                 
  }
  else if(channel_3 == 1){  
    channel_3 = 0;                                 
    transmitter_channel_3 = current_time - time_channel_3;      
  }
  
   if(channel_4 == 0 && GPIOD_PDIR & (1<<3)){       
    channel_4 = 1;                                
    time_channel_4 = current_time;                                 
  }
  else if(channel_4 == 1){  
    channel_4 = 0;                                 
    transmitter_channel_4 = current_time - time_channel_4;      
  }

  if(channel_5 == 0 && GPIOD_PDIR & (1<<4)){         
    channel_5 = 1;                                
    time_channel_5 = current_time;                                 
  }
  else if(channel_5 == 1){  
    channel_5 = 0;                                 
    transmitter_channel_5 = current_time - time_channel_5;      
  }
  
   if(channel_6 == 0 && GPIOD_PDIR & (1<<5)){       
    channel_6 = 1;                                
    time_channel_6 = current_time;                                 
  }
  else if(channel_6 == 1){  
    channel_6 = 0;                                 
    transmitter_channel_6 = current_time - time_channel_6;      
  }
}
 
The Adafruit_ST7735 still do not work well with audio shield.
Doesn't have the begin() function to call inside setup() after SPI pins remap.
The library setup the SPI pins in the constructor which is called when the object it's created (usually outside the loop()). But you cannot remap SPI pins outside setup() or loop()
If someone has the same problem (needs to use Paul's audio shield and ST7735 tft) you could try the sumotoy library.
https://github.com/sumotoy/TFT_ST7735/tree/1.0p1
 
The upload process takes forever.... and didnt make it in the end.
Is there something wrong with the settings?
Im using arduino 1.6.12 & teensy Teensyduino 1.31 Beta 2

123.PNG
 
Settings are mostly ignored with Teensy as it has it's own loader. It has Help / Verbose window that may show errors/issues if you post that text.

The USB port ( try computer restart) or Teensy health might not be right - or the USB cable or connection?
 
The problem seems fixed after I pressed on the button in the new T3.5 board and now the port8 shows up.
But its still taking a lot of time to upload sketch and I dont know why.
 
But its still taking a lot of time to upload sketch and I dont know why.

Normally the uploading takes less than 1 second. Most computers take a few seconds to recognize the USB device change. Windows versions before 10 are slower in detecting USB devices, sometime adding 2 to 8 seconds delay after the upload, before Windows can communicate with the freshly programmed Teensy. But even then, the upload part should be quick.

In the Teensy Loader windows Help menu is Verbose Info. It opens a window with lots of diagnostic info. There's a Log menu with an option to save the info to a file, which you can attach to a message here (click "Go Advanced" to get the attach stuff). You can also copy and paste direct to a message (best to surround with code tags). Maybe there's useful info that can help us figure out what's going wrong?

Also, try the obvious... cold reboot, different USB cable, with or without USB hubs, disconnect other USB devices, temporarily disable anti-virus or Windows Defender to see if it makes any difference.
 
After seeing the results from Paul's #35 steps.

If the behavior persists - do the "15 second button press reset" on the device and try again. I'm wondering if you are seeing what I saw where there was a ~6 second delay added before USB came online at one point that went away with this reset.
 
Last edited:
any thoughts on how to install on a RPI3 using the ARM version?

Same as you'd install on 32 or 64 bit x86 Linux. Extract the Arduino tarball, and remember the pathname. Copy the udev rule. Then run the Teensyduino installer, select the location where you extracted.
 
ok that helped and I have it installed on my RPI3. Trying it with Arduino 1.6.12. So far I can compile but it doesn't seem to load. Need to work on that part. I am trying to see if I can use the RPI3 as my development platform as my WIN XP is slowly dying.
 
Status
Not open for further replies.
Back
Top