Error code, can't figure it out

I'm trying to uploud my sketch on my Arduino MKR1000 but it won't work.
This is my code:

int red = 10;
int yellow = 9;
int green = 8;

void setup(){
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
}

void loop(){
digitalWrite(green, LOW);
digitalWrite(yellow, HIGH);
delay(3000);

// turn off yellow, then turn red on for 5 seconds
digitalWrite(yellow, LOW);
digitalWrite(red, HIGH);
delay(5000);

// red and yellow on for 2 seconds (red is already on though)
digitalWrite(yellow, HIGH);
delay(2000);

// turn off red and yellow, then turn on green
digitalWrite(yellow, LOW);
digitalWrite(red, LOW);
digitalWrite(green, HIGH);
delay(3000);
}

This is the error code:

De schets gebruikt 9208 bytes (3%) programma-opslagruimte. Maximum is 262144 bytes.

processing.app.debug.RunnerException
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:160)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:709)
at processing.app.SketchController.exportApplet(SketchController.java:682)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2190)
at java.lang.Thread.run(Thread.java:745)
Caused by: processing.app.SerialException: Fout bij het aanspreken van de seriƫle poort "COM4"
at processing.app.Serial.touchForCDCReset(Serial.java:87)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:144)
... 5 more
Caused by: jssc.SerialPortException: Port name - COM4; Method name - openPort(); Exception type - Port busy.
at jssc.SerialPort.openPort(SerialPort.java:164)
at processing.app.Serial.touchForCDCReset(Serial.java:81)
... 6 more

Plz help... :frowning:



Don't mind the double pic :stuck_out_tongue:
but this is how my setup looks like

(ps if someone knows a better way to attache my cables onto my arduino, you can always let me know)

Please edit you post to have the code and the error in (two separate) code tags. See How to use the forum.

Second, of all the boards you thought this was the right one??? [update]Fixed by mod[/update]

The error tells you the serial port is somehow busy. The error probably ends in something like "Error opening serial port 'COM4'. (Port busy")" but you didn't copy the full error (hence the "6 more" at the bottom).

Reconnected it? Is it the right COM port?

Can't help you any more with it because of the lack of experience with the MKR1000.

robbeverhelst:
(ps if someone knows a better way to attache my cables onto my arduino, you can always let me know)

Or course, get a soldering iron!

I'v tried both allready, but it still won't work :frowning:
I also don't know how to copy the full error code (complete noob)

But if I use a soldering iron i can't make it loose again or can I?

When it reports that a serial port is busy, that usually means another program on your computer is using the port. Identify and close that program. Reboot the system if needed.

Sometimes, software meant to interact with some specific serial device will automatically glom onto any serial port you connect and try to talk to it as if it's whatever device the software was meant to work with.