Help someone getting back into messing around with propellers..
bronzedragonpa
Posts: 5
in Propeller 1
I just got a propeller pro dev board, and am having a bit of fun with it, I tried to use the rtc and the 16 segment led displays to make a clock, but my attempt isnt working properly. instead of printing hours mins and seconds, its only printing the mins twice.. how can I make it easy for others to help me?
also I had a account under the name firehopper, but that was on a lavabit email account. (the lavabit servers shut down a long time ago) so I dont have access to that email account. so I cant reset the password for my old account to get access to it again.. dont know where to go for help for that.
also I had a account under the name firehopper, but that was on a lavabit email account. (the lavabit servers shut down a long time ago) so I dont have access to that email account. so I cant reset the password for my old account to get access to it again.. dont know where to go for help for that.
Comments
If it's just one file, you can include it in this post in [ code][/code] tags (except the space between "[" and "c" is not actually there, I just put it there to make the forum software not notice it).
Here's an example of code tags:
Also, about your old forum account, have you tried emailing Parallax about it?
About to PM you on this.
okay
and vons fixed it for me yay have my old account back
First, you call SN.decx(hour, 2), which converts hour to a two digit decimal string, puts it in a byte array nstr in Strings.spin, and returns a pointer to that string. Then, you call SN.decx(minute, 2), which overwrites nstr with the minutes. Then, you use s.Combine to concatenate the string that used to contain hours (and now contains minutes) with the string that now contains the minutes. You are concatenating the same string, which contains minutes, to itself.
One solution is to call SN.decx(hour, 2), bytemove the result into a temporary buffer, call SN.decx(minute, 2), and then s.Combine them. You can use strsize to figure out how many bytes long the hour string is, or you can just know that it's 3 bytes (including the null terminator) and hardcode it.
However, I wouldn't recommend using a function like s.Combine, since string functions with buffers hidden in objects are a great source of bugs like this. I would just bytemove everything into my own buffer, and pass a pointer to that buffer to Send:
You could even write a function that takes a pointer to a string, appends it to the end of ledstring, and updates an index to make finding the end of ledstring next time easy.
that worked. and as for pointers. I dont think I'm ready for that I did modify your code a tiny bit by adding a bytemove for the seconds and it worked thanks so much.