I wish to email my PBP code. I want the BOLD commands to remain BOLD as they do in Microcode Studio. I have a PC running XP. When I select, copy and paste the BOLDness disappears.
Any suggestions?
Ken
I wish to email my PBP code. I want the BOLD commands to remain BOLD as they do in Microcode Studio. I have a PC running XP. When I select, copy and paste the BOLDness disappears.
Any suggestions?
Ken
Use the Save As *.RTF option.
Dave
Always wear safety glasses while programming.
In order to get someone or something interested in helping make my robocar available to school kids I need a better quality video. I have two HPI Racing Sprint cars.
I have access to an outdoor street hockey rink. Same size and shape as ice hockey only asphalt covered for in line skates. I'm going to see if I can race my cars. Both on the track at the same time hugging the right wall going around turning left. One lap. The probability of the sonars getting their echos interchanged is remote I hope.
They can go up to thirty mph. Real speed - not scaled speed. My PIC may not be able to react fast enough. I create PWM signals using HPWM. The robocar's reactions seem slower than my fingers on the trigger of the radio transmitter. This is going to be VERY interesting. You guys got any suggestions to add to the excitement?
Ken
My first robocar includes a PICKIT 2 proto board. It has a built in potentiometer. I would like to use that pot to control my code's PWM signal from PORTC.0.
Presently I preset the constant FORWARD to a number between 115 and 123. That number is one of the arguments to my HPWM command for PORTC.0. If 123, the car goes very fast. If 115, the car creeps. I would like to make FORWARD a variable which is set within these limits on-the-fly as a result of the position of the pot.
This will force me to use ASM code which is good. This also forces me to think which can be a problem. I am not good SEARCHing this forum. Any pointers would be most welcome.
Ken
Here's my first shot. I compiled fine, but did not work at all. Assuming I got the PORTs and
registers correct, am I on the correct path? I am trying to break the 256 possible values of
the Pot reading down to seven that make sense to the Electronic Speed control.
pot PORTA.0,127,Potread
if Potread < 36 then
Forward = 112
endif
if Potread => 36 and Potread < 73 then
Forward = 113
endif
if Potread => 73 and Potread < 109 then
Forward = 114
endif
if Potread =>109 and Potread < 146 then
Forward = 115
endif
if Potread => 146 and Potread < 182 then
Forward = 116
endif
if Potread => 182 and Potread < 219 then
Forward = 117
endif
if Potread => 219 then
Forward = 118
endif
write 2,word Forward
write 4,word Potread
You would be better off using ADC to read the pot and SELECT CASE for the comparisons.
Dave
Always wear safety glasses while programming.
Here is my latest on reading the PICKIT2 pot and selecting PWM pulse width.
The word Potread follows the pot turns perfectly from 10 00 to FF 00 in addresses 4 and 5.Checkpot:
adcin PORTA.0, Potread
write 4, word Potread
select case Potread
case Potread < 36
Forward = 112
case Potread => 36 and Potread < 73
Forward = 113
case Potread => 73 and Potread < 109
Forward = 114
case Potread =>109 and Potread < 146
Forward = 115
case Potread => 146 and Potread < 182
Forward = 116
case Potread => 182 and Potread < 219
Forward = 117
case Potread => 219
Forward = 118
end select
write 2, word Forward
The word Forward is always 70 00 in addresses 2 and 3. SELECT CASE always chooses CASE 1
above. ie the CASE where Potread is deemed less than 36. Any ideas? I think I have problems
with using WORDs when I am only interested in BYTEs, but I am not allowed to declare a BYTE
sized VAR. I suspect my selecting "left justified" is confusing it, but I do not see in what manner.
Ideas?? Ken
Bookmarks