Hi does any know how to convert this code to ccs code ? i want scan knight rider light left to right . I have tried but faild !
[/code]void main()
{
trisb = 00000000b; // set port b to output
trisa= 11111111b; // set port a to inputs
char data = 00000001b; // initial data.
bool movingRight = true;
while( 1 )
{
bit button = porta.0;
// portb = 00111111;//data; // update port
delay_ms( 50 );
// if (button==1)
portb=data; // update port
{
if( movingRight )
{
data <<= 1;
if( data.5 ) // msb set
movingRight = false;
}
else
{
data >>= 1;
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum