Arduino рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рдХреЗ рдмрд╛рд░реЗ рдореЗрдВ рдХрдИ рджрд┐рд▓рдЪрд╕реНрдк рд▓реЗрдЦ рд╣реИрдВ, рдЬрд┐рдиреНрд╣реЗрдВ рдЖрдк
Ebay рдСрдирд▓рд╛рдЗрди рдиреАрд▓рд╛рдореА рдореЗрдВ рд╕реБрд░рдХреНрд╖рд┐рдд рд░реВрдк рд╕реЗ рдСрд░реНрдбрд░ рдХрд░ рд╕рдХрддреЗ рд╣реИрдВред рдЗрд╕ рдордВрдЪ рдХреЗ рд▓рд┐рдП рдЗрдВрдЯрд░рдиреЗрдЯ рдкрд░ рдХрдИ рдореЙрдбреНрдпреВрд▓ рдФрд░ рд▓реЗрдЦ рд╣реИрдВ, рдЗрд╕рд▓рд┐рдП рдореИрдВ рдХреБрдЫ рджрд┐рд▓рдЪрд╕реНрдк рдХрд░рдирд╛ рдЪрд╛рд╣рддрд╛ рдерд╛, рд╣рд╛рд▓рд╛рдВрдХрд┐ рд░реЛрдЬрдорд░реНрд░рд╛ рдХреА рдЬрд┐рдВрджрдЧреА рдореЗрдВ рд╣рдореЗрд╢рд╛ рдЙрдкрдпреЛрдЧреА рдирд╣реАрдВ рд╣реЛрддрд╛ рд╣реИред

