OpenSprinkler Forums OpenSprinkler Unified Firmware Need positive logic from the 74HC595 output Reply To: Need positive logic from the 74HC595 output

#39087

mikek
Participant

I can’t seem to find a reference to the syntax of the write command.

In line 120 of gpio.cpp

if (1 != write(fd, &s_values_str[LOW == value ? 0 : 1], 1)) {

To me it looks like fd is the io handle and &s_values_str[LOW == value ? 0 : 1] will be the address of either the “0” or the “1” in the s_values_str array, but what is the last peramiter for (the , 1)? Also why return the address of the string element why not just use a HIGH or LOW? Is this needed for the write function?

I can’t seen to find the write function in the gcc stdio or any of cpp io functions

We are currently away till Monday July 21. Orders placed during this time will be shipped on Tuesday July 22. Thank you for your understanding!
This is default text for notification bar