In order to get the VB program to read in the NumScheduleItems I had to add the following line to make the following change.
PUB sendDataSerial|i,time,[b]data[/b]
[b]data := (NumScheduleItems/10)<<4+NumScheduleItems//10[/b]
ser.tx([b]data[/b])'So that you know how many items there are
I have changed the code their back to the original code.
repeat i from 0 to NumScheduleItems-1
time:=schedule[i]
ser.tx(time.byte[noparse][[/noparse] 0])
ser.tx(time.byte[noparse][[/noparse] 1])
ser.tx(time.byte[noparse][[/noparse] 2])
ser.tx(time.byte[noparse][[/noparse] 3])
[/i]
However I am still having trouble reading in the data properly.
Just thought I would keep you posted.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Post Edited (computer guy) : 2/12/2008 11:06:16 AM GMT
That would be because not all the numbers are stored as BCD. Only the hours and minutes are stored in BCD because that is the way the come out of the RTC.
I wasn't writing the fact that the memory had been cleared back to the eeprom
This is what I get when I don't figure out exactly what has to be done first. So the moral to the story is to always figure out exactly what needs to be done and how you are going to do it before you start coding.
Didn't see your edit. To make the forum accept it just put a space after the opening bracket like this [noparse][[/noparse] 0]. Whats the trouble with reading in the data?
Do you need to set the port speed somewhere? Also, what start/end bit settings are you using? That could be causing the problem although I would have thought that it wouldn't work at all if that was the case.
It works with sending a new schedule so that isn't a problem.
PUB sendDataSerial|i,time,data
data := (NumScheduleItems/10)<<4+NumScheduleItems//10
ser.tx(data)'So that you know how many items there are
repeat i from 0 to NumScheduleItems-1
time:=schedule[i]
ser.tx(time.byte[noparse][[/noparse] 0])
ser.tx((time.byte[noparse][[/noparse] 1]/10)<<4+time.byte[noparse][[/noparse] 1]//10)
ser.tx((time.byte[noparse][[/noparse] 2]/10)<<4+time.byte[noparse][[/noparse] 2]//10)
ser.tx(time.byte[noparse][[/noparse] 3])
[/i]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Post Edited (computer guy) : 2/12/2008 8:05:59 PM GMT
If the forum didn't eat the brackets it should be this
PUB sendDataSerial|i,time,data
data := (NumScheduleItems/10)<<4+NumScheduleItems//10
ser.tx(data)'So that you know how many items there are
repeat i from 0 to NumScheduleItems-1
time:=schedule
ser.tx(time.byte[noparse][[/noparse] 0])
ser.tx((time.byte[noparse][[/noparse] 1]/10)<<4+time.byte[noparse][[/noparse] 1]//10)
ser.tx((time.byte[noparse][[/noparse] 2]/10)<<4+time.byte[noparse][[/noparse] 2]//10)
ser.tx(time.byte[noparse][[/noparse] 3])
Edit: Okay, the forum is eating the brackets so it should be like this which I think is what you've got
Thank you,
I worked it out. I am using a prototyping board and a pin got pushed up so it wasn't making contact.
I am loosing the hour now. Am sure it is something simple though.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Thats probable my fault. I think it is setting up the clock for 12 hours and not 24. change this
[code]
PUB config
write($90,$a6) ' Init chargeing register 1010 0110 charge activ
Ok Thank you,
Will try that.
I ran a test and all works well.
Just one thing. I might be getting fussy but would it be possible to get the do instruction to only execute if not already running.
Like
PUB doInstruction(instruction)
'This will turn on/off whatever pin or do whatever else we want to do
'Could even hoopup one of the timers so that we could get a PWM output
case instruction
start1:
[b]if start1 := false[/b]
outa[noparse][[/noparse]pin1]~
text.str(string(13,"called code start1"))
stop1:
[b]if start1 := true[/b]
outa~~
text.str(string(13,"called code stop1"))
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Yes you could but you would need an extra variable like this
VAR byte start1Running
PUB doInstruction(instruction)
'This will turn on/off whatever pin or do whatever else we want to do
'Could even hoopup one of the timers so that we could get a PWM output
case instruction
start1:
if start1Running == false
start1Running==true
outa[noparse][[/noparse]pin1]~
text.str(string(13,"called code start1"))
stop1:
if start1Running == true
start1Running:=false
outa~~
text.str(string(13,"called code stop1"))
Just make sure that you change the ':=' to '==' in the if statements. I often make that mistake. Are you still having problems with the serial?
I love the resizable text input boxes in Safari, makes it much easier to type in code when you can see all of it
That may be the two I put in at the start of the program to test with but I don't think that those were the values that I was using. If its not can you archive and post the project?
Comments
I should have the matchport by mid next week.
Look forward to the challenge.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
I have changed the code their back to the original code.
However I am still having trouble reading in the data properly.
Just thought I would keep you posted.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Post Edited (computer guy) : 2/12/2008 11:06:16 AM GMT
Just noticed you need to change this
to
I wasn't writing the fact that the memory had been cleared back to the eeprom
This is what I get when I don't figure out exactly what has to be done first. So the moral to the story is to always figure out exactly what needs to be done and how you are going to do it before you start coding.
The data received displayed as a string in a text box is.
This is for 4 schedules.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
schedule 1 - Sunday, 0 hours, 0 minutes (0:00 am), instruction code 1
schedule 2 - same
schedule 3 - Monday - then same
schedule 4 - Sunday, 1 hours, 0 minutes (1:00 am), instruction code 1
Is this what you get on the TV screen?
00:00 Sunday 01
01:00 Sunday 01
01:00 Sunday 02
01:00 Monday 02
if I send 's' and read in the data again I get
then again
then
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Post Edited (computer guy) : 2/12/2008 11:53:01 AM GMT
Check out the previous post, I have edited it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Post Edited (computer guy) : 2/12/2008 8:05:59 PM GMT
It is getting late for me.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Edit: Okay, the forum is eating the brackets so it should be like this which I think is what you've got
When I receive each byte I store it in a byte array then use the .ToString command to convert it to a string for displaying it in the textbox.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
and modified the code to get the time from the RTC.
I also added this line
except it prints
Why would this be.
I have tried to set the time just after config of the RTC using this
witch corresponds with this
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
I worked it out. I am using a prototyping board and a pin got pushed up so it wasn't making contact.
I am loosing the hour now. Am sure it is something simple though.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
[code]
PUB config
write($90,$a6) ' Init chargeing register 1010 0110 charge activ
Will try that.
I ran a test and all works well.
Just one thing. I might be getting fussy but would it be possible to get the do instruction to only execute if not already running.
Like
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Just make sure that you change the ':=' to '==' in the if statements. I often make that mistake. Are you still having problems with the serial?
I love the resizable text input boxes in Safari, makes it much easier to type in code when you can see all of it
Ok I'll stop being a mac fanboy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
I can override them and all is fine.
How can I make it so that clear really does clear.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Here is the code I have.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Post Edited (computer guy) : 2/13/2008 12:56:43 AM GMT
repeat i from 0 to numScheduleItems-1
so it was looping from 0 to -1 instead of not doing anything
now it does
which works much better
You'll have to change the constants back and I added another constant for the TV pin