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.
M
Posts made by mihazi
-
RE: Do you have any faces keyboard programs?
-
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); }
-
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.