Reading and writing from ADC for audio output

Ok Jay yeah I had it working fine until adding the digital outputs, the LEDs and buttons classes responded fine and the messages were all correctly output to the compiler screen. however once I added the digital outputs the invalid socket exception seemed to be getting thrown because the pins go high or low but stay that way based on how I declare the sockets. for instance if i set them to be false for the invalid socket number exception to throw they will all go low and stay that way. but setting the exception to true they go high.

I’ll look at your code as soon as you put it in code tags, and only post the minimal code required to cause the problem. To put your code in code tags, tags, select all of your code and hit the gray 101010 button at the top of the window.

Ok Thanks Jay I have now put the code in code format and posted what the minimum code is I have not yet added the code to run the motor. I could use your help with that because i don’t know if its better to use digital or analog outputs. however the commands telling the motor to turn clockwise or counterclockwise(function or class call commands) would probably be placed in the volume up and volume down button pressed classes.

Thanks Again.

I’m not sure what’s causing your exception to happen – especially since you’ve indicated that everything is fine with the buttons wired up (those are the only things that are creating InterruptPorts, I believe?). Someone who is more experienced with Gadgeteer should step in and have a look at your code.

As for the motor, typical DC brushed motors are controlled with two pins – a direction pin and an enable pin. The enable pin is typically PWMd to provide speed control. I’ve never used the Motor Driver module, but I assume it’s similar to that.

Sounds like an interesting project, the juxtaposition of “primative” and modern technology!

Ryan, if you just have the digital outputs, will it throw an exception? If so, then do that – take everything out.

You should start a new topic in the Gadgeteer section of the forum either way – you’ve already marked this topic as “solved” so most people will glance over it (and the topic name no longer reflects the problem)

Again, I can’t reiterate this enough: take out every single unnecessary line of code. I still see Debug.Print messages and unnecessary variables in your code. Seriously – no one will even look at your code unless it’s been reduced as far as it can be.

With more mature projects, what you’re posting would be fine – but Gadgeteer is still very experimental; people find bugs in it all the time. So we need to figure out if the bug is in your code, or in Gadgeteer itself.

Sorry if this is frustrating – you get what you pay for. Welcome to free technical support. :slight_smile: