Code

JS: Optional parameter default true

Just a short note: If you want to have an optional boolean parameter and have the default value to be false, you can use the property of a boolean to be false if it’s either undefined, null, 0 or false, so just evaluating opt_booleanParameter would evaluate to false it the parameter is omitted (I use that &hellip Continue reading »

Categories: Code | Tags: , , , , | 160 Comments

Game Block: One step closer

…continued from Touch game for the offspring. I had a naive thought that this would basically be the final rig, but then got to think  that I might want to add a power switch and a speaker / buzzer of sorts. But other than that I want everything to work by touch interaction. I’ve already &hellip Continue reading »

Categories: Code, Electronics | 153 Comments

Touch game for the offspring

I thought about making a simple (bulky) touch game device for my daughter comprising an Arduino board, an LCD display and a replacement touch panel for a Nintendo DS. Sounds simple enough, but given that I am a complete electronics (and in any practical sense; a C++) novice, I believe it will be somewhat challenging &hellip Continue reading »

Categories: Code, Electronics | Tags: , , , | 148 Comments

Alternating directions

Just a quick thought :) If you want to alternate between -1 and 1 in a for-loop, say for the purpose of changing direction or something similar, and you don’t want to add an extra variable to manually alternate in each run-through, this works just fine: for (int i=0; i < something; i++){ dir = &hellip Continue reading »

Categories: Code | Tags: | 103 Comments