You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the only way to trigger the event is to press on the virtual button, which is not ideal
We also want to consider external inputs, hence the integration of WiringPi is needed to control the GPIO (General Purpose Input/Output)
Inside the gather_data() function previously known as flash() (this is another issue that we need to do) we want to get input from the GPIO and based off of that information, trigger the appropriate function
Given this is a nonbinary event, we will be reading the integer value returned and use that
In terms of the GPIO pin to use, assume that value will come from the global_variables as an integer
Implementation:
You will need to add a pinMode() to the setup() function of the said class
You will need to read in the value at the said pin in the gather_data() function and trigger the appropriate function within the class
For now, we will not worry about writing any values to the GPIO (we may need to later on?!), depends on how it will be electrically connected. For now, we will be strictly reading from GPIO only!
Below is an example of how to blink an LED with wiringPI (notice it takes direct influence on the Arduino syntax):
gather_data()
function previously known asflash()
(this is another issue that we need to do) we want to get input from the GPIO and based off of that information, trigger the appropriate functionglobal_variables
as an integerImplementation:
pinMode()
to thesetup()
function of the said classgather_data()
function and trigger the appropriate function within the classFor now, we will not worry about writing any values to the GPIO (we may need to later on?!), depends on how it will be electrically connected. For now, we will be strictly reading from GPIO only!
Below is an example of how to blink an LED with wiringPI (notice it takes direct influence on the Arduino syntax):
Hence this means, you can use
digitalRead(PIN_NUMBER);
to gather information!The text was updated successfully, but these errors were encountered: