Show Posts
Pages: 1 ... 7 8 [9] 10 11 ... 23
121  Using Arduino / Programming Questions / Re: DS1307 RTClib on: June 24, 2013, 11:45:41 pm
Thanks !

It is just because my array basic is not strong. So I misunderstand about that.

Appreciate your help ! smiley
122  Using Arduino / Programming Questions / Re: DS1307 RTClib on: June 24, 2013, 11:19:02 pm
So if DOW[1][4], it will display MON ?
123  Using Arduino / Programming Questions / Re: DS1307 RTClib on: June 24, 2013, 11:00:38 pm
You can do:

Code:
char DOW[][4]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
lcd.print(DOW[now.dayOfWeek()]);

Quick and easy. BTW, the DOW could be either starting with Sunday or Monday so you may need to change some orders.
Hey, I do not understand your coding. Why you put
Code:
char DOW[][4]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
lcd.print(DOW[now.dayOfWeek()]);
char DOW[][4] ? What is the 4 for ?

Thanks
124  Using Arduino / Programming Questions / Re: DS1307 RTClib on: June 24, 2013, 10:58:00 pm
You can do:

Code:
char DOW[][4]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
lcd.print(DOW[now.dayOfWeek()]);

Quick and easy. BTW, the DOW could be either starting with Sunday or Monday so you may need to change some orders.
I do like this :
Code:
lcd.setCursor(0, 3);
   int dayofweek = now.dayOfWeek();
   switch(dayofweek){
     case 1:
     lcd.print("Monday");
     break;
     case 2:
     lcd.print("Tuesday");
     break;
     case 3:
     lcd.print("Wednesday");
     break;
     case 4:
     lcd.print("Thursday");
     break;
     case 5:
     lcd.print("Friday");
     break;
     case 6:
     lcd.print("Saturday");
     break;
     case 7:
     lcd.print("Sunday");
     break;
    delay(1000);
}
Think it is ok too smiley
125  Using Arduino / Programming Questions / Re: DS1307 RTClib on: June 24, 2013, 10:39:56 pm
I believe the OP wants a solution using the RTClib, not the library-less direct access. Take a look here:

Code:
class DateTime {
public:
    DateTime (uint32_t t =0);
    DateTime (uint16_t year, uint8_t month, uint8_t day,
                uint8_t hour =0, uint8_t min =0, uint8_t sec =0);
    DateTime (const char* date, const char* time);
    uint16_t year() const       { return 2000 + yOff; }
    uint8_t month() const       { return m; }
    uint8_t day() const         { return d; }
    uint8_t hour() const        { return hh; }
    uint8_t minute() const      { return mm; }
    uint8_t second() const      { return ss; }
    uint8_t dayOfWeek() const;

    // 32-bit times as seconds since 1/1/2000
    long secondstime() const;  
    // 32-bit times as seconds since 1/1/1970
    uint32_t unixtime(void) const;

protected:
    uint8_t yOff, m, d, hh, mm, ss;
};


Since you can do all the date and time already, you should understand this:

Code:
DateTime now;
now=RTC.now();
dayofweek=now.dayOfWeek();
lcd.print(now.dayOfWeek(), x);
what should be the x so that it print words like Tuesday ?
Ok, maybe for dayofweek dont have such thing. I think I have to make case structure for this. Cause now.dayofweek() will return only int. So I have to do case structure. Am I right ?

Thanks
126  Using Arduino / Programming Questions / DS1307 RTClib on: June 24, 2013, 12:05:21 pm
Dear all,

I have started to play around with ds1307 IC and I am using the rtclib from adafruit.
I can get seconds, minutes, hours and date.

Am I able to obtain the day too ? For eg Monday, Tuesday , wednesday ?

Thanks !
127  Using Arduino / Project Guidance / Re: L293D motor driver on: June 23, 2013, 11:29:15 am
Opps, it suppose to be the input pins. Sorry I get it wrongly. The output pins is connected to motor

Thanks
128  Using Arduino / Project Guidance / Re: L293D motor driver on: June 23, 2013, 11:00:42 am
Oh, do I need to deal with the enable pin in the IC or just the output pins of the IC ?
129  Using Arduino / Project Guidance / Re: L293D motor driver on: June 23, 2013, 10:55:51 am
Then how I interface/program it ?

Thanks
130  Using Arduino / Project Guidance / L293D motor driver on: June 23, 2013, 10:50:12 am
Hey all,

Recently I have tried to interfacee DC motor using L293D motor driver. It works fine for me in controlling the motor in either clockwise/anticlockwise at a constant speed.

However, I would like to ask if how am I able to change the speed ? Liek maybe I want it to change at right at full speed and half speed ? Can I do that with arduino UNO ?

Thanks !
131  Using Arduino / Installation & Troubleshooting / Re: DIY Arduino problem on: February 06, 2013, 09:33:42 pm
Yea, so I neeed a pull up resistor smiley-grin

Thanks ^^
132  Using Arduino / Installation & Troubleshooting / Re: DIY Arduino problem on: February 06, 2013, 09:55:38 am
So, the minimum circuit for an arduino based development board is a 16MHz crystal and the 100nF cap for power supply and pull up resistor for RESET pin ?

No, you can use the internal oscilator (there is a fuse). And the reset is not required. The minimum is just the cap for the supply

Why reset is not required ? I thought RESET should be pulled up for normal usage ?

Thanks smiley-grin
133  Using Arduino / Microcontrollers / Re: Attiny 85 on: February 06, 2013, 08:40:49 am
USBasp consider HVP ? Oh, so for normal usage, I onyl can use 5 pins ?

Thanks
134  Using Arduino / Microcontrollers / Attiny 85 on: February 06, 2013, 08:35:01 am
Dear friend,

recently I get myself some attiny85. So, by referring to the datasheet, it mention it has 6 programmable I/O. But I just only can see there are 5 programmable IO only. Is it that the RESET pins also can be the IO  ?

Thanks
135  Using Arduino / Microcontrollers / Re: The 0.1uF capacitors when using FTDI programmer on: February 04, 2013, 11:40:18 am
But the timing has to be right, hold down the reset, select the program from the IDE, when it says loading, count one two three, and release the reset.
I have tried this ! It's really do work well ! But the timing really have to be correct. Have to release the RESET button once the IDE shows 'uploading..'

Thanks ! Finally I understand why is there a cap there- to bring the RESET High and LOW. smiley

When I want to upload a new sketch, the we should RESET our microcontroller so that the previous sketch is deleted and pull the RESET HIGH to allow the new program to load into ?

Am I correct ?

Thanks !
Pages: 1 ... 7 8 [9] 10 11 ... 23