cristicsordas / raspi_robot

0 stars 0 forks source link

Implementation driver for PCF8591 controller #6

Closed cristicsordas closed 1 year ago

cristicsordas commented 1 year ago

Implement a driver for the 8 bit A/D and D/A PCF 8591 controller. DoD: Sending the message "2 0" and "2 1" should return the values of the light sensors for the left(channel 0) and right (channel 1) sides.

cristicsordas commented 1 year ago

the implementation is done with the commit 02bb8846b8c3149c107f66bfd4882cf4726fda03 There is a fix in this commit cb440e634037d5343cee222d0c7df437e88744bf The update in the buildroot repo was done with the commit: b3bae4c477bba29da31c3bc0f818917a4453e7d2

I started this python application, see the commit 466f9d60d8e2f68b575520bd21c565fa522b8fc4 The application sends cyclic the messages "2 0" and "2 1" The log displays shows that the values from the sensors were read. This is the output from the logging: data received. length: 4 open device /dev/pcf8591 pcf channel read 4 bytes. data 8 56:0:0:0 value1 56 read 4 bytes. data 31:0:0:0 value2 31 read 4 bytes. data < 60:0:0:0 value1 60 read 4 bytes. data 31:0:0:0 value2 31 read 4 bytes. data 31:0:0:0 value1 31 read 4 bytes. data 31:0:0:0 value2 31 result 0 31