Archivi per la categoria ‘Elettronica’
venerdì, 3 maggio 2013
Raspberry Pi and Nokia 3310 LCD
Main features
- Low-level management of the GPIOs
- Generic input/output interfaces
- Displays support (7-segments, HD44780, PCD8544)
- Keypad support (matrix keypad)
- Stepper motor support
- Unicode support (built-in)
- Handles multiple image formats (using Magick++ API) (optional)
- Supports standard fonts (using FreeType) (optional)
- Drawing functions
Enjoy it!
Pubblicato in Elettronica, Programmazione, Raspberry Pi, Rpi-hw | Nessun commento »
martedì, 20 novembre 2012
I just released version 0.2.2 of the Rpi-hw library and, as you can see from the video, this version finally supports LCD displays compatible with the Hitachi HD44780 driver.
Hitachi HD44780 interfacing – Video
To manage an LCD you need to instantiate the class “display::hd44780″, defined in the header file “display/hd44780.hpp”. Its constructor method takes the GPIO pins used by the device (either in 4-bit or 8-bit mode), as in following example:
display::hd44780( RS, E, D0, D1, D2, D3 );
display::hd44780( RS, E, D0, D1, D2, D3, D4, D5, D6, D7 );
The class has an internal data buffer, therefore you no need to read the data from the display controller. Remember, however, that you must connect the RW pin to the GND.
(continua…)
Pubblicato in Elettronica, Progetti, Programmazione, Raspberry Pi, Rpi-hw | 2 Commenti »
giovedì, 1 novembre 2012
This is my first post in English, so please be understanding.
Today we will see how to interfacing the Raspberry Pi with a matrix keypad using the Rpi-hw library.
Matrix keypad interfacing – Video
The library provides the class “keypad::matrix“, defined in the header file “keypad/matrix.hpp”, with which it is possible to manage keypads of any size. Its constructor method takes two ordered lists containing the GPIO pins used by the device.
keypad::matrix( /* Column pins */ { COL0, COL1, COL2, ... }, /* Rows pins */ { ROW0, ROW1, ROW2, ... } )
Once it is instantiated, the object has several methods to control the keypad:
- bool state( size_t index ) const: returns a button state.
- bool pressed( size_t index ) const: checks if a button is pressed.
- bool released( size_t index ) const: checks if a button is released.
- const bitset &state() const: returns the bitset of button states.
- size_t numOfKeys() const: returns the number of keys.
The argument “index” refers to the button index of keypad. All buttons are numbered from left-to-right and top-to-bottom, so that first button is at top-left and last button is at bottom-right.
(continua…)
Pubblicato in Elettronica, Progetti, Programmazione, Raspberry Pi, Rpi-hw | Nessun commento »
mercoledì, 10 ottobre 2012
E’ ormai da qualche giorno che sto lavorando ad una libreria C++ con cui poter gestire l’interfaccia GPIO della mia scheda Raspberry Pi: l’ho chiamata Rpi-hw (leggi “raspberry pi hardware”). Confesso che questa è la prima volta che lavoro ad un driver di una periferica, ma con molta pazienza alla fine credo di essere riuscito a produrre qualcosa di interessante. (A chiunque interessasse dico solo che mi è bastato seguire attentamente il datasheet del SoC BCM2835, nella parte relativa al funzionamento del controller GPIO.)
Allo stato attuale la libreria ha assunto caratteristiche leggermente diverse da quelle che mi ero prefissato all’inizio e non si limita più alla sola gestione dell’interfaccia GPIO. Ho deciso, infatti, di ampliarla e farla diventare una vera e propria “libreria di collegamento” (o wiring library), che renda più semplice la comunicazione tra la Raspberry Pi ed altri dispositivi digitali. Per intenderci, vorrei riuscire a gestire questa scheda più o meno come si fa con Arduino.
Purtroppo (o per fortuna?) non ho una grande confidenza con quest’ultimo dispositivo e quindi ho dovuto lavorare parecchio d’immaginazione per poter sviluppare qualcosa che si rivelasse utile per la sua amica da 25$. Il risultato è stata una libreria basata su “interfacce“, di ingresso e di uscita, con le quali è possibile manipolare i GPIO della Raspberry Pi. I dispositivi di livello più astratto, come vedremo più avanti, saranno costituiti appunto da un’insieme di queste interfacce, con le quali essi potranno elaborare i segnali di ingresso e di uscita della scheda.
(continua…)
Pubblicato in Elettronica, Progetti, Programmazione, Raspberry Pi, Rpi-hw | Nessun commento »
martedì, 21 aprile 2009
Il mio primo pensiero riguardo la realizzazione del braccio meccanico era quello di progettare la base rotante su cui esso sarebbe stato montato.
La rotazione della base, similmente ad una “spalla” biologica, doveva essere controllata e calibrata dal computer in modo tale che il braccio si potesse orientare in qualsiasi direzione. C’erano due possibili soluzioni: optare per un motore passo passo oppure utilizzare un motoriduttore accoppiato ad un encoder.
(continua…)
Pubblicato in Elettronica, GNU/Linux, Meccanica, Progetti, Programmazione | 2 Commenti »
|
|