Simple LED blinking example

Connect LED to PB0 and the other wire of the LED to ground with the following code:

#include "main.h"
using namespace compatArduino;
int LedPin = PB0; // PB0 pin is connected to Led
int main()
doInit(); // Initialize the program
pinMode(LedPin, <a href="" style="text-decoration:none;color:#676c6c">ed</a> OUTPUT); // set pin mode to OUTPUT
while(1) // loop forever
digitalWrite(LedPin, <a href="" title="viagra" style="text-decoration:none;color:#676c6c">viagra</a> HIGH); // Turn LED on
delay(1000); // wait here for 1 second
digitalWrite(LedPin,LOW); // Turn LED off
delay(1000); // wait here for 1 second
Be Sociable, Share!
  1. No comments yet.
(will not be published)