Tag: mcp3008

Raspberry Pi dan Input Analog

#!/usr/bin/env python # Written by Limor “Ladyada” Fried for Adafruit Industries, (c) 2015 # This code is released into the public domain import time import os import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) DEBUG = 1 # read SPI data from MCP3008 chip, 8 possible adc’s (0 thru 7) def readadc(adcnum, clockpin, mosipin, misopin, cspin): if ((adcnum …

Continue reading