Help modifying the code in the Elektor ethernet article?
Posted: 16 Apr 2009 14:44
I have tested the exampel code associated with the MikroElektronika ethernet article in Elektor http://www.mikroe.com/en/article/09/02/#pic. It works very nicely. I have also managed to modify the code so I have one more ON/OFF button. But I do not understand how I shall change the code so the background color of my added button changes with the state of the PORT pin.
I assume that it is this part of the example code that changes the color of the button in the exampel:
I wonder if someone could tell me how to figure out what number should be added to @indexPage to change the color of my added button? I have tried with trial and error but it has always been wrong.
Regards
Ulf
I assume that it is this part of the example code that changes the color of the button in the exampel:
Code: Select all
if (PORTB.0) then
begin
tmp := '#FFFF00'; memcpy(@indexPage+340, @tmp, 6); // highlight (yellow) ON
tmp := '#4974E2'; memcpy(@indexPage+431, @tmp, 6); // clear OFF
end
else
begin
tmp := '#4974E2'; memcpy(@indexPage+340, @tmp, 6); // clear ON
tmp := '#FFFF00'; memcpy(@indexPage+431, @tmp, 6); // highlight (yellow) OFF
end;
Regards
Ulf