Welcome to the Parallax Discussion Forums, sign-up to participate.
|-DS1302_full.spin
|-FullDuplexSerial.spin
G:/fastspin/programs/test5/test5.bas(31) error: syntax error, unexpected end of line
child process exited abnormally
rem test5.bas ' ' April 23, 2019 ' dim rtc as class using "DS1302_full.spin" dim ser as class using "FullDuplexSerial.spin" dim day1 as byte dim month1 as byte dim year1 as byte dim dow1 as byte dim minutes as byte dim hour as byte dim seconds as byte dim dow dim inBuff as string rtc.init(10,11,9) waitcnt(getcnt() + 10_000_000) ' User I/O do print "> "; inBuff = input$(10) if inBuff = "dtime" then datetime() else if inBuff = "settime" dummy() else if inBuff = "setdate" dummy() else print "Do not understand!" end if ' pausems 3000 loop ' Subroutines and Funtions sub datetime rtc.readDate(@day1, @month1, @year1, @dow1) rtc.readTime(@hour,@minutes,@seconds) print month1;"/";day1;"/";"20";year1;" ";hour;":";minutes;":";seconds end sub sub dummy print "Empty" end sub
Comments
Are you talking about input or output? For output you can just do "print" with nothing else; that will output an end of line. For input, you can use CHR$ or ASC to try to match a character with a specific ASCII value.
Use just plain "input", like:
Help support its development at Patreon or PayPal.
No Optimization - 13336 bytes
Default Optimization - 9136 bytes
Full Optimization - 8932 bytes
I would like to add in the CM2302 code, but using the Full Optimization option would probably trash the program, I think. I might have to try it just to see what happens.
Ray
Help support its development at Patreon or PayPal.
The program below I added the CM2302 code.
No Optimization - 22636 bytes
Default Optimization - 15116 bytes Note: The values produced for the temperature are incorrect.
Full Optimization - 14436 bytes Note: The values produced for the temperature are incorrect.
As for including "FullDuplexSerial.spin", I really wanted to see how that was handled , in terms of program size. I will probably try pairing this up with a Raspberry Pi, using the COM, for remote access. The COM will be running in its own CPU, not sure how much program memory will be necessary for this.
Ray
Eric
Help support its development at Patreon or PayPal.
I wonder, in this case, would some kind of modification of the Spin code would resolve the Optimization problem. But it sounds like it would be creating a whole new set of problems for other Spin objects that you would try to use with fastspin Basic, modifying Spin code objects to run with fastspin Basic.
Ray
dht22.StartDHTnn(2,22,@temp,@humid,@status)
The 2 is for the pin number, and the 22 is for the model number. I tried to do something like: The compiler came back with an error message. I also tried: The compiler did not like that either. Is there a way to have those two items up in the declarations. Or maybe because I am doing this with a user I/O, have some thing that the user types in the pin number and the model number.
Ray
What error messages did you get? Both of those approaches sound like they should work.
Help support its development at Patreon or PayPal.
Help support its development at Patreon or PayPal.
Since it seems to be float related, some dummy sensor values should be enough to give a simple fail-test case ?
Something weird is going on, this morning I tried the: and this morning it worked as expected. Is the Win 10 Pro messing around with the spin2gui program?
As for the DHTnn_Object.spin, to bad we don't have the C version for the dht22, which is in the simpletools lib, for comparison.
As for debugging, to find the optimization problem, I am not sure as to what I can do.
Ray
LOL, drat you Ray, now I have to clean the coffee spray off my laptop and work bench. If true that would be a new bug, even for Windows.
Life is unpredictable. Eat dessert first.
I hope that optimizer problem gets resolved, so I can move on with the program. At the moment if I add another Spin object, like the SD code, that will take me over the top, in the memory area.
Today, while I was trying out some different debugging things, like using the 'Full optimization' option I was getting: That almost sounds like a problem with the LMM, but I am not a developer, so I could be way off target.
Ray
Ray
Ray