Jump to content

dandan7932

Members
  • Posts

    12
  • Joined

  • Last visited

Reputation Activity

  1. Like
    dandan7932 reacted to StuxNet in How to turn ON/OFF Orangepi PC from Button on GPIO   
    For personal simplicity I would git clone https://github.com/duxingkei33/orangepi_PC_gpio_pyH3
    Setup whatever pin you're connecting the switch to using the PYA20 library's (above) example code as seen here: https://pypi.python.org/pypi/pyA20
    Use that library read the switch. For example: If pin high/low or on/off, use python subprocess or os.system functions to run linux shutdown, reboot command.

    I might be able to give you a sample script or more concise instructions but don't hold your breath. For now I'll give you this, which is a pretty damn good start for having not really started
    This is a script I was using on a NanoPiNeoAir using a reed (magnetic) switch attached to a door but could be easily changed to suit your needs. I've commented out the stuff that you won't need but much of the variable names are the same soo.... pretend the door is your switch! Or you can change the prompts/names yourself.

    https://gist.github.com/BiTinerary/2734ac46e80af2b1a2158c9f0ba79e25

    P.s. You'll need to specify the pin you're using for your button but if you use my script in tandem with the tutorial you link to (replace LED with switch) it should 'technically' work. Hack away at it, see what you can come up with and report back. Also..... you have heatsinks on your RAM dies but not your CPU? Sup with that?
  2. Like
    dandan7932 reacted to martinayotte in I2C DTS Overlay enable pull up resistor   
    Don't try to enable internal GPIO pullups, it is waste of time since internal ones are too weak for I2C, which need something like 3K while internals are usually around 30K.
    Simply add some external ones on one of your peripherals ...
     
  3. Like
    dandan7932 got a reaction from Gunjan Gupta in SSD1351 RGB SPI OLED NanoPi Neo v1.4 dtoverlay help   
    omg total noob mistake, had the SDA (MOSI) line on the MISO pin!!! 
    but it works on reboot now!! 
    thank you so much! you are an absolute legend!!
     
    haha ok i will remove the "param_spidev_spi_cs=1" from armbianEnv.txt
     
    Thank you again!
     
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines