We had a similar discussion not that long ago, might be worth revisiting.
It's important to remember that one usually want to do more than JUST keep track of an enocder and that has to be accounted...
Type: Posts; User: HenrikOlsson; Keyword(s):
We had a similar discussion not that long ago, might be worth revisiting.
It's important to remember that one usually want to do more than JUST keep track of an enocder and that has to be accounted...
I have a hard time believing that was the actual problem. In PBP (unlike, for example, C) = and == are the same thing. And you basically have the proof in your own code sine the WHILE loop works and...
With a 10bit ADC (like most PICs have) and a VRef of 5V you get a (theoretical) resolution of 4.88mV. Your typical sin/cos type encoder outputs 1Vpp which means that (again, in theory) you should be...
I forgot... Ideally you want an ADC with dual S/H inputs (or even dual converters) because sampling the two inputs in sequence as the encoder is moving will introduce errors. The error might be...
In your particular case with a low cycles-per-rev encoder and, I image, slow rotational speed (?) it might be possible to go for an all analog approach, otherwise you need to add some comparators to...
I suspect this is what you want:
displayvar.0[X]=Y
But I also suspect we've covered this before so instead of me trying to repeat what's already been covered in detail I just leave it all to...
12345 / 10 = 1234
12345 / 100 = 123
12345 / 1000 = 12
12345 / 10000 = 1
/Henrik.
This has been covered a couple of times over the years, see (and read) here for starters:
http://www.picbasic.co.uk/forum/showthread.php?t=15989
I suppose it might depend on a lot of variables,...
Allocation of memory is done at compile time - not during runtime. Hence the content of a variable can not dictate the size of an array since the content of a variable, by definition, can change...
And the compiler is really only able (if so designed) to catch out-of-bounds error when you have a static index like that MAS[10]=20 but in many cases you're using an index variable like MAS[x]=20...
You may have found something you did not know and it IS something to be aware of but it's not a bug. It's like that by design.
It's all covered in details thru out section 7.6 in the manual - read...
That's something you could easily try/test/verify for your own verification in less time than what you had to wait for this answer but...Yes :-)
/Henrik.
Richard,
Your change to the "cast routine" saved some 400bytes worth of code space and probably also executes faster. Thanks!
Yeah, both of my sensors reports temperature which I believe to be...
For anyone who are still interested in using this sensor with PBP I've posted my code as an example in the Wiki:
http://www.picbasic.co.uk/forum/content.php?r=558-BME280-Example
If any questions...
Richard,
Out of curiosity, have you tried the PBP code you posted with negative temperature values?
The reason I ask is that my temperature compensation code was pretty much exactly like yours...
I'd try increasing the baudrate even further.
According to Wikipedia 256kbits/second is a predefined serial port speed in Windows so you "should" have that available without doing anything...
Thank you Richard, that did help.
I've got pressure working as well.
Temperature is within 0.05°C and pressure is within 1Pa compared to a commercially available BME280 based sensor module.
I...
Yes, exactly so :-)
That's sort of the idea behind the stepper motor - that you can relatively precisely control both the speed and the position without needing some sort of feedback device and...
Does anyone have a BME280 sensor laying around?
Can you read the compensation values and post them?
I think I've now got pressure working as well but I'm curious to know another sensors comp...
I see no reason for it not to work.
But with an 8-pin device you're quickly running out of pins, step pulses out, solenoid drivers, perhaps a sensor of some sort to detect the items on the belt, a...
Mark,
Yeah, for precise positioning feeding the pulses back into the PIC and count them OR integrate generated velocity over time to calculate position. Possible but not exactly easy to get right,...
David,
You've done a great job so far!
As you might know the torque of step motor falls off as the speed increases. Increasing the drive voltage counteracts this drop in torque. Doubling the...
Thank you Richard!
I see you too got the temperature conversion covered but not pressure and/or humidity which is where I'm currently got stuck. Haven't done anything with it for a couple of days,...
Hi Andy,
Which PIC are you targeting (wondering if it's got an USART or EUSART)?
My guess is that there's something weird going on with the baudrate.
If possible, replace the Bluetooth connection...
Which device and out of curiousity, what's up with the slightly odd baudrate?
Well nothing and intermittent isn't quite the same :-)
Are you SURE the serial data is actually getting to the...