Joe,
Are you saying that all I need to do to use PORTB is figure out how to appropriately configure it?
If so, please give me a hint? I am soooo close.
Ken
Joe,
Are you saying that all I need to do to use PORTB is figure out how to appropriately configure it?
If so, please give me a hint? I am soooo close.
Ken
Ken,
I am not an expert on pulseout or pulsein, and I have not read the manual lately, but I believe they are digital commands, which by default should require you to disable the analog functions on the pin you are using.
On this chip you have,
ADCON0
ADCON1
ANSEL
ANSELH
CMCON0
CCP1CON
CCP2CON
CM1CON0
CM2CON0
CM2CON1 and a couple more which all have effect on the I/O. Get into the data sheet and read about them, they are all listed in the index of the data sheet, and see how to set them up. Remember if a bit is SET it is a 1 if cleared it is a 0.
When you come out of the data sheet you will be a much more "Savy" programmer.
Last edited by Archangel; - 2nd March 2010 at 15:26.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
My problem was that the length of the PULSOUT pulse was way toooo long. This was true even if I did a PULSOUT trigfront, 1.
So I changed it to:
It seems to respond correctly on its blocks with me moving a oak cutting board in front and on the right side to simulate inside a room with no furniture.HIGH trigfront
PAUSE 1
LOW trigfront.
The battery needs charging and I need to neaten up the bundle of wires. I feel a video might not be long in coming.
Thanks, gang. Whomever you are.
Ken
I've got the car driving around using HPWM to control the electronic speed control and the steering servo. This is a high quality hobby level car. It seems to not react quickly enough to the PIC commands. It was designed to have a person at the radio transmitter controlling with finger and wrist movements while watching how the car performs. This is a beautiful mechanism when human judgment is included.
A toy level car runs the wheels with direct current. The steering is a bang bang servo with a mechanical mechanism forcing it straight. Fritzl used a toy level car in his wall racer. http://letsmakerobots.com/node/696
I have added 'kickers' to the steering commands. Realizing that steering straight is the servo's action when given no current, I figured that transitioning from hard left or hard right to straight might be faster if the go straight HPWM command were preceded by a momentary hard shot to the opposite extreme. My first experiment did little to improve response.
Of course it might be that my car needs a grease job.
Hmmm....
Ken
COOL!!! It works!!!
Videos???
Or may the code is rusty?Of course it might be that my car needs a grease job.
Are you using interrupts or just running straight?
The PIC should be able to react faster than humans.
Last edited by mackrackit; - 4th March 2010 at 03:35.
Dave
Always wear safety glasses while programming.
It is not that he PIC is slow, I think it is that the steering mechanism is too complex. It is a close match for what is in a real automobile. I need to get the car to go slower if it is going to drive along a wall no more than 15 inches away.
My code also needs some serious tweeking.
Ken
When up on blocks and I am fooling the sonar with my hands. (Remember it is supposed to hug the walls and thereby go around a room counter clockwise looking down.)
It:
1. goes straight when my hand is about 10 inches away on the car's right side and nothing is in front.
2. turns right when my hand is more than 10 inches away on the right
3. turns left when my hand is 15 to 20 inches away up front
4. goes backward when my hand is much closer up front. Once it has retreated 15 to 20 inches it turns left and tries again.
When on the floor the car is too fast for the PIC driven steering mechanism. It bumps into things, retreats, turns, and comes flying forward. It is too fast for me.
It is behaving similarly to those floor vacuuming robots only way too fast. I have the electronic speed control at its slowest PWM settings.
Needless to say, manipulating a video camera while waving my hand at this machine ain't easy.
Ken
Bookmarks