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.
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.
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
function wakeUp()
{
// Schedule the next state change
imp.wakeup(2, wakeUp);
}
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)