What’s the easiest way to apply edits to a program and see them in operation?
So far my process is:
- Ctrl-S(Cmnd-S) to save the edited program.
- Click over to the tab where I have the planner open.
- Click the imp node.
- Swap it to running “Hello World” (or any other program)
- Swap it back to the program whose edits I want to see.
Intuitively, I’d figured the ‘Run’ icon in the code editor would accomplish the same effect, but it seems not.
On the current planner, you need to enter the editor from the icon on the planner. If you enter the editor from the code page it’s just editing the code, without the associated imp, hence no logging and no upload button.
Click slider icon on the impee, click edit code link. You will now be able to use the upload button (which used to be bound to cmd-U but that seems to be broken) to run the code after saving it.
Now the “Play” button is working for me.
No doubt I had something else messed up before.
Looks like the “Play” button isn’t active if you come to the code screen most ways.
It IS active if you click from the slider icon to Edit the running code.
btw, if the upload button works then server.log() output also appears below the editor. You really want to be in the “editor bound to an actual imp” mode, it’s a lot more pleasant
This is being reworked to be more developer friendly. You’re going to love it!
I like to keep a window open to the planner, and one open to a window I’m coding on at the same time. That way I can put server.show(debugVars) in the code and see the output in the planner window. (Server.log is also good, but server.show is happier for giving me a window on the current variable states without flooding the logs with a running tail.)
Now I know to open the planner window first, and then command-click (cntrl-click for PC users) on the “Edit” link to get it in a separate tab. Then the planner tab gets dragged off to be its own window.
That particular order of operations/path works to make sure that the editor recognizes the code I’m editing as being active code while giving me a simultaneous viewport on the code output.
Is the upload butt = Run code?
If I change anything in the following code and tries to run it (upload button), my PWM-signals disappear.I need to do a “Norwegian reset” to get the new code to execute alright. If I run “hello world” after PWM, the PWM-signals is still at the outputs.
// PWM 0.0
// 2012-08-08 MiKi
// Keep alive function
// Schedule the next state change
hardware.pin8.configure(PWM_OUT, 0.3, 0.5); // (PWM period, frequency , duty cycle)
hardware.pin9.configure(PWM_OUT, 0.3, 0.5); // (PWM period, frequency , duty cycle)
// Register with the server
imp.configure(“PWM 0.0”, , );
// End of code.