Difference between revisions of "Mixly Block Category - Actuator"

From Microduino Wiki
Jump to: navigation, search
(=Row / Column)
(Clear)
Line 77: Line 77:
 
*String - Text that will be display starting at the '''Row''' and '''Column'''.
 
*String - Text that will be display starting at the '''Row''' and '''Column'''.
  
==Clear==
+
==Commands==
 +
Performs a command on the LCD.
 +
*LCD Name - The variable name of the LCD which will be acted upon. Variable name is set during the '''setup''' (see above).
 +
*Action - Various action to perform on the LCD.
 +
**On - Turns on the LCD screen.
 +
**Off - Turns off the LCD screen.
 +
**Cursor - Enables the cursor (under scroll) on the selected row and column on the display.
 +
**noCursor - Disables the cursor (under scroll) the display.
 +
**Blink - Enables character blinking on the selected row and column.
 +
**noBlink - Disables character blinking on the selected row and column.
  
 
=Stepper Motor=
 
=Stepper Motor=

Revision as of 00:44, 24 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

LCD

Allows you to control LCD displays.

Read more here: https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library

Setup

Setup the LCD display for use. This block is required to be called to initialize the LCD and configure.

Using Hardware I2C (Default)

  • LCD Type - The type of LCD connected -- LCM1602 or LCM2004.
  • LCD Name - Variable name for the LCD. Any name can be chosen. Used to reference in other blocks.
  • Address - I2C address of the LCD module connected. Usually, included in the datasheet or document that is supplied with the module. Or a simple Google search on the LCD module number will yield the I2C address. Or use an I2C scanner to detect the address.

Using Software I2C (Alternative)

  • LCD Type - The type of LCD connected -- LCM1602 or LCM2004.
  • LCD Name - Variable name for the LCD. Any name can be chosen. Used to reference in other blocks.
  • Address - I2C address of the LCD module connected. Usually, included in the datasheet or document that is supplied with the module. Or a simple Google search on the LCD module number will yield the I2C address. Or use an I2C scanner to detect the address.
  • SCL Pin # & SDA Pin # - SCL & SDA pin numbers to use with Software I2C. Read more here about software I2C: http://playground.arduino.cc/Main/SoftwareI2CLibrary

Print String

Display string on the LCD module.

Line 1 / Line 2

  • LCD Name - The name of the variable of the LCD as defined in the setup (see above).
  • Line 1 - String to display on the first line of the LCD screen.
  • Line 2 - String to display on the second line of the LCD screen.

Row / Column

  • LCD Name - The name of the variable of the LCD as defined in the setup (see above).
  • Row - Row number to where the start of the String will be printed.
  • Column - Column number to where the start of the String will be printed.
  • String - Text that will be display starting at the Row and Column.

Commands

Performs a command on the LCD.

  • LCD Name - The variable name of the LCD which will be acted upon. Variable name is set during the setup (see above).
  • Action - Various action to perform on the LCD.
    • On - Turns on the LCD screen.
    • Off - Turns off the LCD screen.
    • Cursor - Enables the cursor (under scroll) on the selected row and column on the display.
    • noCursor - Disables the cursor (under scroll) the display.
    • Blink - Enables character blinking on the selected row and column.
    • noBlink - Disables character blinking on the selected row and column.

Stepper Motor

Setup

  • 2 Pin
  • 4 Pin

Step