និមិត្តសញ្ញា adafruit

Adafruit MCP3008 ឧបករណ៍បញ្ជា ADC

Adafruit-MCP3008-ADC-Controller-product

LK-Baseboard សម្រាប់ Raspberry Pi B+ / Pi 2

អតិថិជនជាទីគោរព!

thank you for your purchase of our product. In the next few pages we’ve described, what you’ll need to know for operating our product:

ផលិតផលលើសview

Adafruit-MCP3008-ADC-Controller-fig (1)

ការដំឡើង

គ្រប់គ្រងការបញ្ចូលអាណាឡូកតាមរយៈ MCP3008 1. ការដំឡើងម៉ូឌុលដែលត្រូវការ

We recommend to use an actual Raspbian OS-Image (Debian Wheezy). In our first step we’ve to activate the SPI-Interface of the Raspberry Pi, to make the communication with the ADC of the LK- Base board possible. For this, we’re starting with the following command:Adafruit-MCP3008-ADC-Controller-fig (2)

There will appear a new window, where we choose „Advanced Options“Adafruit-MCP3008-ADC-Controller-fig (3)

Then we go on „A6 SPI“Adafruit-MCP3008-ADC-Controller-fig (4)

The next two windows have to be accepted with “Yes” and “OK“Adafruit-MCP3008-ADC-Controller-fig (5)

ពីរបន្ទាប់ទៀត…Adafruit-MCP3008-ADC-Controller-fig (7)

Finally we go on “Finish“ to close the Configuration Tool…Adafruit-MCP3008-ADC-Controller-fig (8)

…and reboot the Raspberry Pi with the following command: Adafruit-MCP3008-ADC-Controller-fig (9)

After the Reboot, we’ve to load and install the needed Drivers and Modules. For this you have to put the following commands in the console of the Raspberry Pi and confirm each with a Press on [Enter]. In this procedure the Raspberry Pi have to be connected to the Internet:

Adafruit-MCP3008-ADC-Controller-fig (10)

បន្ទាប់ពីនេះអ្នកត្រូវចាប់ផ្តើមឡើងវិញ៖

Adafruit-MCP3008-ADC-Controller-fig (11)

Python-Example សម្រាប់ការប្រើប្រាស់ MCP3008 ADC Controller – testadc.py

Adafruit-MCP3008-ADC-Controller-fig (12)

នេះ។ file „testadc.py“ shows a way to measure analogue voltage Level with a Python script; with the function readadc() and a specified Channel (0-7), you can read out the actual value. Create a file with the name „testadc.py“ and copy the script shown above in this file (please make sure that you don’t miss any spaces). The script can now be used in two different ways:

Output the values of all ADC channels simultaneously:Adafruit-MCP3008-ADC-Controller-fig (13)

ពាក្យបញ្ជានេះបណ្តាលឱ្យតម្លៃនៃប៉ុស្តិ៍ ADC ទាំងអស់ត្រូវបានអាន និងបង្ហាញរៀងរាល់ 1.5 វិនាទី។Adafruit-MCP3008-ADC-Controller-fig (14)

Output of values from specific Channels:Adafruit-MCP3008-ADC-Controller-fig (15)

You can also read out the values from individual channels – specify them with their channel number directly after the command, separated with a spacer. In this example, this would be the channels [3] and [7]Adafruit-MCP3008-ADC-Controller-fig (16)

សំណួរគេសួរញឹកញាប់

  • How do I control analogue inputs through the MCP3008?
    • To control analogue inputs through the MCP3008, follow the provided Python example in the user manual by creating and running the “testadc.py” script.
  • តើខ្ញុំគួរធ្វើដូចម្តេចប្រសិនបើខ្ញុំជួបបញ្ហាជាមួយការដំឡើងកម្មវិធីបញ្ជា?
    • If you face problems during driver installation, ensure that your Raspberry Pi is connected to the internet and retry running the installation commands.

ឯកសារ/ធនធាន

Adafruit MCP3008 ឧបករណ៍បញ្ជា ADC [pdf] ការណែនាំអ្នកប្រើប្រាស់
MCP3008 ADC Controller, MCP3008, ADC Controller, Controller

ឯកសារយោង

ទុកមតិយោបល់

អាសយដ្ឋានអ៊ីមែលរបស់អ្នកនឹងមិនត្រូវបានផ្សព្វផ្សាយទេ។ វាលដែលត្រូវការត្រូវបានសម្គាល់ *