suit WELCOME TO MY logo WEEK 12

RETURN TO HOMEPAGE

Output Devices

Hello pals?..once again this is an electronics week where we're working with the microcontollers we've been designing and producing...we briefly touched upon the electrical safety,,and many output devices ranging from LEDs, Speakers (gate resistors,low pass filters, class D amplifiers), LED arrays, LCDs, Video, DC motor(H-bridge, torque, power, efficiency,gearhead), the servo, Stepper Motor(unipolar, Electro-permanent and bipolar), the piezo also motor control was covered. This week's assignment specifically required me to add an output device to a microntroler board that i'd already created and program it to do something...I had many ideas from christmas tree melodies to chirping sounds from piezo and speakers..but I also saw a great opportunity to practice processing language which in my view isn't as much demanding as the rest of programming languages..since I had used potentiometers before in ultrasonic sensors I decided to transmit and receive signals via the fabduino of which schematic and specifications were given already.. My prior aim was to enable change of brightness in the background during processing (purple color pixels).Before I continue check out the various design files I used:

Ok this is the download source of the files i used in creating the Fabduino:
Me I chose to work with version 0.3 so if you're intending also here they are:
The original version looks like this:
suit

The BOM is available here:

  • BOM in Excel
  • or you could have a quick look



    After quite a hustle I managed to pull out a board out of 10-15 trials:..
    suit........suit....suit

    Since I was always a big fan of arduino I quickly chose it as the most suitable IDE in my case..which meant additional codings to the original boards.txt files..

    fabduino.name=Fabkit/Fabduino w/ ATmega328 (internal clock)
    fabduino.upload.protocol=stk500v1)
    fabduino.upload.maximum_size=14336)
    fabduino.upload.speed=19200)
    fabduino.bootloader.low_fuses=0xe2)
    fabduino.bootloader.high_fuses=0xdd)
    fabduino.bootloader.extended_fuses=0x00)
    fabduino.bootloader.path=arduino:atmega)
    fabduino.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex)
    fabduino.bootloader.unlock_bits=0x3F)
    fabduino.bootloader.lock_bits=0x0F)
    fabduino.build.mcu=atmega328p)
    fabduino.build.f_cpu=8000000L)
    fabduino.build.core=arduino:arduino)
    fabduino.build.variant=arduino:standard)
    fabduino.upload.tool=arduino:avrdude)
    fabduino.bootloader.tool=arduino:avrdude)

    Afterwhich I burnt my bootloader as instructed in the:..

    Newer Fabkit (an Arduino-compatible board)


    Hence I comfortably proceeded to write my small code in arduini and uploaded into the IDE using MKII programmer and that's because the FabISP makefiles had jammed and I was out of time:.. Arduino Code:

    int potPin= 0;
    void setup()
    {
    Serial.begin(9600);
    }
    void loop()
    {
    int val = map(analogRead(potPin),0,1023,0,233);
    Serial.println(val);
    delay(50);
    }

    The processing code was also pretty simple to decipher:
    Processing Code:
    import processing.serial.*;
    Serial port;
    float brightness = 0;
    void setup()
    {
    size (500,500);
    port= new Serial(this, "/dev/tty.usbserial-FTGFKIW3", 9600);
    port.bufferUntil('\n');
    }
    void draw()
    {
    background(0,0,brightness);
    }
    void serialEvent (Serial port)
    {
    brightness = float(new String(port.readBytesUntil('\n')));
    }