Show Posts
|
|
Pages: [1] 2
|
|
2
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: Setting Alarm Problem
|
on: January 22, 2011, 04:41:17 pm
|
|
i want to enter the values of hours,minutes,seconds from a serial interface (vb) and set the alarm on the value received , but the function Alarm.alarmRepeat(Hour,Minute,Second,EveningAlarm);
doesnt work unless it had a constant time value specified from within the arduino [glow]and again i need to send the value from a vb[/glow]
so I was wondering if there is a way to set the alarm in another way
note: I use #include <Time.h> #include <TimeAlarms.h>
|
|
|
|
|
3
|
Forum 2005-2010 (read only) / Syntax & Programs / Setting Alarm Problem
|
on: January 22, 2011, 01:59:45 pm
|
I want to set an alarm with a specified serially read time I've tried every thing i can ,I even created a new function inside the library but nothing get me there I need Help void loop() { digitalClockDisplay(); Alarm.delay(1000); if (Serial.available()>0) { char setString[TIME_SET_StrLen]; int index = 0; char c = Serial.read(); if( c != '[') return; // first character must be opening square brackets do { c = Serial.read(); if( isdigit(c)) // non numeric characters are discarded setString[index++] = c -'0'; // convert from ascii } while (c != ']'); // wait for trailing square brackets
int count = index; int element = 0; for( index = 0; index < count; index += 2) // step through each pair of digits { int val = setString[index] * 10 + setString[index+1] ; // get the numeric value of the next pair of numbers switch( element++){ case 0 : Hour = val; break; case 1 : Minute = val; break; case 2 : Second = val; break; } } } Serial.print(Hour ); Serial.print(Minute); Serial.print(Second); Serial.println("go to school"); Alarm.alarmRepeat(20,20,0, MorningAlarm); Alarm.alarmRepea(Hour,Minute,Second,EveningAlarm); // my new function it works fine but not with serial date } the function on the library AlarmID_t TimeAlarmsClass::alarmRepea(int H, int M, int S, OnTick_t onTickHandler){ return create( AlarmHMS(H,M,S), onTickHandler, IS_ALARM, IS_REPEAT ); }
|
|
|
|
|
7
|
Forum 2005-2010 (read only) / Syntax & Programs / read the clock value from my pc
|
on: January 22, 2011, 04:57:05 am
|
I'm making a vb code that a user would choose a time and write it to arduino and it will store it and set it as its time, i defined an array that send the time date parameters , then another array in arduino read them. but it doesnt work the variable types are wrong Any Help Please or another possible way to do this the arduino code #include <Time.h> #include <TimeAlarms.h> int time[6];
if (Serial.available()) { for (int i=1 ;i< 6; i++){ time[i] = Serial.read();} setTime(time[2],time[1],0,time[3],time[4],11);} // set time to ?:?:00 ? ? 2011 }
vb2008 code Dim dime(6) As Integer Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click dime(1) = Format(Now, "mm") dime(2) = Format(Now, "hh") dime(3) = Format(Now, "dd") dime(4) = Format(Now, "MM") For i = 1 To 4 myport.WriteLine(dime(i)) Next End Sub
|
|
|
|
|
12
|
Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino Duemilanove
|
on: November 14, 2010, 12:43:51 pm
|
|
ok right after i connected the board the computer turned off and every time i turned it on i got a blue screen with a Physical memory dump error, i could reach my files but it kept restarting, So please any suggestion now i want to connect it to another lenovo laptop with vista operating system and not sure of doing it
|
|
|
|
|
14
|
Forum 2005-2010 (read only) / Troubleshooting / Arduino Duemilanove
|
on: November 13, 2010, 12:57:44 pm
|
|
[size=14]Hello People I recently brought Arduino [glow]Duemilanove[/glow] when i connected it to my windows 7 laptop , the system crashed and it behaves as if the Duemilanove was an attacking object, it didn't accept it . now am afraid to connect it again after i fixed the PC.
I was very excited to use it, whats the problem and what shall I do ? :-/[/size]
|
|
|
|
|