Difference between revisions of "Mixly Block Category - Actuator"
(→Print String) |
(→=Row / Column) |
||
Line 71: | Line 71: | ||
*Line 1 - String to display on the first line of the LCD screen. | *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. | *Line 2 - String to display on the second line of the LCD screen. | ||
− | ===Row / Column== | + | ===Row / Column=== |
*LCD Name - The name of the variable of the LCD as defined in the setup (see above). | *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. | *Row - Row number to where the start of the String will be printed. |
Revision as of 00:35, 24 February 2017
Contents
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.
Clear
Stepper Motor
Setup
- 2 Pin
- 4 Pin