рдХрд╛рдо рдХреЗ рд▓рд┐рдП, рд╕реНрд╡рддрдВрддреНрд░рддрд╛ рдХреЗ рд╡рд┐рднрд┐рдиреНрди рдбрд┐рдЧреНрд░реА рдХреЗ рд╕рд╛рде рдкреНрд▓реЗрдЯрдлрд╛рд░реНрдореЛрдВ рдХрд╛ рдкреНрд░рдмрдВрдзрди рдХрд░рдиреЗ рдХрд╛ рдЕрдиреБрднрд╡ рд╣реИ, рдЗрд╕рд▓рд┐рдП рдкрд╣рд▓реА рдЪреАрдЬ рдЬреЛ рдореИрдВ рдХрд░рдирд╛ рдЪрд╛рд╣рддрд╛ рдерд╛, рд╡рд╣
рдЫрд╣-рдбрд┐рдЧреНрд░реА рдкреНрд▓реЗрдЯрдлреЙрд░реНрдо (рд╕реНрдЯреАрд╡рд░реНрдЯ рдкреНрд▓реЗрдЯрдлреЙрд░реНрдо) рдерд╛ , рд▓реЗрдХрд┐рди рджреБрд░реНрднрд╛рдЧреНрдп рд╕реЗ рдХреЗрд╡рд▓ рдЪрд╛рд░ рд╕рд░реНрд╡реЛ рдбреНрд░рд╛рдЗрд╡реНрд╕ рдЖрдП, рдЗрд╕рд▓рд┐рдП рдПрдХ рд╢реБрд░реБрдЖрдд рдХреЗ рд▓рд┐рдП рд╣рдо рддреАрди-рдбрд┐рдЧреНрд░реА рдкреНрд▓реЗрдЯрдлреЙрд░реНрдо рдмрдирд╛рдПрдВрдЧреЗред
рдЙрдкрдХрд░рдг рдФрд░ рд╕рд╛рдордЧреНрд░реА
рдЗрд╕рд▓рд┐рдП, рдЗрд╕ рдЗрдХрд╛рдИ рдХрд╛ рдирд┐рд░реНрдорд╛рдг рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП, рд╣рдореЗрдВ рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдШрдЯрдХреЛрдВ рдХреА рдЖрд╡рд╢реНрдпрдХрддрд╛ рд╣реИ:
рдореЗрдЬрдмрд╛рди рдХрд╛ рдирд╛рдо | рд╕рдВрдЦреНрдпрд╛ |
рдЕрд░реБрдбрд┐рдиреЛ рдореЗрдЧрд╛ | 1 рдкреАрд╕реА |
HXT900 рд╕рд░реНрд╡реЛ | 3 рдкреАрд╕реА |
рдкреНрд▓рд╛рдИрд╡реБрдб | 1 рдкреАрд╕реА |
5V рд╡реЛрд▓реНрдЯреЗрдЬ рдирд┐рдпрд╛рдордХ | 1 рдкреАрд╕реА |
рдкреЗрдкрд░ рдХреНрд▓рд┐рдк | 3 рдкреАрд╕реА |
рддрд╛рд░ рдзрд╛рд░рдХ | 3 рдкреАрд╕реА |
USB рдХреЙрд░реНрдб | 1 рдкреАрд╕реА |
рдмрд┐рдЬрд▓реА рдХреА рдЖрдкреВрд░реНрддрд┐ | 1 рдкреАрд╕реА |
рддрд╛рд░реЛрдВ рдХреЛ рдЬреЛрдбрд╝рдирд╛ | 13 рдкреАрд╕реА |
Styracosaurus | 1 рдкреАрд╕реА |
рдиреАрд▓рд╛рдореА рдореЗрдВ рдмреЛрд░реНрдб рдФрд░ рдХрдВрдЯреНрд░реЛрд▓рд░ Arduino Mega Kit рдХреА рд▓рд╛рдЧрдд $ 50 рд╕реЗ рд╣реИред рдЪреАрди рд╕реЗ рд╕рд░реНрд╡реЛ рдХреА рдЦрд░реАрдж рдХреЗ рд╕рд╛рде, рдХреЛрдИ рд╕рдорд╕реНрдпрд╛ рдирд╣реАрдВ рд╣реЛрдиреА рдЪрд╛рд╣рд┐рдП, рдПрдХ рдЯреБрдХрдбрд╝реЗ рдХреА рд▓рд╛рдЧрдд рд▓рдЧрднрдЧ $ 2 рд╣реИред рдкреНрд▓рд╛рдИрд╡реБрдб рджреЗрд╢ рдореЗрдВ рдпрд╛ рд╕реНрдЯреЛрд░ рдореЗрдВ рдкрд╛рдпрд╛ рдЬрд╛ рд╕рдХрддрд╛ рд╣реИред рдХрд╛рдо рдореЗрдВ рддреАрди рдкреЗрдкрд░ рдХреНрд▓рд┐рдкред рд╕рдмрд╕реЗ рдХрдард┐рди рдмрд╛рдд рдПрдХ рд╕реНрдЯрд╛рдЗрд▓рдХреЛрд░реНрд╕реЛрд╕ рдкреНрд░рд╛рдкреНрдд рдХрд░рдирд╛ рд╣реИ, рдЖрдорддреМрд░ рдкрд░ рдЬрд╛рдирд╡рд░реЛрдВ рдХреА рдпреЗ рдкреНрд░рдЬрд╛рддрд┐рдпрд╛рдВ рдкреЛрд╕реНрдЯ рдСрдлрд┐рд╕ рдпрд╛ рдмрдЪреНрдЪреЛрдВ рдХреЗ рд╕реНрдЯреЛрд░ рдореЗрдВ рджреЗрдЦреА рдЬрд╛ рд╕рдХрддреА рд╣реИрдВред
рдкреНрд▓реЗрдЯрдлрд╛рд░реНрдо рдирд┐рд░реНрдорд╛рдг
рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рдХреЗ рдирд┐рд░реНрдорд╛рдг рдХрд╛ рдореБрдЦреНрдп рдХрд╛рд░реНрдп рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рдХреЗ рдЖрдзрд╛рд░ рдФрд░ рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рд╕реЗ рд╕реНрд╡рдпрдВ рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рдХреЛ рдХрд╛рдЯрдирд╛ рд╣реИред рдирд┐рдпрдВрддреНрд░рдг рддрддреНрд╡реЛрдВ рдХреЛ 120 рдбрд┐рдЧреНрд░реА рдХреЗ рдХреЛрдг рдкрд░ рд╕рд░реНрдХрд▓ рдХреЗ рдЕрдВрджрд░ рд░рдЦрд╛ рдЧрдпрд╛ рд╣реИред
1 рдЪрд░рдг - рд╕реЗрд╡рд┐рдВрдЧ
рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рдХрд╛ рдЖрдзрд╛рд░ 10x10 рд╕реЗрдореА рдЖрдХрд╛рд░ рдХрд╛ рд╣реИ, рд╕рд╛рде рд╣реА рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рдЖрдХрд╛рд░ рдореЗрдВ 8x8 рд╕реЗрдореА рд╣реИред рдкреНрд▓реЗрдЯрдлрд╝реЙрд░реНрдо рдХреЛ рд╕реНрд╡рдпрдВ рд╡рд░реНрдЧ рдЫреЛрдбрд╝рд╛ рдЬрд╛ рд╕рдХрддрд╛ рд╣реИ, рд▓реЗрдХрд┐рди рд╕реБрд╡рд┐рдзрд╛ рдХреЗ рд▓рд┐рдП рдПрдХ рддреНрд░рд┐рдХреЛрдг рдХрд╛рдЯ рджрд┐рдпрд╛ рдЧрдпрд╛ рдерд╛ред рд╕рдорд░реНрдерди рдХреЛ рдмрдиреНрдзрди рдХреЗ рд╕реНрдерд╛рди рдкрд░ рджреЗрдЦрд╛ рдЬрд╛рддрд╛ рд╣реИред
2 рдЪрд░рдг - рдбреНрд░рд┐рд▓рд┐рдВрдЧ
рдбреНрд░рд┐рд▓рд┐рдВрдЧ рдХреЗ рд▓рд┐рдП, рддреАрди рднрд╛рдЧреЛрдВ рдореЗрдВ рд╡рд┐рднрд╛рдЬрд┐рдд рд╕рд░реНрдХрд▓ рдХреЛ рдЦреАрдВрдЪрдирд╛ рд╕рдмрд╕реЗ рдкрд╣рд▓реЗ рдЖрд╡рд╢реНрдпрдХ рд╣реИред 120 рдбрд┐рдЧреНрд░реА рд╕реЗ рдХрдо рдХреА рдХрд┐рд░рдгреЛрдВ рдореЗрдВ, рд╕рд░реНрд╡реЛ рдХреЛ рд▓рд╛рдЧреВ рдХрд░рдирд╛ рдЖрд╡рд╢реНрдпрдХ рд╣реИ, рд╕рд╛рде рд╣реА рдбреНрд░рд┐рд▓рд┐рдВрдЧ рдХреЗ рд▓рд┐рдП рдЕрдВрдХ рднреА рдЕрдВрдХрд┐рдд рдХрд░рдирд╛ рдЖрд╡рд╢реНрдпрдХ рд╣реИред
рд▓рдЧрд╛рд╡ рдХреА рд╡рд┐рдзрд┐ рдХреЗ рдЖрдзрд╛рд░ рдкрд░, рд╕рдорд╛рдкреНрдд рдЕрдВрдХрди рдХреЗ рдЕрдиреБрд╕рд╛рд░ рдбреНрд░рд┐рд▓ рдЫреЗрджред рд╣рд╛рд░реНрдиреЗрд╕ (рд╕рдмрд╕реЗ рдЕрдЪреНрдЫрд╛ рд╡рд┐рдХрд▓реНрдк) рдХреЗ рд╕рд╛рде рдмрдиреНрдзрди рдХреЗ рд▓рд┐рдП, рдЫреЗрдж 4 рдорд┐рдореА рд╡реНрдпрд╛рд╕ рд╣реЛрдирд╛ рдЪрд╛рд╣рд┐рдПред рддрд╛рд░ рдХреЗ рд╕рд╛рде рдмрдиреНрдзрди рдХреЗ рдорд╛рдорд▓реЗ рдореЗрдВ (рдЬреИрд╕рд╛ рдХрд┐ рдореЗрд░реЗ рдорд╛рдорд▓реЗ рдореЗрдВ), 2 рдорд┐рдореА рдХреЗ рд╡реНрдпрд╛рд╕ рдХреЗ рд╕рд╛рде рдЫреЗрдж рдкрд░реНрдпрд╛рдкреНрдд рд╣реИрдВред
3 рдЪрд░рдг - рдПрдВрдХрд░реЗрдЬ рддреИрдпрд╛рд░ рдХрд░рдирд╛
рд╕реНрдЯреЗрдкрд▓ рдХреЛ рдЫреЛрдбрд╝рдХрд░ рдмрдиреНрдзрди рдХреЗ рд▓рд┐рдП рдХреБрдЫ рднреА рдирд╣реАрдВ рдорд┐рд▓рд╛ (рдХрд╛рдо рдкрд░ рдкреНрд░рджрд░реНрд╢рди рдХреЗ рдмрд╛рдж, рдПрдХ рдФрд░ рд╡рд┐рдХрд▓реНрдк рдкреНрд░рд╕реНрддрд╛рд╡рд┐рдд рдХрд┐рдпрд╛ рдЧрдпрд╛ рдерд╛)ред рдкреЗрдкрд░ рдХреНрд▓рд┐рдк рдХреЛ "рдЬреА" рдЕрдХреНрд╖рд░ рдХреЗ рд░реВрдк рдореЗрдВ рдмрдирд╛рдпрд╛ рдЬрд╛рдирд╛ рдЪрд╛рд╣рд┐рдП, рдЬреЛ рд╕рд░реНрд╡реЛ рдбреНрд░рд╛рдЗрд╡ рдкрд░ рддрдп рдХрд┐рдпрд╛ рдЧрдпрд╛ рд╣реИ рдФрд░ рдкреНрд▓реЗрдЯрдлреЙрд░реНрдо рдкреНрд▓реЗрдЯрдлреЙрд░реНрдо рдкрд░ рдорд╛рдЙрдВрдЯ рдореЗрдВ рдбрд╛рд▓рд╛ рдЧрдпрд╛ рд╣реИред
рдХрд╛рдо рдХреЗ рджреМрд░рд╛рди, рдореБрдЭреЗ рд╕реНрдЯреЗрдкрд▓ рдХреЗ рдмрдЬрд╛рдп рдЯреНрд░реЗрдХреНрд╕ 450 рд╣реЗрд▓реАрдХреЙрдкреНрдЯрд░ (рдкрд╣рд▓реЗ рд╕реЗ рдЪреАрди рд╕реЗ рдСрд░реНрдбрд░ рдХрд┐рдпрд╛ рдЧрдпрд╛) рд╕реЗ рдПрдХ рдмреЙрд▓ рдорд╛рдЙрдВрдЯ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдиреЗ рдХреА рдкреЗрд╢рдХрд╢ рдХреА рдЧрдИ рдереАред рдЗрд╕ рдкреНрд░рдХрд╛рд░ рдХреЗ рдорд╛рдЙрдВрдЯ рдХреЗ рд╕рд╛рде, рдордВрдЪ рдирд┐рд░реНрдорд╛рдг рдореЗрдВ рдЕрдзрд┐рдХ рдХрдареЛрд░ рд╣реЛрдЧрд╛ред
рдЪрд░рдг 4 - рдордВрдЪ рдмрдирд╛рдПрдБ
рдордВрдЪ рдХрд╛ рд╕рдВрдпреЛрдЬрди рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдЕрдиреБрдХреНрд░рдо рдореЗрдВ рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ:
- рдордВрдЪ рдХреЗ рдЖрдзрд╛рд░ рдореЗрдВ рддрд╛рд░ рдХреЛ рдлреИрд▓рд╛рдирд╛;
- рдЖрдзрд╛рд░ рдкрд░ рд╕рд░реНрд╡реЛ рдХрд╛ рдмрдврд╝рдирд╛;
- рдкреНрд▓реЗрдЯрдлреЙрд░реНрдо рдкреНрд▓реЗрдЯрдлреЙрд░реНрдо рдкрд░ рддрд╛рд░реЛрдВ рдХреЗ рд▓рд┐рдП рдлрд╛рд╕реНрдЯрдирд░реЛрдВ рдХреА рд╕реНрдерд╛рдкрдирд╛;
- рдЗрдорджрд╛рджреА рдкрд░ "рдЬреА" рдкрддреНрд░ рдХреЗ рд░реВрдк рдореЗрдВ рдлрд╛рд╕реНрдЯрдирд░реЛрдВ рдХреА рд╕реНрдерд╛рдкрдирд╛ред
рдкрд░рд┐рдгрд╛рдо
рдкрд░рд┐рдгрд╛рдо рдордВрдЪ рдХрд╛ рдЖрдзрд╛рд░ рд╣реИ, рдЬреИрд╕рд╛ рдХрд┐ рдиреАрдЪреЗ рджрд┐рдП рдЧрдП рдЖрдВрдХрдбрд╝реЗ рдореЗрдВ рджрд┐рдЦрд╛рдпрд╛ рдЧрдпрд╛ рд╣реИред рд▓реАрдб рдХрд╛ рд╕рдордп
1 рдШрдВрдЯрд╛ рд╣реИ ред

