Not having enough line to write a scetch in Arduino

I am trying to write a scetch called interactive traffic lights from DF Robots projects no 03. I am running out of lines to write on, it stops on 10 I am running IDE 2.0.3.

1 Like

Hi Klaas,

I haven’t been able to replicate the issue you are having on my machine though I am running Arduino IDE 1.8.13 (probably due for an update).

I’ve included the images you emailed me earlier so that others can see the issue from your perspective.
I’m quite stumped as to why a simple carriage return wouldn’t be enough to force the IDE to add a new line.
What happens if you open a built-in example that uses more than 10 lines of code? Like the built-in AnalogReadSerial example?

1 Like

Hi Klaas
I too just copied and pasted the whole sketch from the DfRobot site straight into Arduino IDE 1.8.19. Right to line 133.
Cheers Bob

1 Like

I can’t repeat the problem using 2.0.3. File/New creates a sketch of 10 lines, but extra lines can be added as required. Example sketches of more than 10 lines open without any missing lines. Inserting lines before or after #10 works OK.

1 Like

Can you give me the link to that code.Thank you.

Do you mean this?

What happens when you press Enter at the end of line 10? For instance, does the cursor move at all, or is there a strange character inserted, or a beep, or a message, or something else?

What happens if you move the cursor to a line above line 10, and press Enter? Is a blank line inserted, and, if so, what happens to the existing line 10?

Can you add text to the end of line 10?

What happens if you delete a line before line 10 - can you then add another 10th line and it stops again?

What happens if you delete line 10 (all of it - right up past the end) and try adding it again?

What was the result when you loaded one of the examples that has more than 10 lines?

Hi Klaas
The sketch I loaded successfully is the same one as Jeff just linked.
For what it is worth I deleted everything on the new sketch before copying. Thus :::

From the menu bar select “New”
select and delete everything there ("void setup(), void loop() etc.
select entire sketch from DfRobot page (Jeff’s link).
Copy and paste to “New” sketch which should be empty.
Sketch from DfRobot page should now be in Arduino sketch in its entirety.

If not there is something drastically wrong somewhere.
Deleting the original “New” sketch framework should not make any difference to the copy process but it will have to be deleted sometime as it will be duplicated if you just copy from line 10 and I am not sure how Arduino would handle this.
Cheers Bob