Where do I find the source code on my Mac

Status
Not open for further replies.

Davidelvig

Well-known member
I'd like to peruse the source, and gingerly try some changes.
Where do I find it on the mac?
- e.g. the FFT1028 code
Arduino is installed in the "Applications" folder on my box
I keep my own code in a subfolder of "Documents"
Thanks!
 
for Arduino 1.6.X: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/Audio

(right-click on the Arduino.app select Show Package Contents)
 
I keep my own code in a subfolder of "Documents"

For libraries like Audio, you can put your own copy in Documents/Arduino/libraries to override the built-in one. Arduino will print a message to advise you duplicates were found, and which it's using and which ones it's ignoring.

While convenient, overriding libraries can be a long-term liability. In the future, related libraries are likely to add new features and perhaps require updates in other libraries. Teensyduino comes with a set of well tested libs that all work together. When you override one, in the distant future it may need updating, which can come as quite an unpleasant surprise if you did the override months or years ago and haven't thought much about it since. This issue is why the duplicate message was added in Arduino 1.6.3 (I'm the one who contributed it....)

But editing the copies inside Arduino comes with downsides too. If you reinstall Teensyduino, those files are overwritten, so you definitely should make a backup copy of your work outside of Arduino. Likewise, when you upgrade to a new version of Arduino, it won't have you edits unless you go to the trouble of installing your copy again.

If your changes to the library are useful, you can send them as a pull request on github, to get them merged into the official library. This also isn't always an easy path, as I can be a bit picky about some details. But once merged, then your change become part of the official library. They'll be included in all future versions, and if other stuff changes in the library, odds are good I or others will update your code as part of those changes.
 
I may have messed something in my environment.
The code here never gets out of the while loop.
Code:
#define ledPin                       13
#define THRESHHOLD                   1500 
#define touchPin                     A1
 
 void setup()   {  
   pinMode(ledPin, OUTPUT);                 
   Serial.begin(9600);
   while (!Serial) {    // <--- Never gets out of this loop.
     digitalWrite(ledPin, HIGH);
     delay(2000);
     digitalWrite(ledPin, LOW);
     delay(100);
   }
   Serial.println("Starting...");
 }

 void loop()                     
 {
   if (touchRead(touchPin) > THRESHHOLD) {
     digitalWrite(ledPin, HIGH);
     Serial.print ("Touched");
   } 
   else {
     digitalWrite(ledPin, LOW);
     Serial.print ("Not...");
   }
   delay(100);
 }
Same result on two different Teensy 3.1's and with two different cables.
I went down the route of checking in the while loop because the Serial.println() statements were having no results.
I've checked the matching baud rate of the serial monitor
Tools\USB Type is Serial
Tools\Port is the one and only port listed (I can program the Teensy, but it no longer loads automatically on build... I need to press the button on the Teensy).

I'd like a process to start from scratch, and know that I have a clean environment.
I have a couple of Teensy 3.2's I could use as well, though I thought I should fix the issues here before proceeding.

Can someone point me at a recipe for a clean reinstallation?
 
See attached Arduino\About
 

Attachments

  • Screen Shot 2015-11-04 at 8.20.53 PM.png
    Screen Shot 2015-11-04 at 8.20.53 PM.png
    46.1 KB · Views: 127
Any other steps I should take?

Well, when the DMG opens, of course you double click the one and only program it has. That should run the installer. Keep clicking "Next". At some point, you must tell it the location of your copy of Arduino. Then after a few more Next buttons, it will add the Teensyduino stuff to your copy of Arduino.

After installing, run Arduino have. The Arduino > About menu will show the versions. It should now be 1.26-beta2.

You'll have to upload at least once by pressing the button. Installing on your computer doesn't magically replace the code on Teensy, so at least 1 upload is needed to get the El Capitan-friendly code onto your Teensy.
 
The screenshot above is after:
- running the new DMG
- reopening Arduino (and my code), pressing Verify... then the Teensy button to download it. I verified that modified code got to thee teensy (by varying the delays for blink on and off)
- pressing the upload button.
I get the same behavior (does not exit the while() loop), and I get this message after pressing Load
Code:
Sketch uses 16,344 bytes (6%) of program storage space. Maximum is 262,144 bytes.
Global variables use 4,616 bytes (7%) of dynamic memory, leaving 60,920 bytes for local variables. Maximum is 65,536 bytes.
Teensy did not respond to a USB-based request to automatically reboot.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
 
I can make it work on the Win7 machine (VMWare in Mac). Though it still reports trouble connecting to the serial port in the upload phase... it still uploads, and passes the Setup() phase - and successfully communicates with the Serial Monitor windows.
Back to the Mac... it can program the Teensy on pressing the Teensy button - but cycles in the SetUp() while() loop.
Hmmmm
Could this be a persistent of the El Capitan issue?
I could work on Windows for a while.
 
Well dang... shut down windows, restarted the Mac... and the download and serial monitor are working.
So, it looks like the fix was:
1) Update to the new Beta of teensiduino (1.26-beta2) on top of Arduino 1.65
2) restart Mac OS (El Capitan)

All is good now.
Thanks !
 
Status
Not open for further replies.
Back
Top