Skip to content

@uwekamper /gist:9c8bdeff7f2fc999398e
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
c-base-Plasmaleitung / Space-Shlong
/**
* Plasma-Leitungs-Code für die c-base
*/
// most launchpads have a red LED
#define LED1 P1_7
#define LED2 P1_6
#define LED3 P2_5
#define LED4 P2_4
#define LED5 P2_3
#define LA1 P1_5
#define LA2 P2_0
#define LA3 P2_1
#define LA4 P2_2
#define DELAY 90
int i = 0;
//see pins_energia.h for more LED definitions
//#define LED GREEN_LED
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LA1, OUTPUT);
pinMode(LA2, OUTPUT);
pinMode(LA3, OUTPUT);
pinMode(LA4, OUTPUT);
pinMode(P1_0, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
int foo = 1<<(i % 4);
digitalWrite(P1_0, foo & 1 ? HIGH : LOW);
digitalWrite(LA1, foo & 1 ? HIGH : LOW);
digitalWrite(LA2, foo & 2 ? HIGH : LOW);
digitalWrite(LA3, foo & 4 ? HIGH : LOW);
digitalWrite(LA4, foo & 8 ? HIGH : LOW);
foo = 1<<(i % 5);
digitalWrite(LED1, foo & 1 ? HIGH : LOW);
digitalWrite(LED2, foo & 2 ? HIGH : LOW);
digitalWrite(LED3, foo & 4 ? HIGH : LOW);
digitalWrite(LED4, foo & 8 ? HIGH : LOW);
digitalWrite(LED5, foo & 16 ? HIGH : LOW);
delay(DELAY);
i++;
// handle integer overflow
if (i >= 20) {
i = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.