Skip to content

Commit a18cb1d

Browse files
committed
Added Encoder
Video still needs doing
1 parent 91a12ca commit a18cb1d

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed
55.4 KB
Loading
142 KB
Loading
46.6 KB
Loading

www/en/modules/ROOT/pages/gadgets-nav.adoc

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,41 @@ Pressing Stop will fire the Stop event and exit the loop.
140140

141141
image::GroveI2CDCMotorDriveL298-BD.png[]
142142

143-
== Encoder
143+
== Incremental Rotary Encoder
144+
145+
An incremental encoder is a type of rotary encoder that generates a series of electrical pulses as the encoder shaft is rotated. These pulses are used to measure the rotational position, speed, and direction of the shaft.
146+
147+
This particular board is the Adafruit I2C Stemma QT Rotary Encoder with a SeeSaw protocol microcontroller and NeoPixel LED.
148+
149+
Adafruit seesaw is a near-universal converter framework which allows you to add and extend hardware support to any I2C-capable microcontroller or microcomputer. Instead of getting separate I2C GPIO expanders, ADCs, PWM drivers, etc, seesaw can be configured to give a wide range of capabilities.
150+
151+
https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout/overview[Adafruit seesaw an I2C to ... whatever! interface]
144152

145153
=== Hardware Details
146154

155+
https://www.adafruit.com/product/5880[Adafruit I2C Stemma QT Rotary Encoder]
156+
157+
This board uses the Qwiic connector, so we will need to use a Qwiic to Grove lead.. These can be bought directly or made to the circuit diagram below.
158+
159+
image::QwiicToGroveConnector.png[]
147160

148161
=== Demo Video
149162

163+
This video demonstrates the Adafruit Rotary Encoder
164+
165+
video::j-9ya1YdSZY[youtube]
150166

151167
=== Example Code
168+
Navigate to >>Scratchpad>>Grove>>Gadgets>>AdaFruit SeeSaw>>Encoder>>**AdafruitSeesawEncoder.vi**
152169

170+
image::AdaFruitI2CRotaryEncoder-Project.png[]
153171

172+
This VI uses the Adafruit Enocder Breakout Board, this board has a small microcontroller running SeeSaw firmware. This gives a lot of functionality through I2C register setting and reading. Select the port for the connected Pico and the Grove connector that the board is plugged into. Press the run arrow.
154173

174+
image::AdaFruitI2CRotaryEncoder-FP.png[]
175+
176+
On the block diagram you can see that the selected Grove connector dictates the GPIO Pins used for communication. This session connection is input into **AdaFruit-Seesaw.lvclass:Init**. Next we set up GPIOs, Encoder and NeoPixel LED using **AdaFruit-Seesaw.lvclass:Init:NeoPixelInit.vi**,**AdaFruit-Seesaw.lvclass:Init:EncoderInit.vi**. We then initialise the NeoPixel Buffer by setting **AdaFruit-Seesaw.lvclass:Init:SetNeoPixelBuf.vi**,**AdaFruit-Seesaw.lvclass:Init:NeoPixelShow.vi**. We the loop round the event structure in the timeout checking the GPIO pins for the encoder interupt. If the encoder has changed it will read it. Changing the brightness or Color Box will change the Neopixel LED. If you press the rotary encoder a GPIO pin will change, this is caught in the timeout loop.
177+
Pressing Stop will fire the Stop event and exit the loop.
155178

179+
image::AdaFruitI2CRotaryEncoder-BD.png[]
156180

0 commit comments

Comments
 (0)