This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
anchordemo [2021/12/25 21:44] dpisuperadmin removed |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Anchor Demonstration Board ====== | ||
- | |||
- | ==== Introduction ==== | ||
- | Anchor Electronics sells a selection of new and surplus Demand Peripherals boards. | ||
- | The project described on this page gives Anchor customers a quick, visual | ||
- | introduction to the Demand Peripherals product line and and open-source peripherals. | ||
- | |||
- | |||
- | ==== Overview ==== | ||
- | {{ :: | ||
- | * Peripheral and hardware selection | ||
- | * Physical construction and wiring notes | ||
- | * Linux configuration | ||
- | * Applications | ||
- | * distance | ||
- | * rgbled | ||
- | * motordemo | ||
- | |||
- | ==== Peripheral and Hardware Selection ==== | ||
- | Our goal was to give Anchor customers a simple demonstration of the capabilities of the Demand Peripherals software defined peripherals. There are three separate applications running on the demo system. | ||
- | |||
- | The first is an ultrasonic distance sensor whose reading are displayed on a 6 digit LCD. The distance is shown in inches and tenths of an inch. We use the us8 peripheral ([[http:// | ||
- | |||
- | The second application uses a quad slide potentiometer peripheral ([[https:// | ||
- | |||
- | The third application uses a rotary encoder to control the speed and direction of a DC motor. | ||
- | |||
- | The command ' | ||
- | < | ||
- | Slot/ | ||
- | 0 / enumerator | ||
- | - port : dpget dpset | ||
- | - text : dpget | ||
- | 1 / bb4io The buttons and LEDs on the Baseboard | ||
- | - buttons : dpget dpcat | ||
- | - leds : dpget dpset | ||
- | 2 / us8 Octal interface to SRF04 distance sensor | ||
- | - distance : dpcat | ||
- | - enable : dpget dpset | ||
- | 3 / | ||
- | - display : dpget dpset | ||
- | - segments : dpget dpset | ||
- | 4 / | ||
- | - led : dpset | ||
- | - config : dpget dpset | ||
- | 5 / | ||
- | - positions : dpget dpcat | ||
- | 6 / quad2 Dual Quadrature Decoder | ||
- | - counts : dpcat | ||
- | - update_period : dpget dpset | ||
- | 7 / dc2 Dual DC motor controller | ||
- | - mode0 : dpget dpset | ||
- | - mode1 : dpget dpset | ||
- | - power0 : dpget dpset | ||
- | - power1 : dpget dpset | ||
- | - pwm_frequency : dpget dpset | ||
- | - watchdog : dpget dpset | ||
- | 8 / roten | ||
- | - encoder : dpget dpcat | ||
- | - led : dpget dpset | ||
- | 9 / | ||
- | - display : dpget dpset | ||
- | - segments : dpget dpset | ||
- | 10 / gpio4 Quad General Purpose Input/ | ||
- | - pins : dpget dpset dpcat | ||
- | - direction : dpget dpset | ||
- | - interrupt : dpget dpset | ||
- | </ | ||
- | |||
- | |||
- | ==== Physical Construction and Wiring ==== | ||
- | TBD with final construction | ||
- | |||
- | ==== Linux Configuration ==== | ||
- | We use a Raspberry Pi 3 single board computer as the controller for this project. | ||
- | |||
- | We start our three application program from / | ||
- | < | ||
- | |||
- | / | ||
- | sleep 5 | ||
- | daemonize / | ||
- | daemonize / | ||
- | daemonize / | ||
- | |||
- | </ | ||
- | |||
- | ==== Applications ==== | ||
- | We chose to implement the demo application as three stand-alone application. | ||
- | |||
- | === distance === | ||
- | The C implementation of the distance application uses blocking reads of the us8 peripheral followed by a write to the lcd6 peripherals with the distance in inches. | ||
- | < | ||
- | dpset us8 enable 1 | ||
- | dpcat us8 distance | ||
- | dpset lcd6 display %7.1f | ||
- | </ | ||
- | |||
- | === rgbled === | ||
- | The rgbled has two events that affect execution flow. The first is a reading from the quad potentiometer with a new setting from the user. The second event is a timeout. | ||
- | < | ||
- | dpset ws28 config 1 | ||
- | dpcat slide4 positions | ||
- | dpset bb4io leds %x | ||
- | dpset ws28 led 4 %x | ||
- | </ | ||
- | |||
- | === motordemo === | ||
- | The motor demonstration application has events from the UI rotary encoder, the quadrature decoder, and from a timer. | ||
- | < | ||
- | dpset quad2 update_period 50 | ||
- | dpcat quad2 counts | ||
- | dpcat roten encoder | ||
- | dpset dc2 mode0 f | ||
- | dpset dc2 mode0 r | ||
- | dpset dc2 power0 %4.1f | ||
- | dpset 9 display %11.5f | ||
- | </ | ||
- | |||
- | |||