|
781
|
Using Arduino / LEDs and Multiplexing / Re: LED and photoresistor
|
on: January 27, 2011, 06:33:44 pm
|
The original code will be "true" unless the sensor is in the very very dark (or light, depends on your circuit) if (analogRead(lightPin)) { should be if (analogRead(lightPin) > 500) { Pick any value between 1 and 1023 to be the trigger value. (If you are not using Serial.<otherfunctions> elsewhere in the code then you do not need the Serial.begin in the setup)
|
|
|
|
|
787
|
Community / Bar Sport / Typo in the forum heading?
|
on: January 27, 2011, 02:50:10 am
|
Forum heading: jokes, mobs, and all sorts of unrelated topics, shout out loud your love, and course for that burnt battery-pack I don't get the last bit...? was course intended to be spelled curse ?
|
|
|
|
|
790
|
International / Scandinavia / Börja om från begyndelsen
|
on: January 26, 2011, 04:16:48 pm
|
Hejsan alla Skandianvier, så må vi begynde fra början.  Jo jag er både Svensk/Dansk og har Norska venner... och så bor jeg i Oresundregionen (which for international purposes is spelled wrong ...) Msquare
|
|
|
|
|
793
|
Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Arduino example MIDI Note Player will not compile.
|
on: October 02, 2010, 01:11:49 am
|
Hi vanakaru, as David so kindly points out, given just the error messages, is that it seems likely that a typing error (yours, the webpage, whereever) has omitted the space between the word int and the word note some where in the code. That is a good guess, because if it said "int note" that would define the variable "note" and thus elliminate both errors (defining the right names) And - voila - your 2nd post shoing the code clear shows this. for (intnote = 0x1E; note < 0x5A; note ++) {
should be for (int note = 0x1E; note < 0x5A; note ++) {
|
|
|
|
|
795
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: Long delay
|
on: January 20, 2011, 12:22:49 pm
|
delay(25200000) // :) It is ok, there is room for 4 294 967 296 milliseconds - it is a unsigned long parameter. If you need to have both a one second and a 7 hour, then use the method outlined i the NoDelayBlink, where you loop and check if milli() has increased 25200000 since you last "fired" the 7 hour code. And this will be acurate, evn if your 7 hour code takes minutes of CPU time (the milli() stuff increments via a timer interrupt) The acuracy is limited by the crystal. It will be in the same ballpark accuracy wise as any ordinary watch.
|
|
|
|
|