示例#1
0
bool setup(BelaContext *context, void *userData)
{
    // Set the mode of digital pins
    pinMode(context, 0, gEchoDigitalInPin, INPUT); // receiving from ECHO PIN
    pulseIn.init(context, gEchoDigitalInPin, HIGH); //detect HIGH pulses on this pin
    scope.setup(2, 44100);
    if(context->analogInChannels != 8){
        fprintf(stderr, "This project has to be run with 8 analog channels\n");
        return false;
    }
    return true;
}
示例#2
0
文件: render.cpp 项目: acarabott/Bela
bool setup(BelaContext *context, void *userData)
{
	pinMode(context, 0, gDigitalOutPin, OUTPUT);
	pulseIn.init(context, gPulseInPin, 1); //third parameter is direction
	return true;
}