-
• #2
Ignore me, I worked it out sorry
-
• #3
Yes, sure! You can do:
if (process.env.BOARD=="EMSCRIPTEN") { ... }
You could even set certain values in there, for example
Bangle.isCharging = ()=>false;
just simple Bangle.isCharging() ... and that course the emulator to fail.
That's odd - just tried it here and it seems to work fine?
-
• #4
Just while I have brought it up is there a way to set values for the bangle on the emulator? I.e. if I wanted it to seem like the bangle was not charging etc?
-
• #5
Sorry you answered that above
Hi
Just getting started on a new app and I wanted to try things out on the emulator before I do anything with the watch, this is the way I have played with a lot of other peoples code on here and I really like that I can do that with this IDE.
That said I have a part of my current project that asks the bangle if it is charging (just simple Bangle.isCharging() ) and that course the emulator to fail.
As this is not an important value for the app I am doing, I was wondering if there was a way to set values for things like this when in the emulator?
I mean is there a way to check if the code is being run in an emulator and as such be able to suply value to get it to run?