|
1 | | -= Grove Digital Inputs |
| 1 | += M5Stack DAC2 I2C Analog Outputs |
2 | 2 | :page-toclevels: 1 |
3 | 3 |
|
4 | | -.Overview |
5 | | -:page-toclevels: 2 |
6 | | -**** |
7 | | -This example uses the grove button module but the source code is also applicable for other similar Grove Modules. |
| 4 | +== Overview |
8 | 5 |
|
9 | | -The GPIO Pins used are [D16,D17],[D18,D19],[D20,D21] |
| 6 | +This example uses the M5Stack DAC 2 Module, there are other similar modules that may work with this code as it uses the GP8313 integrated circuit. These are Grove compatible modules. |
10 | 7 |
|
11 | | -image::general\GroveDigitalConnectionsPico.png[] |
| 8 | +The GPIO Pins used are [I2C0] or [I2C1] |
12 | 9 |
|
| 10 | +image::GrovePicoShieldI2CConnection.png[] |
13 | 11 |
|
14 | | -**** |
15 | 12 |
|
16 | | -.Hardware Details |
17 | | -:page-toclevels: 2 |
18 | | -**** |
19 | | -https://wiki.seeedstudio.com/Grove-Dual-Button/#features[Grove Dual Button] |
20 | | -**** |
| 13 | +== Hardware Details |
21 | 14 |
|
22 | | -.Demo Video |
23 | | -:page-toclevels: 2 |
24 | | -**** |
25 | | -Here is a video that shows the set-up and running of the Dual Button Digital Inputs |
| 15 | +https://shop.m5stack.com/products/dac-2-i2c-unit-gp8413[M5Stack DAC2 Module] |
| 16 | + |
| 17 | +https://cdn.robotshop.com/media/M/Mst/RB-Mst-408/pdf/dac-2-i2c-unit-gp8413-schematics.pdf?_gl=1*1iloh40*_ga*OTI2MTgwMTk0LjE3NzIzODcwOTY.*_ga_FXHVC4EYRV*czE3NzIzODcwOTMkbzEkZzAkdDE3NzIzODcwOTkkajYwJGwwJGgw*_gcl_au*MTI3MDM0MTE5OC4xNzcyMzg3MTAw[Schematic] |
| 18 | + |
| 19 | +https://www.dfrobot.com/product-2756.html[DFRobot boards may also work] |
| 20 | + |
| 21 | +== Demo Video |
| 22 | + |
| 23 | +Here is a video that shows the set-up and running of the M5Stack DAC2 |
26 | 24 |
|
27 | 25 | video::0-suR8HejsY[youtube] |
28 | 26 |
|
29 | | -**** |
30 | 27 |
|
31 | | -.Example Code |
32 | | -:page-toclevels: 2 |
33 | | -**** |
34 | | -Navigate to >>Scratchpad>>Grove>>Digital Inputs>>Grove Digital In.vi |
| 28 | +== Example Code |
| 29 | + |
| 30 | +Navigate to >>Scratchpad>>Grove>>Analog Outputs>>**I2C An Out M5StackDAC2.vi** |
| 31 | + |
| 32 | +image::M5StackDAC2AnalogOutputProject.png[] |
35 | 33 |
|
36 | | -image::images\grove-digital-inputs\GroveDigitalInProject.png[] |
| 34 | +This particular VI uses the M5Stack DAC2 and this gives us 2 channels of 16 bit Analog Output. Select the port for the connected Pico and the Grove connector that the board is plugged into. Press the run arrow. |
37 | 35 |
|
38 | | -This particular VI uses the dual buttons. Select the port for the connected Pico and the Grove connector that the board is plugged into. Press the run arrow. |
39 | 36 |
|
40 | | -You should now see the button indicators light up when the corresponding button is pressed. The Indicators use a transparent fill for the off state and a brighter Red or Green for the on state. |
41 | 37 |
|
42 | | -Links to various other similar boards are also on the Front Panel. |
43 | 38 |
|
44 | | -image::images\grove-digital-inputs\GroveDigitalInFP.png[] |
| 39 | +image::M5StackDAC2AnalogOutputFP.png[] |
45 | 40 |
|
46 | | -On the block diagram you can see that the selected Grove connector dictates the GPIO Pin and we then set the pin to [In]. Next we loop round and event structure and use the timeout to poll the digital inputs. Pressing Stop will fire the Stop event and exit the loop. |
| 41 | +On the block diagram you can see that the selected Grove connector dictates the GPIO Pin for the IC2 Port. We set up the IC2 port for the device in **Init.vi**. Next we loop round the event structure and wait for a Sliders V0 or V1 to be changed. When change has been detected the new values are input into the **Write DAC.vi**. Pressing Stop will fire the Stop event and exit the loop. |
47 | 42 |
|
48 | | -image::images\grove-digital-inputs\GroveDigitalInBD.png[] |
49 | | -**** |
| 43 | +image::M5StackDAC2AnalogOutputBD.png[] |
0 commit comments