using mac with Arduino zero. When I write at 9600 baud get "board at com1 not available" with no I/O. See setup. Am using programming port USB only.
Can I increase the baud rate? 9600 pretty slow. Is this the usual rate?
What does "shutdown command invoked" mean after target is reset? Something I should worry about? Is that the reason the loop pin2 toggle does not work?
const int statusPin = 2; // status pin
char statusPinStatus;
unsigned long int nextTime;
const unsigned int nextTimeDelta = 100; // num 4 usec steps
void setup()
{
int intLength;
pinMode(statusPin,OUTPUT); // status line set to an output
statusPinStatus = 0;
digitalWrite(statusPin,LOW); // set to low
Serial.begin(9600);
intLength = sizeof(nextTime);
Serial.print("integer length in bytes: ");
Serial.println(intLength);
nextTime = micros() + nextTimeDelta;
}
void loop()
{
char statusPinStatus;
if (nextTime == micros())
{
nextTime = micros() + nextTimeDelta;
if (statusPinStatus == 1)
{
statusPinStatus = 0;
digitalWrite(statusPin,LOW);
}
else
{
statusPinStatus = 1;
digitalWrite(statusPin,HIGH);
}
}
}
Its the same port I use to upload the code. Whatever it is. Arduino can't talk back although all the examples make this a snap. Nothing else hooked to the mac. Maybe operator error -- where does Serial write its stuff? I run the code and it resets and I active the monitor in the app.
I am using 9600 since that is in all the examples. Is it right?
Unplug your USB cable from the Arduino, then look at the "ports" under the "Tools" dropdown menu. Note which ports are shown. Now hook the USB cable to the arduino, and there should be a new port showing. That's the one that you must use. Make sure that port has a check mark next to it in the "ports" menu. Now try to upload code. If you still have a problem, make sure that your Reset pin on the Arduino is not connected to anything. Also, since pins D0, D1 are used to program, leave them free of connections.
If none of this works, try leaving the USB plugged in, and reboot your MAC. I've been through this drill many times. If you get this far and still no success try a different USB cable, and/or a different Arduino. That just about exhausts the possibilities.