Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte outputPins[] = {3,4,5,6,7,8,9};
- byte currentValue = 0;
- //ABCDEFG0
- byte lookupTable[] = {BXXXXXXX0, //0
- BXXXXXXX0, //1
- BXXXXXXX0, //2
- BXXXXXXX0, //3
- BXXXXXXX0, //4
- BXXXXXXX0, //5
- BXXXXXXX0, //6
- BXXXXXXX0, //7
- BXXXXXXX0, //8
- BXXXXXXX0}; //9
- void setup(){
- for(byte a = 0; a < 7; a++){
- pinMode(outputPins[a],OUTPUT);
- }
- }
- void loop(){
- if(currentValue == 11){
- currentValue = 0;
- }
- for(byte a = 0; a < 7;a++){
- if(lookupTable[currentValue] & (0x80 >> a)){
- digitalWrite(outputPins[a],HIGH);
- }else{
- digitalWrite(outputPins[a],LOW);
- }
- }
- delay(1000);
- currentValue++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement