I have used the RCtime page from arduino.cc to get a single channel photoresistor to work and have a decent analog output. The cap is 1002nF and the resistor is 1kohm.
I got the code for A0 to work. The problem is when I added the second channel. I copied the code and built the second channel exactly the same.
My problem is adding the second channel. When I get the code without errors, the second photo resistor changes the value for both sides.
After I get this figured out and working electrically I will need to change the code to operate motors.
I know I am asking a lot over a forum but is there a site or video that I can look at and figure this out?
(Current error codes)
Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"
C:\*: In function 'long int RCtime(int)':
C:\*:17:8: warning: unused variable 'result' [-Wunused-variable]
long result = 0;
^
C:\*:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
C:\*: At global scope:
Semester_project_code:25:1: error: expected unqualified-id before '{' token
{
^
C:\*: In function 'long int RCtime(int)':
Semester_project_code:30:6: error: redefinition of 'long int RCtime(int)'
long RCtime(int(trPin))
^
C:\*:15:6: note: 'long int RCtime(int)' previously defined here
long RCtime(int tlPin)
^
Semester_project_code:39:1: error: expected primary-expression before '}' token
}
^
C:\*:32:8: warning: unused variable 'result' [-Wunused-variable]
long result = 0;
^
C:\*:39:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
exit status 1
expected unqualified-id before '{' token
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.







Comments