Learning Process
Kievlanin
Posts: 55
I am very interested on learning how to create programs using PBASICS.
Any suggestions?
Any suggestions?
Comments
http://www.parallax.com/Portals/0/Downloads/docs/books/edu/wamv2_2.pdf
http://www.parallax.com/Portals/0/Downloads/docs/books/sw/Web-SW-v2.1.pdf
http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/pbasicstyle.pdf
·
Its not as hard as it looks.And as You read,You can experiment!
kf4ixm lists some really needed info.,But its not overwhelming or overly complicated.
Remember if You get stumped on some thing, Thats what the Forums are for.
Welcome to the Club.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
At your request for help in your PM, I am reviving this thread for you. What are you working on and what parts do you have? Are you goals to learn PBASIC programming or do you have a specific task in mind? There are a lot of people on these boards that have a great understanding of PBASIC and Parallax products. How can we help?
Doc
This includes:
4 Photoresistors (from Radio Shack)
2 Stepper Motors (from AutoMationDirect)
<u>Description of operation:</u>
1 step: PLC (microprocesor) reads value of two (90 degree apart) photoresistors on axle X
2 step: compare two values (< or >)
3 step: rotate Stepper (assigned amount of steps) on axle X accordingly (to try to equalise the values)
4 step: pause 15 sec.
5 step: repeate from step 1 until values are within +/-10%
6 step: once result in step 5 are completed switch to axle Y alignment (similar procedure as for axle X, except using photoresistors on axle Y and Stepper Y)
7 step: sleep mode for 15 minutes
8 step: start from step 1
This is not the best procedure (I know).
I see the best procedure to be by tracking by "Astronomical Sun position", but this will require more expensive components like: Servo Motors and angular (lineiar) absolute transducers/encoders
I did not learn any programming for this two years.
However, I had quite a progress for the last month.
All depends on my workload at work. And sometime, I am lazy...... Blame on me...
Well, for the last month I have spent a good deal of time learning PBASIC.
One thing is that last month, basically every evening I was drawing my SunTracker in Inventor Pro and I am now about 80% done with production drawings.
All 3D design is done & confimed. Even some parts have been made.
I do not know how long it will take to make all the parts, but at least a month, this is for sure!
Programming and assembly of all electronic components (in one package) is my weak point. (I am a mechanical engineer, not electronic).
' {$STAMP BS1}
' {$PBASIC 1.0}
'I would like to develop a simple program that will
'compare value of photoresistors "NumberBX" & value of "NumberBX"
'located on axle X AND OUTPUT the larger
'variable name on the screen
'I will have:
'photoresistor AX
'and
'photoresistor BX
'Variables list:
SYMBOL ValueAX = B1 'This is a value of photoresistor AX after measured
SYMBOL ValueBX = B2 'This is a value of photoresistor BX after measured
SYMBOL PulseAX = PIN7 'Pulse input pin for photoresistor AX
SYMBOL PulseBX = PIN6 'Pulse input pin for photoresistor BX
Main:
PULSIN PulseAX, 1, ValueAX 'measure positive pulse on pin7, on high, store in ValueAX
PULSIN PulseBX, 1, ValueAX 'measure positive pulse on pin7, on high, store in ValueBX
Run:
IF ValueAX > ValueBX THEN AX_larger_then_BX
IF ValueAX < ValueBX THEN AX_smaller_then_BX
AX_larger_then_BX:
HIGH PIN4 'turns ON LED on Pin4
DEBUG "PhotoresistorAX is larger then PhotoresistorBX"
AX_smaller_then_BX:
HIGH PIN5 'turns ON LED on Pin5
DEBUG "PhotoresistorAX is larger then PhotoresistorBX"
PAUSE 1000
GOTO Main
' {$PBASIC 1.0}
'I would like to develop a simple program that will
'compare value of photoresistors "NumberBX" & value of "NumberBX"
'located on axle X AND OUTPUT the larger
'variable name on the screen
'I will have:
'photoresistor AX
'and
'photoresistor BX
'Variables list:
SYMBOL ValueAX = B1 'This is a value of photoresistor AX after measured
SYMBOL ValueBX = B2 'This is a value of photoresistor BX after measured
SYMBOL PulseAX = PIN7 'Pulse input pin for photoresistor AX
SYMBOL PulseBX = PIN6 'Pulse input pin for photoresistor BX
Main:
PULSIN PulseAX, 1, ValueAX 'measure positive pulse on pin7, on high, store in ValueAX
PULSIN PulseBX, 1, ValueAX 'measure positive pulse on pin7, on high, store in ValueBX
Run:
IF ValueAX > ValueBX THEN AX_larger_then_BX
IF ValueAX < ValueBX THEN AX_smaller_then_BX
AX_larger_then_BX:
HIGH PIN4 'turns ON LED on Pin4
DEBUG "PhotoresistorAX is larger then PhotoresistorBX"
AX_smaller_then_BX:
HIGH PIN5 'turns ON LED on Pin5
DEBUG "PhotoresistorAX is larger then PhotoresistorBX"
PAUSE 1000
GOTO Main
Still looks a bit different, but it is much better.
Thanks!
I am learning. So if something looks funny...
It is works. is measuring the light intencity and turning on the LED accordingly.
The next step is the motor, to make turn CW or CCW. According with the LED's.
This is my first program. (Well. not really. I made many "super shorties" for training, this weekend). It is not polished, not documented properly. Riugh draft.
As you see it is based on BS1. For me there is plenty of learning even with this.
I do have BS2 in my hands, but I will try tinkering with BS1 for the moment.
Suggestions always welcome!