Hello everyone I am trying to figure out if my arduino is damaged or that I am stupid.
I am working with a crowdino M0-SD v1.0 on my Windows 10 laptop(connected through USB cable).
When I upload a sketch the crowduino first seems to disconnect(usually from COM 7 to COM5 to COM7 again) and then I assume the code is uploaded. Because the updating non-'blink' code and the blink code changes the behaviour of the LED.
The only working thing in my codes seem to be the LED.
for example when I run the following code:
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.println("Test");
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
Serial.print("Help");
delay(1000); // wait for a second
}
The LED turns on and off every 1 second, but the serial monitor has no output(BAUD rate are the same and the COMs match).
Moreover, another code in which I try to turn on the Crowtail Laser pointer v1.0, with the example code giving by the company, the laser does not turn on(yes I made sure that I wrote to the correct pin).
Also, I am using a crowtail base shield if that is relevant.
I was thus wondering is the issue somewhere in the upload or is it more likely that my crowduino is damaged? Or something else very basic that I do not know in my lack of experience.
Any help is greatly appreciated and any lack of clarity I'll try to get rid of
It does not sound like an upload issue as you state that the blink sketch and the blank sketch result in different behaviour.
I'm not familiar with the M0 but to my knowledge it has native USB functionality and the usual approach when using serial is to wait for the connection to be established as shown in setup below.
Close serial monitor and compile and upload; the LED should flash quite quickly. Next open serial monitor and and the rate should change and the message should be displayed in serial monitor.
I ran the code Sterre gave me and it did seem to have a startup period in which the LEDs blink very fast, which is then followed by the LED blinking every second, but sadly no serial port output.
When I double reset I get the following ports:
COM 4
COM 5 (arduino M0)
(selected) COM 7
In device manager I indeed got Port 5 to be the (BOOTLOADER MODE native port)
According to the text you get underneath the online editor(Arduino create) says that my upload port is COM 5, but the serial monitor can only be taken of COM 7. COM5 seems the port that always appear when I upload and disappear again after the upload. Would it be useful to send the verbose output?
The code for the laser is the following: The digital pin I use is pin D5.(on the base shield)
Do you think the error lays with the Arduino or something else? I'm using this for a school project and we can return it, the main issue being the time cost of that. Do you recommend replacing the Arduino or are there other things I should do before returning it?