рд╕рд░реНрдХрд┐рдЯ рдЕрд╕реЗрдВрдмрд▓реА
рдХрдиреЗрдХреНрдЯ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП, Arduino рд╡реЗрдмрд╕рд╛рдЗрдЯ рдкрд░ рдЖрдзрд┐рдХрд╛рд░рд┐рдХ
рджрд╕реНрддрд╛рд╡реЗрдЬ рдореЗрдВ рд╡рд░реНрдгрд┐рдд рд╡рд┐рдзрд┐ рдореВрд▓ рд░реВрдк рд╕реЗ рдЙрдкрдпреЛрдЧ рдХреА рдЧрдИ рдереАред рдХрдИ рд╕рд░реНрд╡реЛ рдХреЛ рдЬреЛрдбрд╝рдиреЗ рдкрд░, рдмрд┐рдЬрд▓реА рдХреА рдЖрдкреВрд░реНрддрд┐ рдкрд░реНрдпрд╛рдкреНрдд рдирд╣реАрдВ рд╣реИ, рдЗрд╕рд▓рд┐рдП 5V рд╡реЛрд▓реНрдЯреЗрдЬ рдирд┐рдпрд╛рдордХ (
рдХрдиреЗрдХреНрд╢рди рдХрд╛ рдПрдХ
рд╡рд┐рд╕реНрддреГрдд рд╡рд┐рд╡рд░рдг ) рдХреЗ рдорд╛рдзреНрдпрдо рд╕реЗ рддреАрди рдбреНрд░рд╛рдЗрд╡ рдХреЛ рдЕрд▓рдЧ рд╕реЗ "рдкрд╛рд╡рд░" рдХрд░рдирд╛ рдЙрдЪрд┐рдд рд╣реИред
Arduino рдХреЗ рд▓рд┐рдП рддреАрди рд╕рд░реНрд╡реЛ рдХреЛ рдЬреЛрдбрд╝рдиреЗ рдХреЗ рдорд╛рдорд▓реЗ рдореЗрдВ, рд╢рдХреНрддрд┐ рдЕрдкрд░реНрдпрд╛рдкреНрдд рд╣реЛрдЧреА рдФрд░ рд╕реБрд░рдХреНрд╖рд╛ рдХреЛ рдЯреНрд░рд┐рдЧрд░ рдХрд┐рдпрд╛ рдЬрд╛рдПрдЧрд╛ред рдмреНрд░реЗрдбрдмреЛрд░реНрдб рдкрд░ рд╕реНрдЯреЗрдмрд▓рд╛рдЗрдЬрд░ рдХреЗ рдорд╛рдзреНрдпрдо рд╕реЗ рддреАрди рдбреНрд░рд╛рдЗрд╡ рдХрд╛ рдХрдиреЗрдХреНрд╢рди рдиреАрдЪреЗ рджрд┐рдП рдЧрдП рдЪрд┐рддреНрд░ рдореЗрдВ рджрд┐рдЦрд╛рдпрд╛ рдЧрдпрд╛ рд╣реИ:

