This is more of a stylistic critique than a substantive one. Since Spin is an indentation-sensitive language, you should probably avoid indentations where they are not needed by the language's syntax. Having them there can make the program a bit confusing to read.
Your indentation is causing trouble this time. Don't put s2.wait_stopinside the loop; put it after. This post is now irrelevant, since the repeat loop didn't accomplish anything anyway.
I've taken your program, modified it, and substituted LED on/off for pen down/up. It works as expected with the LED turning on and off in the appropriate places. So, if you restore the commented-out statements, and your pen-lifter still doesn't work, the problem lies in your interaction with the Servo object. Here's the modified code:
These commands with the on/off LED as the pen lifted Up/Down are amazing. Will make the final result more spectacular.
Unfortunately the problem is in the interaction with the Servo object as you said...
I commented-out the servo commands and it doesn't work.
What can I do about this?
However using only the Servo32v7 Object the following commands....
PUB Servo32_DEMO
SERVO.Start ' Start servo handler
repeat
' Syntax: SERVO.Set(Pin, Width)
SERVO.Set(ServoCh1,2080) ' 2400: max Pen Up
repeat 800000 ' Wait a short bit
SERVO.Set(ServoCh1,1600) ' 1500 usec (centered) 600:min Pen Down
repeat 800000
I have the right result and the servo motor lifts Up and Down the pen without problem.
How can I overcome the interaction problem with the Servo object when I use simultaneusly the S2 object?
Should I had use multitasking commands?
When I run your code for first time I hadn't realize to press the S2 button as your code demanded.
So I thought that something wrong was again....
I was very disappointed as I looked at your magnificent code and I was ready to give up. Then I realized that I had to press the S2 button.
When I shaw the result I cheered!!!!! Rich you are the best!!!! What AMAZING letters!!!!
I realized the real beauty of s2 pen lifter when I shaw the result.
Here is what my S2 wrote:
It was a litle problem with "A" letter but it doesn't matter!!!!
I have no words to thank you and Phil for your help. I Feel real thankful!!!
I intend to make a ful set of letters for S2 robots with pen lifter and I also Ihope you will find useful my new pen lifter suggestion!
This is something I can fix.
I have in mind to make a program with all the alphabet. The user will give a word and the the s2 robot will write the word in to the ground.
You will receive this file in order to test it with your s2.
In order to run this code the s2 robot is necessary to have a pen lifter.
When I finish the video with my pen lifter I'll post it into the forum and I hope that everyone will be able to add one in their robot
The letters will be scalable. The only I haven't decide yet is the font type . If you have any suggestion please tell me.
The idea is to to choose a font type of writing from a computer software (e.g. Ms word , Power Point). Then I'll print every letter on ruled faint paper, and I'll find the coordinates and then using a specific excell file I'll create the spin code of every letter with parameters in order to be scalable. I intent to assign the letters creation as project to my students in order to finish in short time.
The font type of "saints" is pretty god. Have you immitate a patricular font type from Ms Word?
If you thing that a particulat font type is more appropriate for this purpose please let me know.
I think ideally you would have two fonts. One of them a single line font and the other a block type font with maybe with rounded edges. The single line font so that it doesn't take an eternity to write something out and the blocky font to keep accumulative errors to a minimum.
I also had a student create the Saints font, for the Interlake Saints Robotics Club, not the football team.
I think ideally you would have two fonts. One of them a single line font and the other a block type font with maybe with rounded edges. The single line font so that it doesn't take an eternity to write something out and the blocky font to keep accumulative errors to a minimum.
I also had a student create the Saints font, for the Interlake Saints Robotics Club, not the football team.
Rich,
I followed your advise about the S2 fonts.
Here is the project: Alphabet for S2: a collaborative project
I created a new "A" . In my s2 it works properly. You can try it in your S2.
Comments
Put it right after S2.start.
-Phil
This is more of a stylistic critique than a substantive one. Since Spin is an indentation-sensitive language, you should probably avoid indentations where they are not needed by the language's syntax. Having them there can make the program a bit confusing to read.
-Phil
Really!? I looked for it like seven times. Must be the indenting that threw me.
You're younger than me, too!
-Phil
I hope now is more easy to read ....
Nothing again.......
Now the robot do nothing. Even the wheels doesn't move.
The new command "repeat until" blocked the program
I made a Pen lifter and I can't use it
BTW. Thank you very much for your time !
Your indentation is causing trouble this time. Don't put s2.wait_stop inside the loop; put it after. This post is now irrelevant, since the repeat loop didn't accomplish anything anyway.
-Phil
I've taken your program, modified it, and substituted LED on/off for pen down/up. It works as expected with the LED turning on and off in the appropriate places. So, if you restore the commented-out statements, and your pen-lifter still doesn't work, the problem lies in your interaction with the Servo object. Here's the modified code:
-Phil
These commands with the on/off LED as the pen lifted Up/Down are amazing. Will make the final result more spectacular.
Unfortunately the problem is in the interaction with the Servo object as you said...
I commented-out the servo commands and it doesn't work.
What can I do about this?
However using only the Servo32v7 Object the following commands.... I have the right result and the servo motor lifts Up and Down the pen without problem.
How can I overcome the interaction problem with the Servo object when I use simultaneusly the S2 object?
Should I had use multitasking commands?
S2_write_Saints_NikosG.spin
When I run your code for first time I hadn't realize to press the S2 button as your code demanded.
So I thought that something wrong was again....
I was very disappointed as I looked at your magnificent code and I was ready to give up. Then I realized that I had to press the S2 button.
When I shaw the result I cheered!!!!! Rich you are the best!!!! What AMAZING letters!!!!
I realized the real beauty of s2 pen lifter when I shaw the result.
Here is what my S2 wrote:
It was a litle problem with "A" letter but it doesn't matter!!!!
I have no words to thank you and Phil for your help. I Feel real thankful!!!
I intend to make a ful set of letters for S2 robots with pen lifter and I also Ihope you will find useful my new pen lifter suggestion!
This is something I can fix.
I have in mind to make a program with all the alphabet. The user will give a word and the the s2 robot will write the word in to the ground.
You will receive this file in order to test it with your s2.
In order to run this code the s2 robot is necessary to have a pen lifter.
When I finish the video with my pen lifter I'll post it into the forum and I hope that everyone will be able to add one in their robot
Will you also make the letters scalable?
Rich,
The letters will be scalable. The only I haven't decide yet is the font type . If you have any suggestion please tell me.
The idea is to to choose a font type of writing from a computer software (e.g. Ms word , Power Point). Then I'll print every letter on ruled faint paper, and I'll find the coordinates and then using a specific excell file I'll create the spin code of every letter with parameters in order to be scalable. I intent to assign the letters creation as project to my students in order to finish in short time.
The font type of "saints" is pretty god. Have you immitate a patricular font type from Ms Word?
If you thing that a particulat font type is more appropriate for this purpose please let me know.
I also had a student create the Saints font, for the Interlake Saints Robotics Club, not the football team.
Rich,
I followed your advise about the S2 fonts.
Here is the project: Alphabet for S2: a collaborative project
I created a new "A" . In my s2 it works properly. You can try it in your S2.
Nikos