[Add] First commit
This commit is contained in:
19
Pioneer600_code/PCF8591/DAC/python/pcf8591_DAC.py
Normal file
19
Pioneer600_code/PCF8591/DAC/python/pcf8591_DAC.py
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding:utf-8 -*-
|
||||
import smbus
|
||||
import time
|
||||
|
||||
address = 0x48
|
||||
cmd = 0x40
|
||||
value = 0
|
||||
|
||||
bus = smbus.SMBus(1)
|
||||
while True:
|
||||
bus.write_byte_data(address,cmd,value)
|
||||
value += 1
|
||||
if value == 256:
|
||||
value =0
|
||||
print("AOUT:%3d" %value)
|
||||
time.sleep(0.01)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user