Hi!
I took my Arduino and build a device with it. I "hardwired" the Arduino board (since
I need the USB-Port) inside a box as a permanent installation.
To recieve a feedback that that Arduino is booted and ready I implemented a soundbuzzer
that beeps, when the Arduino is ready to recieve commands via USB.
The problem is that the Arduino does not boot/beep when USB is plugged in, <>. It also
does not accept any commands when it has not beeped.
Only when I upload the sketch again it works for a few times then this behaviour happens again.
I allready replaced the atmega (because after a while it didnt work anymore even when uploaded the sketch again)
but with the new one it happens again and now Im afraid that it will die too...
(Since I dont really know what the problem is I hope this is not the wrong forum)
This is my initialisation code:
//////////////////////////////////////////
// scribLAB´s CNC Control ////////////////
//////////////////////////////////////////
// SETUPS --------------------------------------------
#include <string.h>
#include "AxisCtrl.h"
#include <EEPROM.h>
#include "Speaker.h"
#include "ToolRemote.h"
//Axis Control
///////////////////////////
AxisCtrl x(12,9,7,200,0.8,10);
AxisCtrl y(11,9,6,200,0.8,30);
AxisCtrl z(10,9,8,200,0.8,40);
Speaker sp(5);
ToolRemote toolRemote(3,4);
//AxisControlButtons
///////////////////////////
boolean homeAll = false;
boolean homeZ = false;
boolean calibrateZ = false;
boolean selfTest = false;
int ledPin = 13;
long x2 = 0;
long y2 = 0;
long z2 = 0;
//Communication
///////////////////////////
String gCodeCmd = "G01";
String planeSel = "XY";
String cmdString;
boolean serialHandshake = false;
boolean cmdComplete;
boolean readyForNextCmd = true;
boolean otherCmdRecieved = false;
// SETUPS --------------------------------------------
void setup() {
//Serial conncetion
sp.begin();
toolRemote.begin();
sp.playStart();
cmdString.reserve(200);
Serial.begin(115200);
Serial.println("Init machine...#");
x.begin();
x.setDirOverride(true);
y.begin();
z.begin();
Serial.println("Machine ready.#");
pinMode(ledPin,OUTPUT);
//Establish contact
Serial.write("R");
}
What could be the problem? Software, hardware? :\
Thanks in advance!