Avatar for ConnorHaynes

ConnorHaynes

Member since Feb 2015 • Last active Apr 2015
  • 2 conversations
  • 5 comments

Most recent activity

  • in General
    Avatar for ConnorHaynes

    For some reason i cannot upload the image, heres a written schematic.. for @alexanderbrevig

    Espruino Pins:

    Pin C0 -> Pot1 (potentiometer 1)
    Pin C1 -> Pot2 (potentiometer 2)

    Pin B6 -> tx:/I+ (Midi to USB converter)
    Pin B7 -> rx:/O+ (Midi to USB converter)

    Pin B8 -> Switch1
    Pin B9 -> Switch2

    Thanks alot for you help @Gordon for that from the other forum, il have a go at this later to see if i can get it working when i have a chance to properly read through it.

    Does anyone know how i can get the switches working?

  • in General
    Avatar for ConnorHaynes

    Hi there,

    Thanks for your help guys, il post my diagram here now!

  • in General
    Avatar for ConnorHaynes

    Hi there,

    Im looking for some help with coding for a project im working on if some kind soul could help me with it, as i am new to coding and dont really know how to make it work. Its prob very easy to do for someone who knows what they are doing,

    Basically im trying to create a MIDI controller, although im having some difficulty coding the values to MIDI and sending it down the USB to MIDI converter. I have 2 pots and 2 switches to code. A kind friend give me the code for one of the pots although i cant seem to get it to work with the Espruino. The code is:

    function onInit() {
    
    Serial1.setup(31250, {tx:B6,rx:B7});
    
    Serial1.write(0x90);
    Serial1.write(0x3D);
    Serial1.write(0x00);
    Serial1.write(0x90);
    Serial1.write(0x3D);
    Serial1.write(0x44);
    }
    
    var Pot1=0;
    
    function getAcc() {
    
    var Pot1 = analogRead(C0);
    
    Pot1 = round(Pot1*128);
    
    Serial1.write(0x0B);
    Serial1.write(pot1);
    Serial1.write(0x9F);
    }
    
    onInit();
    setInterval(readPot1, 200);
    

    This code doesn't work for me for some reason- it keeps saying undefined. & I dont want to keep hassling my friend as he has helped me out loads to get to this point! Does someone know where i have gone wrong interpreting this code?

    The potentiometers are Linear btw.

    I have included a diagram of my wiring with my circuitry also to the Espruino.

    I know this will be useful
    http://www.midi.org/techspecs/midimessag­es.php

    If anyone could help me out with the switches or getting the pots working (Or both!) i would be soo greatful! How would i get this to work does anyone know? All i have to do is get the right code from the Voltage value to be turned to MIDI and then send down the MIDI to USB converter to the computer.

    [](http://IMG_1102.JPG)

    Thank you!

    Kind regards
    Connor

  • in General
    Avatar for ConnorHaynes

    Hi there,

    Im very new to using Espruino so please bare with me.. Im currently working on a project the requires me to use more than 1 Espruino at one time. Im plugging them into a USB hub then into the computer running Mac OSX. Is there something in the code to change, like an IP address in the code of something? Where would it be in the coding. Im new to coding also!

    Cheers in advance
    Connor

Actions