--- Quote Start ---
originally posted by pmicro@Mar 13 2006, 10:53 AM
hi
in my statement i declare
static alt_u8 count ;//8 digital input
static alt_u8 mem;# define bit0 count&0x01 //first bit of byte count # define fp mem&0x01 //first bit of byte mem # define true 1# define false 0
if ((bit0 ) & (!fp)
{
//.....make something
fp=1;
}
if(!bit0)
{
fp=0;
}
//witn this software i would like to have e positive edge on my first button input
but in during compilation i cannot assign bit0=1 or bit0=true
i don't want to use rising edge capture but use this simple sw like usually i use
in plc program
where do i make mistake ?
how can i assign a value to bit0?
thanks for ansuwers
walter
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13386)
--- quote end ---
--- Quote End ---
count = count | 0x01;
This (or 0x2, 0x4, etc) will set whatever bit in the variable you want. If you're trying to set a bit on a line (like the enable to a FIFO or something) you need to use a PIO.