рдмреЛрд░реНрдб рд╕реЗ 1, 2, 3 рдПрдирд╛рд▓реЙрдЧ рдЖрдЙрдЯрдкреБрдЯ (рдПрдирд╛рд▓реЙрдЧ рдкрд┐рдВрд╕) рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ Arduino рд╕реЗ рдирд┐рдпрдВрддреНрд░рдг рдХрд┐рдпрд╛ рдЬрд╛рдПрдЧрд╛ред рдореЗрд░реЗ рдорд╛рдорд▓реЗ рдореЗрдВ, рдмреЛрд░реНрдб рд╕реЗ рднреА рд╢рдХреНрддрд┐ рдЬреБрдбрд╝реА рд╣реБрдИ рд╣реИред рдХрдиреЗрдХреНрд╢рди рдХрд╛ рдПрдХ рдЙрджрд╛рд╣рд░рдг рдЪрд┐рддреНрд░ рдореЗрдВ рджрд┐рдЦрд╛рдпрд╛ рдЧрдпрд╛ рд╣реИ:

рдЬрд╣рд╛рдВ рдмрд╛рдПрдВ рд╕реЗ рджрд╛рдПрдВ: рдиреАрд▓рд╛ - 5 рд╡реА, рдкреАрд▓рд╛ - "рдЬрдореАрди", рд▓рд╛рд▓ - рдбреНрд░рд╛рдЗрд╡ 1, рдХрд╛рд▓рд╛ - рдбреНрд░рд╛рдЗрд╡ 2, рдкреАрд▓рд╛ рдбреНрд░рд╛рдЗрд╡ 3ред
рдкреВрд░реЗ рдХрдиреЗрдХреНрд╢рди рдЖрд░реЗрдЦ рдХрд╛ рд░реВрдк рд╣реИ:

