user8121:    I'm trying to teach myself some low[er] level code, but I just can't get it to work. I've tried OR-ing stuff in, AND-ing stuff in, and just straight up defining stuff, but it's not blinking! What am I doing wrong here?
I am using an Arduino UNO R3 DIP for this. I am just using the on-board LED, (on pin13/PORTB_5)
Current code:
#define STATE B00001000
#define ZERO B00000000
void setup() {
    DDRB = STATE;
    }

void loop(){
    PORTB |= STATE;
    delay(500);
    PORTB &= ZERO;
    delay(500);
    }


user4143: It would probably help if you were using the right pin.  In the pins_arduino.h file for the Uno is this diagram:
//                  +-\/-+
//            PC6  1|    |28  PC5 (AI 5)
//      (D 0) PD0  2|    |27  PC4 (AI 4)
//      (D 1) PD1  3|    |26  PC3 (AI 3)
//      (D 2) PD2  4|    |25  PC2 (AI 2)
// PWM+ (D 3) PD3  5|    |24  PC1 (AI 1)
//      (D 4) PD4  6|    |23  PC0 (AI 0)
//            VCC  7|    |22  GND
//            GND  8|    |21  AREF
//            PB6  9|    |20  AVCC
//            PB7 10|    |19  PB5 (D 13)
// PWM+ (D 5) PD5 11|    |18  PB4 (D 12)
// PWM+ (D 6) PD6 12|    |17  PB3 (D 11) PWM
//      (D 7) PD7 13|    |16  PB2 (D 10) PWM
//      (D 8) PB0 14|    |15  PB1 (D 9) PWM
//                  +----+

That shows that pin D 13 is PB5 which would be a binary value of 0b00100000 not 0b00001000 as you have, which would be PB3, or pin D11.
The only way I can come up with 0b00001000 is if I count from the left (wrong) and start at 1 (wrong) rather than count from the right (right) and start at 0 (right).

8121: <p>&nbsp;&nbsp;&nbsp;I'm trying to teach myself some low[er] level code, but I just can't get it to work. I've tried OR-ing stuff in, AND-ing stuff in, and just straight up defining stuff, but it's not blinking! What am I doing wrong here?</p>

<p>I am using an Arduino UNO R3 DIP for this. I am just using the on-board LED, (on pin13/PORTB_5)</p>

<p>Current code:</p>

<pre><code>#define STATE B00001000
#define ZERO B00000000
void setup() {
    DDRB = STATE;
    }

void loop(){
    PORTB |= STATE;
    delay(500);
    PORTB &amp;= ZERO;
    delay(500);
    }
</code></pre>
 4143: <p>It would probably help if you were using the right pin.  In the pins_arduino.h file for the Uno is this diagram:</p>

<pre><code>//                  +-\/-+
//            PC6  1|    |28  PC5 (AI 5)
//      (D 0) PD0  2|    |27  PC4 (AI 4)
//      (D 1) PD1  3|    |26  PC3 (AI 3)
//      (D 2) PD2  4|    |25  PC2 (AI 2)
// PWM+ (D 3) PD3  5|    |24  PC1 (AI 1)
//      (D 4) PD4  6|    |23  PC0 (AI 0)
//            VCC  7|    |22  GND
//            GND  8|    |21  AREF
//            PB6  9|    |20  AVCC
//            PB7 10|    |19  PB5 (D 13)
// PWM+ (D 5) PD5 11|    |18  PB4 (D 12)
// PWM+ (D 6) PD6 12|    |17  PB3 (D 11) PWM
//      (D 7) PD7 13|    |16  PB2 (D 10) PWM
//      (D 8) PB0 14|    |15  PB1 (D 9) PWM
//                  +----+
</code></pre>

<p>That shows that pin D 13 is PB5 which would be a binary value of <code>0b00100000</code> not <code>0b00001000</code> as you have, which would be PB3, or pin D11.</p>

<p>The only way I can come up with <code>0b00001000</code> is if I count from the left (wrong) and start at 1 (wrong) rather than count from the right (right) and start at 0 (right).</p>
