Serial trouble between IDE and Feather Basic Proto

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Hillcres_Hellio
 
Posts: 3
Joined: Mon Oct 22, 2018 11:46 am

Serial trouble between IDE and Feather Basic Proto

Post by Hillcres_Hellio »

Hi everyone,

I have a hard time uploading a piece of code in my Feather Basic Proto.

The problem goes like this: I click on upload on the IDE, i must always reset when uploading for IDE to find the serial port, the code is apparently uploaded, but when i want to open the serial monitor there is an error saying :
"the card on /dev/cu.usbmodem1421 isn't available" (translated from french)

Here is the code:

Code: Select all

#include <SD.h>
#include <SPI.h>
#include <TMRpcm.h>
#define SD_ChipSelectPin 10
TMRpcm audio;
int audiofile = 0;
unsigned long i = 0;
bool recmode = 0;

void setup() {
  pinMode(A0, INPUT);
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(2, INPUT_PULLUP);
  attachInterrupt(0, button, LOW);
  audio.CSPin = SD_ChipSelectPin;

   while (!Serial);
  Serial.begin(9600);
  Serial.println("Audio recording test. hello");

  if (!SD.begin(SD_ChipSelectPin)) {
    Serial.println("SD BAD :( ");
    return;
  } else {
    Serial.println("SD OK");
  }
  // The audio library needs to know which CS pin to use for recording
  audio.CSPin = SD_ChipSelectPin;

}


void loop() {
}



void button() {
  while (i < 300000) {
    i++;
  }
  i = 0;
  if (recmode == 0) {
    recmode = 1;
    audiofile++;
    digitalWrite(LED_BUILTIN, HIGH);
    switch (audiofile) {
      case 1: audio.startRecording("1.wav", 16000, A0); 
      Serial.println ("start recording 1.wav");
      break;
      case 2: audio.startRecording("2.wav", 16000, A0);
      Serial.println ("start recording 2.wav"); break;


       }}
  else {
    recmode = 0;
    digitalWrite(LED_BUILTIN, LOW);
    switch (audiofile) {
      case 1: audio.stopRecording("1.wav"); 
      Serial.println ("stopped recording 1.wav");
      break;
      case 2: audio.stopRecording("2.wav"); 
      Serial.println ("stopped recording 2.wav"); break;

      
       }}}
I think the problem comes from the code itself because every other sketches, examples i tried are well uploaded on the card.
Important thing to note: It was working yesterday.

Could anyone help?

User avatar
adafruit_support_carter
 
Posts: 29159
Joined: Tue Nov 29, 2016 2:45 pm

Re: Serial trouble between IDE and Feather Basic Proto

Post by adafruit_support_carter »

It may be assigning a new com port number to the board when it reconnects after being programmed. Check what shows up in Tools -> Port.

User avatar
Hillcres_Hellio
 
Posts: 3
Joined: Mon Oct 22, 2018 11:46 am

Re: Serial trouble between IDE and Feather Basic Proto

Post by Hillcres_Hellio »

When i click on the serial monitor icon, the port disappears from the list

User avatar
adafruit_support_carter
 
Posts: 29159
Joined: Tue Nov 29, 2016 2:45 pm

Re: Serial trouble between IDE and Feather Basic Proto

Post by adafruit_support_carter »

Not sure why it's doing that. What version of the Mac OS are you running? Are you using any kind of external USB hub for connecting the Feather?

Can you go back and get whatever was working here to work again?
every other sketches, examples i tried are well uploaded on the card.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”