Your code looks OK.
The problem is that the chip you are using , 16F627 doesnt have an A to D converter
so the READAD command wont work.
User something like a 16F88 or 16F886.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried to write a simple PWM routine to brighten and dim a LED. The code would not compile and the error file showed the following:
a-d.h (422): Error: Incorrect parameters in Set, expected: Set variable.bit status
I looked at the file with the Crimson Editor and of course had no idea how to fix it.
I have installed the updated files and reinstalled the GCBASIC just in case just in case the latest version is better than the updated files.
Here is my code. If something in the code is causing this problem please let me know.
#chip 16f627a, 4
#define PWM_Out1 PORTB.3
dir PORTB.3 out
dir PORTA.0 in
dim measure as byte
dim old as byte
old =0
do
measure = ReadAD(AN0)
if measure <> old then
PWMOut 1, measure,100
old = measure
end if
loop
If the include file is bad can someone please tell me how to fix it.
Steve
Your code looks OK.
The problem is that the chip you are using , 16F627 doesnt have an A to D converter
so the READAD command wont work.
User something like a 16F88 or 16F886.
Thanks.
That fixed it.