I am just playing around for a project in school (uploaded my code in this post) , with 0 programming skills and have som difficulties with my code (wonder why).
As you can see, you can click on all the different modes (the colors displayed on the wheel), but not in the middle without it being called "undefined". I seemed to have fixed the problem before but after coding some more it showed up again, only this time I couldn't fix it.
I want it to say "Set mode" if I click on the white circle in the middle and did as I did with the others:
switch (true) {
case (Color == standard_green):
switchMode("Friends");
break;
case (Color == standard_red):
switchMode("Work");
break;
case (Color == standard_pink):
switchMode("Exercise");
break;
case (Color == standard_blue):
switchMode("Study");
break;
**case (Color == standard_white): switchMode("Set mode");
break;**
}
});
But it won't work.
My other problem is that I wan't my code to itterate through 20 pictures, but it only itterates through 10.
I've defined the image variables and put them in a list:
let blue_images = [
blue_image_1, blue_image_2, blue_image_3, blue_image_4, blue_image_5,
blue_image_6, blue_image_7, blue_image_8, blue_image_9, blue_image_10,
blue_image_11, blue_image_12, blue_image_13, blue_image_14, blue_image_15,
blue_image_16, blue_image_17, blue_image_18, blue_image_19, blue_image_20
];
Anyone who knows what the problem is with the code?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi!
Link to the code I am recreating:
https://www.espruino.com/ide/?codeurl=https://rozek.github.io/BangleApps/apps/colorwheel/app.js&upload&emulator
I am just playing around for a project in school (uploaded my code in this post) , with 0 programming skills and have som difficulties with my code (wonder why).
As you can see, you can click on all the different modes (the colors displayed on the wheel), but not in the middle without it being called "undefined". I seemed to have fixed the problem before but after coding some more it showed up again, only this time I couldn't fix it.
I want it to say "Set mode" if I click on the white circle in the middle and did as I did with the others:
switch (true) {
}
});
But it won't work.
My other problem is that I wan't my code to itterate through 20 pictures, but it only itterates through 10.
I've defined the image variables and put them in a list:
let blue_images = [
blue_image_1, blue_image_2, blue_image_3, blue_image_4, blue_image_5,
blue_image_6, blue_image_7, blue_image_8, blue_image_9, blue_image_10,
blue_image_11, blue_image_12, blue_image_13, blue_image_14, blue_image_15,
blue_image_16, blue_image_17, blue_image_18, blue_image_19, blue_image_20
];
Anyone who knows what the problem is with the code?
Thank you! :)
2 Attachments