Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. mihazi
    M
    • Continue chat with mihazi
    • Start new chat with mihazi
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    mihazi

    @mihazi

    0
    Reputation
    3
    Posts
    1096
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    mihazi Follow

    Posts made by mihazi

    • RE: Do you have any faces keyboard programs?

      Problem solved. Apparently this skethes only for faces-modules, not for Core-module.
      You should be more specific in progrmamm description. Whatever, thanks for answer.

      posted in FACES Kit
      M
      mihazi
    • RE: Do you have any faces keyboard programs?

      @lukasmaximus
      I took GameBoy.ino file from https://github.com/m5stack/FACES-Firmware, Install ArduinoIDE from official site and setup esp32 support. Sketch file is original, not modified.
      And now, I get error, as start compile there. here is full text:

      C:\Users\userrrr\Downloads\FACES-Firmware-master\FACES-Firmware-master\GameBoy\GameBoy.ino: In function 'void setup()':
      
      GameBoy:16:3: error: 'DDRC' was not declared in this scope
      
         DDRC = 0x01;
      
         ^
      
      GameBoy:17:3: error: 'PORTC' was not declared in this scope
      
         PORTC = 0x01;
      
         ^
      
      GameBoy:18:3: error: 'DDRD' was not declared in this scope
      
         DDRD = 0x00;
      
         ^
      
      GameBoy:19:3: error: 'PORTD' was not declared in this scope
      
         PORTD = 0x00;
      
         ^
      
      GameBoy:20:3: error: 'DDRB' was not declared in this scope
      
         DDRB = 0x00;
      
         ^
      
      GameBoy:21:3: error: 'PORTB' was not declared in this scope
      
         PORTB = 0xff;
      
         ^
      
      GameBoy:22:11: error: 'PINB' was not declared in this scope
      
         oldPINB=PINB;
      
                 ^
      
      C:\Users\userrrr\Downloads\FACES-Firmware-master\FACES-Firmware-master\GameBoy\GameBoy.ino: In function 'void requestEvent()':
      
      GameBoy:30:14: error: 'PINB' was not declared in this scope
      
         Wire.write(PINB);
      
                    ^
      
      GameBoy:10:23: error: 'PORTC' was not declared in this scope
      
       #define IRQ_1 Set_Bit(PORTC,0)
      
                             ^
      
      C:\Users\userrrr\Downloads\FACES-Firmware-master\FACES-Firmware-master\GameBoy\GameBoy.ino:5:32: note: in definition of macro 'Set_Bit'
      
       #define Set_Bit(val, bitn)    (val |=(1<<(bitn)))
      
                                      ^
      
      C:\Users\userrrr\Downloads\FACES-Firmware-master\FACES-Firmware-master\GameBoy\GameBoy.ino:34:5: note: in expansion of macro 'IRQ_1'
      
           IRQ_1;
      
           ^
      
      C:\Users\userrrr\Downloads\FACES-Firmware-master\FACES-Firmware-master\GameBoy\GameBoy.ino: In function 'void loop()':
      
      GameBoy:40:6: error: 'PINB' was not declared in this scope
      
         if(PINB!=oldPINB)
      
            ^
      
      GameBoy:11:23: error: 'PORTC' was not declared in this scope
      
       #define IRQ_0 Clr_Bit(PORTC,0)
      
                             ^
      
      C:\Users\userrrr\Downloads\FACES-Firmware-master\FACES-Firmware-master\GameBoy\GameBoy.ino:6:33: note: in definition of macro 'Clr_Bit'
      
       #define Clr_Bit(val, bitn)     (val&=~(1<<(bitn)))
      
                                       ^
      
      C:\Users\userrrr\Downloads\FACES-Firmware-master\FACES-Firmware-master\GameBoy\GameBoy.ino:44:5: note: in expansion of macro 'IRQ_0'
      
           IRQ_0;
      
           ^
      
      exit status 1
      'DDRC' was not declared in this scope
      

      and here ino file

      #include <Wire.h>
      
      #define FACES_KEYBOARD_I2C_ADDR 0x08
      
      #define Set_Bit(val, bitn)    (val |=(1<<(bitn)))
      #define Clr_Bit(val, bitn)     (val&=~(1<<(bitn)))
      #define Get_Bit(val, bitn)    (val &(1<<(bitn)) )
      //KEY PORTB
      //IRQ PC0
      #define IRQ_1 Set_Bit(PORTC,0)
      #define IRQ_0 Clr_Bit(PORTC,0)
      
      unsigned char oldPINB=0;
      void setup()
      {
        DDRC = 0x01;
        PORTC = 0x01;
        DDRD = 0x00;
        PORTD = 0x00;
        DDRB = 0x00;
        PORTB = 0xff;
        oldPINB=PINB;
        Wire.begin(FACES_KEYBOARD_I2C_ADDR);
        Wire.onRequest(requestEvent);
      }
      unsigned char i = 0;
      unsigned char temp = 0, hadPressed = 0;
      void requestEvent()
      {
        Wire.write(PINB);
        if (hadPressed == 1)
        {
          hadPressed = 0;
          IRQ_1;
        }
      
      }
      void loop()
      {
        if(PINB!=oldPINB)
        {
          temp=PINB;
          oldPINB=temp;
          IRQ_0;
          hadPressed = 1;
        }
        /*
        if (PINB != 0xff)
        {
          switch(PINB)
          {
            case 0xFE:temp='U';while(PINB!=0xff)delay(1);IRQ_0;hadPressed = 1;break;
            case 0xFD:temp='D';while(PINB!=0xff)delay(1);IRQ_0;hadPressed = 1;break;
            case 0xFB:temp='L';while(PINB!=0xff)delay(1);IRQ_0;hadPressed = 1;break;
            case 0xF7:temp='R';while(PINB!=0xff)delay(1);IRQ_0;hadPressed = 1;break;
            case 0xEF:temp='A';while(PINB!=0xff)delay(1);IRQ_0;hadPressed = 1;break;
            case 0xDF:temp='B';while(PINB!=0xff)delay(1);IRQ_0;hadPressed = 1;break;
            case 0xBF:temp='s';while(PINB!=0xff)delay(1);IRQ_0;hadPressed = 1;break;
            case 0x7F:temp='S';while(PINB!=0xff)delay(1);IRQ_0;hadPressed = 1;break;
          }
        }*/
        delay(10);
      }
      
      posted in FACES Kit
      M
      mihazi
    • RE: Do you have any faces keyboard programs?

      i got this message too. on compilation phase. Arduino IDE. It was updated to 1.8.10. I choose M5Stack-Core-ESP32 board.

      posted in FACES Kit
      M
      mihazi