Difference between revisions of "Mixly Block Category - Actuator"

From Microduino Wiki
Jump to: navigation, search
(Servo)
(Tone)
Line 29: Line 29:
 
=Tone=
 
=Tone=
 
==Output Tone with Frequency==
 
==Output Tone with Frequency==
*Without Delay
+
===Without Duration===
*With Delay
+
Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until a call to '''Stop Output Tone'''. The pin can be connected to a piezo buzzer or other speaker to play tone.
 +
*Tone Pin # - The pin number that has the attached piezo buzzer or speaker.
 +
*Frequency - The frequency of the tone in hertz to generate.
 +
Note: '''Stop Output Tone''' needs to be called to stop tone generation.
 +
 
 +
===With Duration===
 +
Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until the duration time completes. The pin can be connected to a piezo buzzer or other speaker to play tone.
 +
*Tone Pin # - The pin number that has the attached piezo buzzer or speaker.
 +
*Frequency - The frequency of the tone in hertz to generate.
 +
*Duration (ms) - The time in milliseconds to output the tone.
 +
 
 +
 
 +
 
 +
Read more here: https://www.arduino.cc/en/Reference/Tone
 
==Stop Output Tone==
 
==Stop Output Tone==
 +
Stops the generation of a square wave triggered by '''Output Tone with Frequency Without Duration'''. Has no effect if no tone is being generated.
 +
 +
 +
Read more here: https://www.arduino.cc/en/Reference/NoTone
 +
 
=LED=
 
=LED=
 
==Setup==
 
==Setup==

Revision as of 22:23, 23 February 2017

Servo

Servos have integrated gears and a shaft that can be precisely controlled. Standard servos allow the shaft to be positioned at various angles, usually between 0 and 180 degrees. Continuous rotation servos allow the rotation of the shaft to be set to various speeds.


Read more here: https://www.arduino.cc/en/Reference/Servo

Set Position in Degrees with Delay

Writes a value to the servo, controlling the shaft accordingly. On a standard servo, this will set the angle of the shaft (in degrees), moving the shaft to that orientation. On a continuous rotation servo, this will set the speed of the servo (with 0 being full-speed in one direction, 180 being full speed in the other, and a value near 90 being no movement). A configurable delay time is added after calling the servo to move to allow to the requested angle.

  • Servo Pin # - The pin number that the servo is connected to.
  • Degree (0~180) - The angle to move the servo shaft to.
  • Delay (ms) - A delay in milliseconds after requesting the servo to move. This allows the servo physically move the servo shaft to the request angle.


Read more here: https://www.arduino.cc/en/Reference/ServoWrite

Set Position in Microseconds (PWM)

Writes a value in microseconds (uS) to the servo, controlling the shaft accordingly. On a standard servo, this will set the angle of the shaft. On standard servos a parameter value of 1000 is fully counter-clockwise, 2000 is fully clockwise, and 1500 is in the middle.

  • Servo Pin # - The pin number that the servo is connected to.
  • Microseconds - Set the direct PWM value (instead of an angle) that is sent to the Servo.


Read more here: https://www.arduino.cc/en/Reference/ServoWriteMicroseconds

Read Position

Returns the current angle of the servo (the value passed to the last call to Set Position in Degrees).

  • Servo Pin # - The pin number that the servo is connected to.


Read more here: https://www.arduino.cc/en/Reference/ServoRead

Tone

Output Tone with Frequency

Without Duration

Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until a call to Stop Output Tone. The pin can be connected to a piezo buzzer or other speaker to play tone.

  • Tone Pin # - The pin number that has the attached piezo buzzer or speaker.
  • Frequency - The frequency of the tone in hertz to generate.

Note: Stop Output Tone needs to be called to stop tone generation.

With Duration

Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until the duration time completes. The pin can be connected to a piezo buzzer or other speaker to play tone.

  • Tone Pin # - The pin number that has the attached piezo buzzer or speaker.
  • Frequency - The frequency of the tone in hertz to generate.
  • Duration (ms) - The time in milliseconds to output the tone.


Read more here: https://www.arduino.cc/en/Reference/Tone

Stop Output Tone

Stops the generation of a square wave triggered by Output Tone with Frequency Without Duration. Has no effect if no tone is being generated.


Read more here: https://www.arduino.cc/en/Reference/NoTone

LED

Setup

Print String

  • Line
  • Row / Column

Clear

Stepper Motor

Setup

  • 2 Pin
  • 4 Pin

Step