hmc5883l compass rewrite help
stargazer2050
Posts: 89
Quickstart bd
Compass
like to turn off terminal and still run compass
In order to run the compass, the terminal must be on.
Ive coded out all but PUB heading. data is called term.dec (@e), calls "east", 0.
how would you rewrite so no 'term' thingys are used.
Compass
like to turn off terminal and still run compass
In order to run the compass, the terminal must be on.
Ive coded out all but PUB heading. data is called term.dec (@e), calls "east", 0.
how would you rewrite so no 'term' thingys are used.
Comments
You didn't provide us with much information about the program you're using.
It's certainly possible to use the compass without a terminal. You could either remove the serial portion of the program or just not connect it to the PC.
What sort of output do you want?
Here's a link to my attempt to use a HMC5883L to control some servos.
Using hmc5883l_demo.spin by parallax
Looks like it calls dat section.
How to write around the serial portion.
I need that cog!!
All "Term.str(@N)" does is output the string labelled "N" to the terminal. As you can see in the DAT section the contents of the string is just the letter "N" and a terminating zero.
I don't see a problem with just removing all the "Term." calls from the program.
You could make the t1 and t2 variables in the Heading method global variables and then you could use these values in other parts of your program.
I don't know if you've ever tried Tracy Allen's four port serial driver, but it's an easy way of using fewer cogs if your program uses more than one serial port.
I rarely run out of cogs myself. I usually run out of hub RAM first. If you're willing to post your code, I bet someone could help you conserve cogs.
The output routines do nothing. Except for strin and strinmax, which return a null string, and rxcheck, which returns 63 to keep a program from blocking, the other input routines return 0.
-Phil
Am using 0 to 360 azimuth by globally using value in aziadjust.
Needed t1, t2 and aziadjust , blanked out rest in new semi blank method per phil.
For some reason I still need to have a terminal running to get it to work, so I merged my serial1 input with the compass to save 1 cog, seems to work good.
Ill start a new thread to get a lesson on pcfullduplexserialfc4. Been trying it for 6 weeks now. Finally got reguar fullduplex working.
Thankyou both very much.