pcDuino: an integrated microcomputer
In recent years computer systems have undergone a rapid development with a tendency towards miniaturized systems. Long gone are the systems that occupied several rooms and that could only do simple arithmetic. Currently computer systems are part of our daily life and essential in most of our activities.
WIth that some microcomputer boards have been developed which provide the flexibility of a computer system and the ease of implementation of electronic applications. The pcDuino is one of such boards.
WIth that some microcomputer boards have been developed which provide the flexibility of a computer system and the ease of implementation of electronic applications. The pcDuino is one of such boards.
pcDuino weirdness.
Being a relatively recent development board and on the low end of the cost-power scale, the pcDuino comes with a set of bugs and idiosincracies which one must understand in order to operate it correctly.
1) Connecting to the internet.
One of the first things the pcDuino showed was the inability to access the internet on every start. That is because the system resets the date to default settings and it must be updated. It can be done through this command where you must replace the date for the current one so the computer can connect to the internet.
$ sudo date -s '2015-10-09 07:41:00'
2) Chinese language settings.
By default pcDuino comes with Chinese language settings and they can't be modified as it lacks the language pack application. In order to install the language manager type the following in Terminal:
$ sudo apt-get --reinstall install language-selector-gnome
3) Old Chromium gives driver compatibility problems.
The Chromium version shipped by default with the board is out of date and can't be easily updated as it gives error messages. Its better to get rid of it and install another more up to date browser. The other option is to upgrade the Ubuntu distribution on the board, which won-t be covered in this tutorial. To install Firefox for example, use:
$ sudo apt-get remove chromium-browser
$ sudo apt-get remove chromium-browser-l10n
$ sudo apt-get update
$ sudo apt-get install firefox
4) GPIO module gets deconfigured.
The GPIO module allows access to the pcDuino's analog and digital ports. Sometimes it gets deconfigured. To manually configure the port for a given session you can type in console:
$ sudo modprobe gpio
To avoid having to do so every session its better to save it in the modules file which loads all components every session. To do so open the file through
a) sudo nano /etc/modules
b) Add 'gpio' to the file.
c) Save and login.
To check which modules are loaded you can use:
$ lsmod
And gpio should appear in the list.
1) Connecting to the internet.
One of the first things the pcDuino showed was the inability to access the internet on every start. That is because the system resets the date to default settings and it must be updated. It can be done through this command where you must replace the date for the current one so the computer can connect to the internet.
$ sudo date -s '2015-10-09 07:41:00'
2) Chinese language settings.
By default pcDuino comes with Chinese language settings and they can't be modified as it lacks the language pack application. In order to install the language manager type the following in Terminal:
$ sudo apt-get --reinstall install language-selector-gnome
3) Old Chromium gives driver compatibility problems.
The Chromium version shipped by default with the board is out of date and can't be easily updated as it gives error messages. Its better to get rid of it and install another more up to date browser. The other option is to upgrade the Ubuntu distribution on the board, which won-t be covered in this tutorial. To install Firefox for example, use:
$ sudo apt-get remove chromium-browser
$ sudo apt-get remove chromium-browser-l10n
$ sudo apt-get update
$ sudo apt-get install firefox
4) GPIO module gets deconfigured.
The GPIO module allows access to the pcDuino's analog and digital ports. Sometimes it gets deconfigured. To manually configure the port for a given session you can type in console:
$ sudo modprobe gpio
To avoid having to do so every session its better to save it in the modules file which loads all components every session. To do so open the file through
a) sudo nano /etc/modules
b) Add 'gpio' to the file.
c) Save and login.
To check which modules are loaded you can use:
$ lsmod
And gpio should appear in the list.
Led blink.
The simplest example available on pcDuino is the blink application which activates and deactivates a led in a set of intervals. In this case we blink two leds connected to port 2 and 3 of the pcDuino.
blink.py
#!/usr/bin/env python
import gpio
import time
lmotorf = "gpio2"
rmotorf = "gpio3"
def delay(ms):
time.sleep(1.0*ms/1000)
def setup():
gpio.pinMode(lmotorf, gpio.OUTPUT)
gpio.pinMode(rmotorf, gpio.OUTPUT)
def loop():
while(1):
gpio.digitalWrite(lmotorf, gpio.HIGH)
gpio.digitalWrite(rmotorf, gpio.HIGH)
delay(1000)
gpio.digitalWrite(lmotorf, gpio.LOW)
gpio.digitalWrite(rmotorf, gpio.LOW)
delay(1000)
def main():
setup()
loop()
main()
#!/usr/bin/env python
import gpio
import time
lmotorf = "gpio2"
rmotorf = "gpio3"
def delay(ms):
time.sleep(1.0*ms/1000)
def setup():
gpio.pinMode(lmotorf, gpio.OUTPUT)
gpio.pinMode(rmotorf, gpio.OUTPUT)
def loop():
while(1):
gpio.digitalWrite(lmotorf, gpio.HIGH)
gpio.digitalWrite(rmotorf, gpio.HIGH)
delay(1000)
gpio.digitalWrite(lmotorf, gpio.LOW)
gpio.digitalWrite(rmotorf, gpio.LOW)
delay(1000)
def main():
setup()
loop()
main()