无法打开/ dev / mem,请尝试检查权限

时间:2013-04-24 11:56:50

标签: c++ raspberry-pi

我正在尝试运行此程序并将输出保存到文本文件中:

//Include ArduPi library
#include "eHealth.h"

//Needed for eHealth
eHealthClass eHealth;

// The loop routine runs over and over again forever:
void loop() {

  float ECG = eHealth.getECG();

  printf("ECG value :  %f V\n",ECG);
  delay(1000);
}

int main (){
   //setup();
   while(1){
      loop();
   }
   return (0);
}

它会运行几秒钟,然后我收到以下错误:

Failed to open /dev/mem, try checking permissions.
Failed map the physical GPIO registers into the virtual memory space
Failed to open /dev/mem, try checking permissions.
Failed to map the physical BSCO (I2C) registers into the virtual memory space

任何建议都会很棒。

感谢。

0 个答案:

没有答案