Arduino рдкреНрд░реЛрдЧреНрд░рд╛рдорд┐рдВрдЧ
рдордВрдЪ рдХреЛ Arduino рджреНрд╡рд╛рд░рд╛ рдкреНрд░рджрд╛рди рдХрд┐рдП рдЧрдП рд╕реАрд░рд┐рдпрд▓ рдкреЛрд░реНрдЯ рдХреЗ рдорд╛рдзреНрдпрдо рд╕реЗ рдПрдХ рдХрдВрдкреНрдпреВрдЯрд░ рд╕реЗ рдирд┐рдпрдВрддреНрд░рд┐рдд рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред рдкреЛрд░реНрдЯ рдХреЗ рд╕рд╛рде рдХрд╛рдо Serial рдкреБрд╕реНрддрдХрд╛рд▓рдп рдХреЗ рдорд╛рдзреНрдпрдо рд╕реЗ рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ, рдФрд░ SoftwareServo рдкреБрд╕реНрддрдХрд╛рд▓рдп рдХреЗ рдорд╛рдзреНрдпрдо рд╕реЗ рд╕рд░реНрд╡реЛ рдХрд╛ рдирд┐рдпрдВрддреНрд░рдгред
рд╕реАрд░рд┐рдпрд▓ рдкреЛрд░реНрдЯ рд╕реЗ рдХрдорд╛рдВрдб рдХреЛ рдкрд╛рд░реНрд╕ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП, C рдореЗрдВ рдирд┐рдореНрди рд╕рдВрд░рдЪрдирд╛ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░реЗрдВ:
struct _set_pos_cmd_t
{
char cmd;
int pos1;
int pos2;
int pos3;
};
typedef _set_pos_cmd_t set_pos_cmd_t;
* This source code was highlighted with Source Code Highlighter .
struct _set_pos_cmd_t
{
char cmd;
int pos1;
int pos2;
int pos3;
};
typedef _set_pos_cmd_t set_pos_cmd_t;
* This source code was highlighted with Source Code Highlighter .
рддрджрдиреБрд╕рд╛рд░, рддреАрди рдкреВрд░реНрдгрд╛рдВрдХ рд╕реНрдерд┐рддрд┐ рдЗрдВрдЧрд┐рдд рдХреА рдЬрд╛рддреА рд╣реИред рдХрдорд╛рдВрдб рдмрд╛рдЗрдЯ рднреА рдЗрдВрдЧрд┐рдд рдХрд┐рдпрд╛ рдЧрдпрд╛ рд╣реИ, рд╣рдорд╛рд░реЗ рдорд╛рдорд▓реЗ рдореЗрдВ, рдирд┐рдпрдВрддреНрд░рдХ рдХреЛ рдкрджреЛрдВ рдХреЛ рд▓рд┐рдЦрдиреЗ рдХреА рдХрдорд╛рди рдореЗрдВ рдХреЛрдб
0xC1 рд╣реИ ред
рд╕рд░реНрд╡реЛ рдХреА рд╕реНрдерд┐рддрд┐ рдХреЛ рдЕрдкрдбреЗрдЯ_ рдПрдХреНрд╕рдкреЛрдЬрд░ рдлрд╝рдВрдХреНрд╢рди рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рд╕реЗрдЯ рдХрд┐рдпрд╛ рдЧрдпрд╛ рд╣реИ, рдЬреЛ рдХрдорд╛рдВрдб рд╕реЗ рдорд╛рдиреЛрдВ рдХреЛ рдЗрдорджрд╛рджреА рд╢рд╛рдлреНрдЯ рдХреЗ рд░реЛрдЯреЗрд╢рди рдХреЗ рдХреЛрдг рдХреЗ рдорд╛рдиреЛрдВ рдореЗрдВ рдореИрдк рдХрд░рддрд╛ рд╣реИред
void update_positions()
{
int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM);
myservo1.write(val);
val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM);
myservo2.write(val);
val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM);
myservo3.write(val);
delay(5);
SoftwareServo::refresh();
}
* This source code was highlighted with Source Code Highlighter .
void update_positions()
{
int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM);
myservo1.write(val);
val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM);
myservo2.write(val);
val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM);
myservo3.write(val);
delay(5);
SoftwareServo::refresh();
}
* This source code was highlighted with Source Code Highlighter .
Arduino рдХреЗ рд▓рд┐рдП рдЕрдВрддрд┐рдо рдХрд╛рд░реНрдпрдХреНрд░рдо
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
#include <SoftwareServo.h> #define SET_CMD 0xC1 #define COMMAND_ERROR 0x01 #define FORMAT_ERROR 0x02 #define VALUE_MINIMUM 0 #define VALUE_MAXIMUM 4096 #define SERVO_MINIMUM 0 #define SERVO_MAXIMUM 90 SoftwareServo myservo1; SoftwareServo myservo2; SoftwareServo myservo3; int servo_position1 = 0; int servo_position2 = 0; int servo_position3 = 0; struct _set_pos_cmd_t { char cmd; int pos1; int pos2; int pos3; }; typedef _set_pos_cmd_t set_pos_cmd_t; void setup() { pinMode(13, OUTPUT); myservo1.attach(A0); myservo2.attach(A1); myservo3.attach(A2); Serial.begin(115200); } boolean readBytes( char *bytes, int count) { char data; for ( int counter = 0; counter < count; ++counter) { data = Serial.read(); bytes[counter] = data; } Serial.flush(); return true ; } void set_positions( char *data) { set_pos_cmd_t *command = (set_pos_cmd_t*)data; servo_position1 = command->pos1; servo_position2 = command->pos2; servo_position3 = command->pos3; } void update_positions() { int val = map(servo_position1, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo1.write(val); val = map(servo_position2, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo2.write(val); val = map(servo_position3, VALUE_MINIMUM, VALUE_MAXIMUM, SERVO_MINIMUM, SERVO_MAXIMUM); myservo3.write(val); delay(5); SoftwareServo::refresh(); } void loop() { int availableBytes = 0; char buffer[128]; if ((availableBytes = Serial.available()) > 0) { if (!readBytes(buffer, availableBytes)) { Serial.write(FORMAT_ERROR); } switch (buffer[0]) { case SET_CMD: set_positions(buffer); Serial.write(0xDA); break ; } } update_positions(); } * This source code was highlighted with Source Code Highlighter .
рдкреНрд░рдмрдВрдзрди рдХрд╛рд░реНрдпрдХреНрд░рдо
рддреАрди-рдЪрд░рдг рдкреНрд▓реЗрдЯрдлрд╛рд░реНрдо рдкреНрд░рдмрдВрдзрди рдХрд╛рд░реНрдпрдХреНрд░рдо C # рдореЗрдВ рд▓рд┐рдЦрд╛ рдЧрдпрд╛ рд╣реИ, рдЬрд┐рд╕рдХреЗ рдореВрд▓ рд░реВрдк рдореЗрдВ рдПрдХ рд╕рд░рд▓реАрдХреГрдд рд░реВрдк рдерд╛:

рдордВрдЪ рдкреНрд░рдмрдВрдзрди рдХрд╛рд░реНрдпрдХреНрд░рдо рдХреЗ рдирд╡реАрдирддрдо рд╕рдВрд╕реНрдХрд░рдг рдиреЗ рдлрд╛рд░реНрдо рд▓рд┐рдпрд╛:
UPD: рдХрдВрдЯреНрд░реЛрд▓ рдХреНрд▓рд╛рд╕ рд╕реЛрд░реНрд╕ рдХреЛрдбрдХрд╛рд░реНрдпрд╛рдиреНрд╡рдпрди рд╡реАрдбрд┐рдпреЛ
рдЖрдкрдХрд╛ рдзреНрдпрд╛рди рдХреЗ рд▓рд┐рдП рдзрдиреНрдпрд╡рд╛рдж!