DT routine - Direction better than 8 bit?
Hi Folks,
Mainly for Darrel but happy to have input from all!
DT's example of averaging the direction (thanks Darrel) makes use of ATN from an 8 bit direction (0-255 = 0-359 degrees) and works well when I use this method with PBPro 2.60.
However this gives some inaccuracies and low resolution. I've acquired my direction with a 10 bit AD and converted down to 0-359 but no matter how I manipulate the numbers in DT's formula I get to about 270 deg's and then it rolls over with false values.
Is there a way to achieve the above or am I stuck with coarse direction? I'd like to have 1 degree changes if possible not the jumps 8 bit has.
Kind regards to all and thanks in advance,
Bill
Better Direction resolution?
Hi Darrel and Ioannis,
Thanks for the help. I replied earlier but it didn't seem to make it, here goes again...
Ioannis the first thing I did when trying changes was to move to Words for the variables so was surprised when the numbers didn't crunch.
Darrel your code works well but gives 360/256 = 1.4 degree accuracy/resolution and I was hoping for better than this. I'm not strong at math so your comment about binary radians probably means I'm stuck with the original limits, which is probably okay for wind direction - but what do I do if I need greater accuracy for Tilt, etc?
Any suggestions and help is appreciated, thanks guys.
Bill
StampPlot with USB interface to PIC 18F4550??
Quote:
Originally Posted by
Bill Legge
DT,
I used StampPlot from Selmaware for a PID motor control demonstration last year, thoughts on it ~ may be of some interest in your development?
1. Fantastic that I could produce a PC interface without learning Visual Basic.
2. I think it was free, or I paid a very small amount of $ for the improved graphic design function.
3. The complexity of the commands was OK once you had an example to modify ~ working with the User Guide alone was, in some cases, very difficult.
4. The supplied controls, whilst functionally good, were visually poor ~ I imagined they were modelled on instruments in a Soviet 1950 power station.
5. I would have been prepared to pay more for a better product that had the benefit of lots of polishing.
6. However, excellent value for the very low cost ~ a labour of love for the developer.
Regards Bill Legge
Bill, I also am trying to get an application going without having to use VB6. I need to interface a laptop computer to an 18F4550 based microcontroller via USB to read the data stored by the 18F4550 in its EEPROM over a 31 day period [93 bytes = 31 daily measurements x (date value, Data_LSB, Data_MSB) ] . I need the data to be inserted on the PC side into an Excel spreadsheet for plotting and analysis purposes by the user. It appears that StampPlot might be a candidate to do this, but it appears it really only works with BasicStamp and RS232 or serial interfaces and not USB. As a user of StampPlot can you advise me if I can adapt it to use for USB and PICBASICPro without a huge learning curve? My controller is done and my project has a short fuse so can't spend a lot of learning time to get the PC side and USB interface going Would really appreciate your advice!~