Hi!
I just switched over from an Arduino Uno using to an adafruit feather. On the UNO, I had been using softserial to send very simple 1 digit codes to Pure Data (running on a rasberry pi). It was workign fine.
Now I am trying to do the same thing but using native USB and Serial rather than softserial.
However, it will not send any data to PureData until I have opened the serial monitor using the arduino IDE once. As soon as I've opened the serial monitor and then closed it again, I can go back to pure data, open the comport there and send whatever data I want and it works fine. However, until I've opened the serial monitor at least once, no data comes through AT ALL to pure data.
I can't figure why this would be.
Here's the relevant portions of the code (HUGELY simplified....)
#include "Arduino.h"
int incoming;
int button;
int RecPress = 0; // send 1 to pure data (pure data uses this to trigger "RECORD")
#define R_switch A1
void setup()
{
Serial.begin(9600);
}
void loop()
{
// INCOMING DATA PROCESSING
if (Serial.available() > 0)
{
incoming = int(Serial.read());
}
RecPress=digitalRead(R_switch);
if (RecPress==HIGH&&recflag==0){
button=1;
recflag=1;
}
if (button>0) {
byte data=byte(button);
Serial.write(data);
delay(350);
button=0;
}
}
I'm new to using serial rather than softserial so I'm sure I'm missing something basic...
Thank you