SilverThings / bulldog

Java GPIO Library for BeagleBoneBlack, Raspberry Pi and CubieBoard.
http://www.silverspoon.io
Apache License 2.0
49 stars 23 forks source link

How to read digital input signal #55

Closed max90727 closed 9 years ago

max90727 commented 9 years ago

Hi. I write some code for reading the digital input, but I got the error as "could not create pin". Please help me. Board board = Platform.createBoard(); DigitalInput digitalInput=board.getPin(BBBNames.P8_12).as(DigitalInput.class); Signal signal=digitalInput.read(); System.out.println(signal.getNumericValue());

mijaros commented 9 years ago

Hello, are you running your code as root? Are there any exceptions printed?

pmacik commented 9 years ago

Hi max90727, I fixed the code that most likely caused your issue. Can you please try your code now and confirm it works for you?

Thanks!

max90727 commented 9 years ago

Thanks for your help. My project goes fine now, and I found that I can read the signal from my temperature sensor by building the device tree. Anyway, still thanks for your help and I will try that when I have more time.