Android Question Things lib and I2 pins

kalarius

Active Member
Licensed User
Longtime User
How can I use the things lib with I2 or pwm pins of Gipo of raspberry with B4a
Android ver 4.2.2
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Lets start with PWM:
B4X:
Dim jo As JavaObject = PeripheralManager
Log(jo.RunMethod("getPwmList", Null))
Dim pwm As JavaObject = jo.RunMethod("openPwm", Array("PWM0"))

Dim frequency As Double = 240
Dim DutyCycle As Double = 25
pwm.RunMethod("setPwmFrequencyHz", Array(frequency))
pwm.RunMethod("setPwmDutyCycle", Array(dutyCycle))
pwm.RunMethod("setEnabled", Array (True))
 
Upvote 0
Top