Hello I am working on a battlestar galactica cylon scanner and have found
the following snippet:
I would like to understand how to translate this code to B4R. I looked at the
LED sample snippet and found out, that every LED has to be initialized first.
Can somebody give me an idea what is the best way to translate the shown
code to B4R?
Thank you very much!
h725
the following snippet:
B4X:
void setup() {
// put your setup code here, to run once:
for (int pin= 2; pin <9; pin++) {
pinMode(pin,OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
int a = 2;
int t1 =35;
int t2 = 1000;
if (a=1){
for (int i = 2; i<9;i++){
digitalWrite(i,HIGH);
delay(t1);
digitalWrite(i+1,HIGH);
delay(t1);
digitalWrite(i+2,HIGH);
delay(t1);
digitalWrite(i,LOW);
// delay(t1);
digitalWrite(i+1,LOW);
}
for (int i = 8; i>1;i--){
digitalWrite(i,HIGH);
delay(t1);
digitalWrite(i-1,HIGH);
delay(t1);
digitalWrite(i-2,HIGH);
delay(t1);
digitalWrite(i,LOW);
delay(t1);
digitalWrite(i-1,LOW);
}
}
}
I would like to understand how to translate this code to B4R. I looked at the
LED sample snippet and found out, that every LED has to be initialized first.
Can somebody give me an idea what is the best way to translate the shown
code to B4R?
Thank you very much!
h725