Hello,
I have the Intel Edison connected to SparkFun’s Base Block, then to SF’s GPIO block, then to the battery block (which is switched off and powering all thru USB).
When I turn on 4 of the GPIO (labeled GP44,45,46,47), I get switching voltages of 1.8V (looks noisy on scope) and clean 3.3V. I have the jumper on the GPIO board as sold, connecting to 3.3V.
When I toggle between 0 and 3.3V, I get 1.8V and 3.3V.
Anyone have any idea what is going on? I have no external hardware attached.
Using this code C++ Eclipse IDE
int main()
{
// check that we are running on Edison
mraa_platform_t platform = mraa_get_platform_type();
if((platform != MRAA_INTEL_GALILEO_GEN1) &&
(platform != MRAA_INTEL_GALILEO_GEN2) &&
(platform != MRAA_INTEL_EDISON_FAB_C)) {
std::cerr << "Unsupported platform, exiting" << std::endl;
return MRAA_ERROR_INVALID_PLATFORM;
}
// create a gpio object from MRAA LIBRARY
/* GPIO 44 = MRAA 31
GPIO 45 = MRAA 45
GPIO 46 = MRAA 32
GPIO 47 = MRAA 46
*/
mraa::Gpio* Buzz1 = new mraa::Gpio(31);
mraa::Gpio* Buzz2 = new mraa::Gpio(45);
mraa::Gpio* Buzz3 = new mraa::Gpio(32);
mraa::Gpio* Buzz4 = new mraa::Gpio(46);
// set the pin as output
if(Buzz1->dir (mraa::DIR_OUT) != MRAA_SUCCESS) {
std::cerr << "Can't set digital pin as output, exiting" << std::endl;
return MRAA_ERROR_UNSPECIFIED;
}
if(Buzz2->dir (mraa::DIR_OUT) != MRAA_SUCCESS) {
std::cerr << "Can't set digital pin as output, exiting" << std::endl;
return MRAA_ERROR_UNSPECIFIED;
}
if(Buzz3->dir (mraa::DIR_OUT) != MRAA_SUCCESS) {
std::cerr << "Can't set digital pin as output, exiting" << std::endl;
return MRAA_ERROR_UNSPECIFIED;
}
if(Buzz4->dir (mraa::DIR_OUT) != MRAA_SUCCESS) {
std::cerr << "Can't set digital pin as output, exiting" << std::endl;
return MRAA_ERROR_UNSPECIFIED;
}
// loop forever toggling the digital output every second
for(;;) {
//d_pin->write(0);
//sleep(1);
//std::cout<<"hello World! ";
//Buzz1->write(1);
//Buzz2->write(1);
//Buzz3->write(1);
Buzz4->write(1);
sleep(5);
Buzz4->write(0);
sleep(5);
}
return MRAA_SUCCESS;
}