Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hello, and sorry for my childish English. I get some errors by simplest things.
#include "mbed.h" I2C i2c(p28, p27); // sda, scl int addr = 0x46;// 0x46; // define the I2C Address DigitalOut mcp_reset(p19); DigitalOut myled(LED1); DigitalOut blink(LED2); blink = 1; myled = 0; mcp_reset = 1; int main() { char cmd[2]; //mcp_reset = 1; while(1) { cmd[0] = 0x0A; // pointer to command register cmd[1] = 0xFF; // Start ranging, results in cm i2c.write(addr, cmd, 2); // Send command string wait(0.07); // Could also poll, 65ms is typical } }The Compiler says myled, blink and mcp_reset has already been defined and has no storage class or specifier.
Whats the problem or am i only stupid?