So I use the + icon to open a new file, name it widget.h and I also get a widget.cpp.
When I cut some code and paste it into the .h file it also gets pasted into the .cpp.
Is this expected? I would expect the .cpp to remain blank.
So I use the + icon to open a new file, name it widget.h and I also get a widget.cpp.
When I cut some code and paste it into the .h file it also gets pasted into the .cpp.
Is this expected? I would expect the .cpp to remain blank.
HI @rowifi -
I just want to make sure I understand correctly, are you building a new sketch from scratch correct, by copying and pasting come exits code? If this is the case, the IDE should open up with only setup() and loop().
From here you can simply name the “app” you are creating, I assume widget based on your message above.
Do you need top create the .h and .cpp file? or simply .ino? I just did a test, I get the same result when indeed creating .cpp and .h files as well. Seems to be normal behaviour then.
I found you have to click on the .ino first after creating the file. Then select the.h or .cpp, then paste.
Hi
To be honest - I’m having a number of weird problems.
Having successfully copied a project that uses a library 'pubsubclient which worked.
Shane, it’s not the first time I’ve played with particle, but it was a long time ago. I like to think I’m not dim, but there seem to many weird behaviours. I’m using the Web IDE
Mmm I use the WebIDE for quick stuff and tests. I have installed workbench and after a learning curve I am much happier now. Definitely worth the investment in time and you can still flash via the cloud. The features I use the most are autocomplete and intellisense
HI @rowifi -
I am by no means an expert, and you will probably get some really cleaver advice from guys like @shanevanj, but to be honest, have not had much success with custom libraries and WebIDE.
I had a similar issue a while back which I resolved using Particle workbench (Visual Studio Code extension) and the CLI instead.
Installing a custom library using the CLI is seamless!! Apologies if I ask trivial questions but I’d rather be thorough and make sure I understand the problem
EDIT – Agree with @shanevanj
OK. Thanks for the info. I have tried workbench years ago, so may revert to that.
This is not expected but a known quirk.
I just hit Ctrl+A and Del followed by Ctrl+S to get rid of the duplicate. Or if the .cpp
is not needed, just X it away.
Your issue with the "not found" header file is also such a quirk. Sometimes it's enough to just change #include "some.h"
to #include <some.h>
or the other way round to make Web IDE realise that the file is there after all.
Not nice but once you get used to these quirks Web IDE can be useful for smaller projects.
Hi @rowifi -
I will agree with @ScruffR. If the duplicate text in the .cpp file is the only problem that can be solved by:
, I would be happy to continue using WebIDE. For most of my projects I use WebIDE, but full disclosure, they might not be nearly as complex as some projects in this forum. To me it is 'easier to use'
I have used WebIDE for this project, which was my most complex one to date. The only hurdle I ran into was I was unable to get a particular custom library to function. I would pin this rather on me not being able to get it to work as apposed to a WebIDE problem.
Having said this, I managed to add this particular library using Workbench and CLI in a couple of seconds. I recon there is scope for both, depending on your need.
Best of luck!!