RPi.GPIO python module for Pine A64/A64+
#82
Since I'm running Armbian, I'm using /dev/i2c-1 instead of /dev/twi1.
But here is some code I'm using to make some LEDs flashing on an MCP23017 :


Code:
#!/usr/bin/env python

import sys, time
from RPi import I2C as i2c

i2c.init("/dev/i2c-1")
i2c.open(0x20)
i2c.write([0x00, 0x00])
i2c.write([0x01, 0x00])
while True:
    i2c.write([0x12, 0x0F])
    i2c.write([0x13, 0x0F])
    time.sleep(0.15)
    i2c.write([0x12, 0xF0])
    i2c.write([0x13, 0xF0])
    time.sleep(0.15)
  Reply


Messages In This Thread
RE: RPi.GPIO python module for Pine A64/A64+ - by martinayotte - 09-03-2017, 03:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  fm transmitter with gpio weasel18 2 4,834 09-10-2019, 04:28 AM
Last Post: desai_amogh
  How to use dts or other setup to declare gpio pin Interrupt (e.g. a button)? dkebler 1 3,604 06-12-2019, 10:37 AM
Last Post: dkebler
Lightbulb Sample GPIO codes highlighting RPi.GPIO-PineA64 and the PI bus MarkHaysHarris777 6 11,147 06-07-2019, 12:37 AM
Last Post: tllim
Star GPIO, SPI and I2C C++ Lib databit 7 11,227 02-04-2019, 05:45 AM
Last Post: Jeff R
Information Howto: Controlling Pine64 GPIO via the filesystem (sysfs) on linux pfeerick 4 11,860 01-24-2019, 03:36 AM
Last Post: Fifth
  GPIO and SPI SamR1 20 31,648 03-15-2018, 10:32 AM
Last Post: jomoengineer
Question GPIO shockr 7 14,787 03-11-2018, 01:52 AM
Last Post: jomoengineer
  Read GPIO problem shworker 14 21,199 08-17-2017, 01:21 PM
Last Post: martinayotte
  Cross-wired Uart Ports between two Pine Boards via Cat5 Cable MarkHaysHarris777 10 16,033 11-20-2016, 04:17 AM
Last Post: pfeerick
  GPIO fiq capability joseph 3 6,104 11-10-2016, 06:07 PM
Last Post: joseph

Forum Jump:


Users browsing this thread: 1 Guest(s)