Keybord trouble

i am working on a project uses a special keybord and an antenna to text, like a walki-talky but with texting. before ordering any parts i wanted to try the arduino code out to see if everything worked, at first i just downloded the corect library the "m5stack" library and took the only sample code i could find online and tried it out but it gave a

Documents/Arduino/libraries/M5Stack-master/src/Fonts/Font16.c:10:10: fatal error: pgmspace.h: No such file or directory
#include <pgmspace.h>
^~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: exit status 1

eror even if i did not call the library in. next i tried to downlode the pgmspace.h library but could not find it. i also came to the conclusion that the m5stack.h library was calling in the pgmspace.h library i wanted to look at the library but there were so many files i could not find what i wanted
sample code :

#include <Wire.h>
#include <M5Stack.h>

#define CARDKB_ADDR 0x5F

void setup()
{
M5.begin();
Serial.begin(115200);
Wire.begin();
pinMode(5, INPUT);
digitalWrite(5, HIGH);
M5.Lcd.fillScreen(BLACK);
M5.Lcd.setCursor(1, 10);
M5.Lcd.setTextColor(YELLOW);
M5.Lcd.setTextSize(2);
M5.Lcd.printf("IIC Address: 0x5F\n");
M5.Lcd.printf(">>");
}
void loop()
{
Wire.requestFrom(CARDKB_ADDR, 1);
while (Wire.available())
{
char c = Wire.read(); // receive a byte as characterif
if (c != 0)
{
M5.Lcd.printf("%c", c);
Serial.println(c, HEX);
// M5.Speaker.beep();
}
}
}

library downlode :GitHub - m5stack/M5Stack: M5Stack Arduino Library

keybord site : CardKB Mini Keyboard Programmable Unit V1.1 (MEGA8A) | m5stack-store

and m5stack is a company similar to arduino and that company made the keybord.

pls help thanks

Every library usually have an example folder... this one does, also.

Your code, formatted.

#include <M5Stack.h>
#include <Wire.h>

#define CARDKB_ADDR 0x5F

void setup() {
  M5.begin();
  Serial.begin(115200);
  Wire.begin();
  pinMode(5, INPUT);
  digitalWrite(5, HIGH);
  M5.Lcd.fillScreen(BLACK);
  M5.Lcd.setCursor(1, 10);
  M5.Lcd.setTextColor(YELLOW);
  M5.Lcd.setTextSize(2);
  M5.Lcd.printf("IIC Address: 0x5F\n");
  M5.Lcd.printf(">>");
}
void loop() {
  Wire.requestFrom(CARDKB_ADDR, 1);
  while (Wire.available()) {
    char c = Wire.read();  // receive a byte as characterif
    if (c != 0) {
      M5.Lcd.printf("%c", c);
      Serial.println(c, HEX);
      // M5.Speaker.beep();
    }
  }
}

I think the library was written before the "pgmspace.h" file was moved to "avr/pgmspace.h". Try editing the library file
"Documents/Arduino/libraries/M5Stack-master/src/Fonts/Font16.c"

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.