Show Posts
Pages: [1] 2 3 ... 1907
1  Using Arduino / Project Guidance / Re: What sensor do I need? on: September 17, 2014, 03:27:24 pm
Ultrasound?
IR?
Hands are quite soft, and don't necessarily reflect either very well.
2  Using Arduino / Motors, Mechanics, and Power / Re: Question from a really new Newbie :) on: September 17, 2014, 02:41:22 pm
Quote
Those tiny motors in phones consume how much power?
I've measured in excess of 70mA.
3  Using Arduino / Installation & Troubleshooting / MOVED: arduino strucks on Serial.println(); SRAM or other fault on: September 17, 2014, 11:07:54 am
This topic has been moved to Programming Questions.

http://forum.arduino.cc/index.php?topic=267401.0
4  Using Arduino / Programming Questions / Re: arduino strucks on Serial.println(); SRAM or other fault on: September 17, 2014, 11:07:38 am
Post code, not screenshots.
5  Using Arduino / Programming Questions / Re: Problem using while statement please help on: September 17, 2014, 09:51:13 am
Code:
unsigned long sec;
      unsigned long A;
      A=millis();
      while(sec < 120000){
What do you think the value of "sec" is, entering the while loop ?
6  Using Arduino / Programming Questions / Re: I HATE C!!!! - DaysBetween on: September 17, 2014, 07:12:21 am
Code:
#define SECONDS_IN_MINUTE 60UL
#define MINUTES_IN_HOUR   60UL
#define HOURS_IN_DAY      24UL
#define DAYS_IN_YEAR     365UL
#define SECONDS_IN_HOUR (SECONDS_IN_MINUTE * MINUTES_IN_HOUR)
#define SECONDS_IN_DAY  (SECONDS_IN_HOUR * HOURS_IN_DAY)

// Put your target date here.
const int targetYear    = 14;
const byte targetMonth  = 12;
const byte targetDay    = 25;
const byte targetHour   = 0;
const byte targetMinute = 0;
const byte targetSecond = 0;

const unsigned int monthdays[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};

unsigned long targetDate = secondsSince2000(targetYear, targetMonth, targetDay, targetHour, targetMinute, targetSecond);

void setup(void)
{
   Serial.begin(9600);
   timeToTarget();
}

unsigned long secondsSince2000(unsigned long year, byte month, byte day, byte hour, byte minute, byte second)
{
  return (((unsigned long)year) * DAYS_IN_YEAR * SECONDS_IN_DAY) +   
         ((((unsigned long)year + 3) / 4) + ((unsigned long)year % 4 == 0 && (unsigned long)month > 2)) * SECONDS_IN_HOUR +
         ((unsigned long)monthdays [month - 1] + (unsigned long)day - 1) * SECONDS_IN_DAY +
         ((unsigned long)hour * SECONDS_IN_HOUR)     +   
         ((unsigned long)minute * SECONDS_IN_MINUTE) +
          (unsigned long)second;
}

void timeToTarget ()
{
  char timeStr[80]; // old habits die hard
  // I don't have an RTC, so fake it.
  unsigned long now = secondsSince2000(14, 9, 17, 12, 0, 0);
  unsigned long dT = targetDate - now;
  int remDays = dT / SECONDS_IN_DAY;

  sprintf(timeStr,"%d days until Christmas!",remDays);
     
  Serial.println(timeStr);
}

void loop ()
{
}
98 days.
Yikes!
7  Using Arduino / Programming Questions / Re: Delaying process on: September 17, 2014, 05:20:03 am
Quote
I wanted to know how to delay a process without affecting main code.
Let us all intone the mantra
"Look at blink without delay, without delay. Ommmmm"
8  Using Arduino / Programming Questions / Re: Internet with Infrared sensor on: September 17, 2014, 05:18:32 am
I don't think that'll work with IRDA - it looks like a 38kHz detector.
9  Using Arduino / Programming Questions / Re: Internet with Infrared sensor on: September 17, 2014, 04:57:21 am
Didn't the PocketPC just use IRDA?
In which case, no modulation necessary - you've just got to match line speed and polarity.

(Cross-post deleted. Damn, I wasn't going to do that)
10  Using Arduino / Programming Questions / Re: I HATE C!!!! - DaysBetween on: September 17, 2014, 04:35:22 am
Code:
int remDays = dT/SECONDSINDAY;
Divide by 86400, or divide by 20864?
11  Using Arduino / Programming Questions / Re: I HATE C!!!! - DaysBetween on: September 17, 2014, 02:16:49 am
Code:
#define SECONDSINDAY 86400
BZZZZT
12  Using Arduino / Programming Questions / Re: Problem Inserting Small Sketch into Large Sketch on: September 17, 2014, 02:14:24 am
@MasonLev - mind your language.
13  Community / Bar Sport / Re: Who hasn't accidentally touched a mains voltage once or twice? on: September 17, 2014, 02:01:43 am
TWT psus were my pet hate.
OT: Mine too, briefly.
Or rather, the tubes themselves.

Being thermionic, they were very sensitive to thermal shock, and microwave stations had no climate control.
I was tasked with trying to find relationships between TWT failures, events and environment, and stations were usually
a) unmanned
b) remote
c) had only station logs to record faults.

I drove up a lot of mountains that summer!
14  Community / Bar Sport / Re: Who hasn't accidentally touched a mains voltage once or twice? on: September 17, 2014, 01:40:59 am
But, my middle name is still Danger.
So, sue your parents.
15  Using Arduino / Programming Questions / Re: Irregular time on: September 16, 2014, 03:21:43 pm
You also don't need the return values from your other functions, which you ignore anyway.
Pages: [1] 2 3 ... 1907