be80be
Well-Known Member
I tried this the outcome not what i was thinking it's just doing the the last statement.
so I tried this
which is kind of what im looking for but it puts a line in middle going from 0 strait up too 5 volts.
Well i figured that out no more line. Can't use 32 it's 0 to 31 for the 32 bits.
C:
while (1)
{
for(count=0; count<=32; count++)
{
DAC_SetOutput(count);
__delay_ms(10);
}
for(count=32; count>=0; count--)
{
DAC_SetOutput(count);
__delay_ms(10);
}
}
Code:
while (1)
{
do
{
DAC_SetOutput(count);
__delay_ms(10);
count = count++;
}while (count < 32);
do
{
DAC_SetOutput(count);
__delay_ms(10);
count = count--;
}while (count > 0);
count = 0;
}
Well i figured that out no more line. Can't use 32 it's 0 to 31 for the 32 bits.
Last edited: