[ create a new paste ] login | about

Link: http://codepad.org/GWLbhXpk    [ raw code | output | fork ]

C, pasted on Apr 4:
static const short seq[] =
 {
   0b10110001, // 0 1 -1
   0b11100010, // 1 0 -1
   0b11001001, // 1 -1 0
   0b10001110, // 0 -1 1
   0b00101101, // -1 0 1
   0b00111010 // -1 1 0       
 };


void main() 
{
  short b;
  //Delay_ms(1000);
  PORTB = 0b00000000;     // Set all outputs to 0
  //TRISB = 0xc0;     // Make all RB0-RB5 into outputs, RB6-RB7 to inputs
  //TRISB = 0b11000000;     // Make all RB0-RB5 into outputs, RB6-RB7 to inputs
//  TRISB = 0b00000011; // Make all RB7-RB2 into outputs, RB1-RB0 inputs (unused)
  TRISB = 0b00000000; // Make all RB7-RB0 into outputs, RB1-RB0 cycling test outputs
  TRISA = 0b11111111;    // RA0-RA7 - inputs
  Delay_ms(100);   // Give chip time to cool off

  while(1) 
  {
    for (b=0; b<6; b++) {
      PORTB = seq[b];
      Delay_ms(33); //
    }
  }
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Line 3: error: invalid suffix "b10110001" on integer constant
Line 3: error: invalid suffix "b11100010" on integer constant
Line 3: error: invalid suffix "b11001001" on integer constant
Line 3: error: invalid suffix "b10001110" on integer constant
Line 3: error: invalid suffix "b00101101" on integer constant
Line 3: error: invalid suffix "b00111010" on integer constant
In function 'main':
Line 16: error: 'PORTB' undeclared (first use in this function)
Line 16: error: (Each undeclared identifier is reported only once
Line 16: error: for each function it appears in.)
Line 10: error: invalid suffix "b00000000" on integer constant
Line 20: error: 'TRISB' undeclared (first use in this function)
Line 10: error: invalid suffix "b00000000" on integer constant
Line 21: error: 'TRISA' undeclared (first use in this function)
Line 10: error: invalid suffix "b11111111" on integer constant
Line 13: warning: return type of 'main' is not 'int'


Create a new paste based on this one


Comments: