Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 40 of 40

Thread: Teensyduino 1.31 Beta #2 Available

  1. #26
    Senior Member
    Join Date
    Aug 2016
    Posts
    130
    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 by thanos; 10-27-2016 at 10:51 AM.

  2. #27
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,829
    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?

  3. #28
    Senior Member
    Join Date
    Aug 2016
    Posts
    130
    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;
    
    void transmitter_signals();
    
    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;      
      }
    }

  4. #29
    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

  5. #30
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,466
    Paul, the new stereo-DAC works great. Thank you.

  6. #31
    Junior Member
    Join Date
    Oct 2016
    Posts
    11
    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

    Click image for larger version. 

Name:	123.PNG 
Views:	157 
Size:	39.0 KB 
ID:	8683

  7. #32
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,784
    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?

  8. #33
    Junior Member
    Join Date
    Oct 2016
    Posts
    11
    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.

  9. #34
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,466
    that's very unusal.
    are you using a hub ?

  10. #35
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,183
    Quote Originally Posted by kobe12345 View Post
    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.

  11. #36
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,784
    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 by defragster; 11-01-2016 at 04:26 AM.

  12. #37
    Junior Member
    Join Date
    Dec 2014
    Posts
    7
    any thoughts on how to install on a RPI3 using the ARM version?
    Thanks,
    Ken

  13. #38
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,183
    Quote Originally Posted by Kenidowa View Post
    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.

  14. #39
    Junior Member
    Join Date
    Oct 2016
    Posts
    11
    Quote Originally Posted by PaulStoffregen View Post
    Normally the uploading takes less than 1 second....
    The problem is fixed now! After I reinstall the software and stuff. Thanks everyone for the advice

  15. #40
    Junior Member
    Join Date
    Dec 2014
    Posts
    7
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •