Datasheet

// the output in the mid-range
while ( TRUE ) do // Endless loop
begin
if ((PINA.B0) and (value < 4095)) then // If PA0 button is
pressed
Inc(value) // increment value
else
begin
if ((PINA.B1) and (value > 0)) then // If PA1 button
is pressed
Dec(value); // decrement value
end;
DAC_Output(value); // Send value to DAC chip
Delay_ms(1); // Slow down key repeat pace
end;
end.
378
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6