Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const char nums[10] = {0x7E,0x48,0xBC,0xB6,0xD2,0xE6,0xEE,0x72,0xFE,0xF6};
- void setup() {
- for(int i=2;i<10;i++){
- pinMode(i, OUTPUT);
- digitalWrite(i, LOW);
- }
- }
- void dispnum7segment(int n) {
- for(int i=0;i<8;i+=1){
- digitalWrite(9-i,bitRead(nums[n],i));
- }
- }
- void loop() {
- for(int k=0;k<10;k++){
- dispnum7segment(k);
- delay(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement