The Arduino Thread

DaktologistDaktologist Global Moderator
edited August 2010 in Life
who else here has played around with the arduino. share your ideas

SAM_0398.jpg

Comments

  • 1357913579 Death Cog Machine
    edited July 2010
    Right here, man. I had a robotic arm I controled from my computer for a little while, though the arm mainly consisted of hotglued pentubes and crochet needles.

    At the moment I have a 3x3 LED cube hooked up to it, and man, people love it. Stoners do nothing but stare at it, and most girls are amazed I made such a thing (:D).

    Next, I think I'm going to make my room automated. Servos to control the up/down of my window blinds, along with open/closed. I also have a dimmer switch for lights I'd like to make computer-controlled.

    Love how easy it is to program for....I'm running the Duemilanove board myself.
  • KatzenklavierKatzenklavier Regular
    edited July 2010
    Personally, i like to just use the IC. A whole duemilanove board is quite wasteful for small projects. The arduino is easy as hell to use standalone, and cheap. That's why i like it. Right now i'm working on something pretty cool, but i won't tell you until it's done. ;)
  • DaktologistDaktologist Global Moderator
    edited July 2010
    i have only just started really getting into the different uses of the arduino and im pretty impressed by it so far
  • KatzenklavierKatzenklavier Regular
    edited July 2010
    Have you played round with the libraries? They make coding so much easier.
  • DaktologistDaktologist Global Moderator
    edited July 2010
    i have tried nearly all the examples and have altered some of the code to do different things but since i have next to no coding experience what so ever i found it difficult at first but im getting the hang of it now fortunately
  • KatzenklavierKatzenklavier Regular
    edited July 2010
    Nice. This is what i'm working on.
    //███████████████████████████ Setup ██████████████████████
    #include "WProgram.h"  
    #include <LiquidCrystal.h>              
    #include "Bargraph.h"
    
    //======================================= Variables ===================================
    
    boolean event = false;
    const int longCount  = 5000;  //ms for long sample
    const int shortCount = 3000;  //ms for short sample
    const int maxCPM     = 10000; //meter overflow limit (CPM)
    unsigned long startTime;
    unsigned long startPeriod;
    unsigned long CPM;
    unsigned long totalPeriods;
    unsigned long totalCPM;
    unsigned long counts;
    unsigned long samplePeriod;
    
    LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
     
    //====================================== Other Setup ===================================
    void setup(){0;
      attachInterrupt(1,GetEvent,FALLING);      // Geiger event on pin 2 triggers interrupt
      samplePeriod = longCount;
      lcd.begin(16,2);                          // set lib for display size (8x2)
      lcd.createChar(0, bar_0);                 // Create mini blocks for bargraph
      lcd.createChar(1, bar_1);
      lcd.createChar(2, bar_2);
      lcd.createChar(3, bar_3);
      lcd.createChar(4, bar_4);
      lcd.createChar(5, bar_5);
      lcd.createChar(6, bar_6);
      lcd.setCursor(0,0);
      lcd.clear();
      delay(100);
      lcd.print("CPM       Bq");                 // Print labels
    }
    
    //&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608; Main Loop &#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;
    void loop()
    {
      if (millis() > startPeriod + samplePeriod) 
      {
        countProcedure(); 
      }
      if (event == true)
      {           
        counts ++;
        event = false;
      }
    }
    
    //&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608; Subprograms &#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;
    
    void countProcedure()
    { 
      CPM = (counts * 60) / (samplePeriod / 1000);               // calc CPM for the period                      
      counts = 0;
      startTime = millis();
      samplePeriod = startPeriod;
    
      if (CPM > 99)                                       
      {
        samplePeriod = shortCount;   
      }  
      else 
      {
        samplePeriod = longCount; 
      } 
      printToDisplay();
    }
    
    //======================================= Print to LCD =======================================
    void printToDisplay()
    {
      lcd.setCursor(4, 0);
      lcd.print("      ");            //Blank
      lcd.setCursor(4, 0);
      lcd.print(CPM);                 //Print Counts/Minute
      lcd.setCursor(13, 0);
      lcd.print("      ");
      lcd.setCursor(13, 0);           //Blank
      lcd.print(CPM/60);              //Print Counts/Sec
      
      lcdBar(CPM);                    //Print Bargraph 
    }
    
    //======================================== Bargraph ===================================================
    void lcdBar(int counts)
    {    
      int cntPerBar = (counts / (maxCPM / 94));    // Maximum Bargraphs ahould be what?
      int fullBlock = (cntPerBar / 6);             // Divide each character into 6 bars 
      int prtlBlock = (cntPerBar % 6 );            // Figure out what's left
      lcd.setCursor(0,1);                   
      
      for (int i=0; i<fullBlock; i++)
      {
        lcd.print(5,BYTE);                         // Print full character blocks
      }
      
      lcd.print(prtlBlock,BYTE);                   // Print remaining blocks with custom char
      for (int i=(fullBlock + 1); i<16; i++)
      {
        lcd.print(" ");                            // Clean up leftover
      }  
    }
    
    //====================================== Interrupt Called Procedure ===================================
    
    void GetEvent()
    {
       event = true;
    }
    
    
  • 1357913579 Death Cog Machine
    edited July 2010
    i have tried nearly all the examples and have altered some of the code to do different things but since i have next to no coding experience what so ever i found it difficult at first but im getting the hang of it now fortunately

    Ah, that's pretty cool. Only reason I haven't messed with LCDs is because I don't have any.

    Do you/anyone know how hard it is to use random LCDs scavenged from electronics? Where did you get yours/how much was it?
  • KatzenklavierKatzenklavier Regular
    edited July 2010
    13579 wrote: »
    Ah, that's pretty cool. Only reason I haven't messed with LCDs is because I don't have any.

    Do you/anyone know how hard it is to use random LCDs scavenged from electronics? Where did you get yours/how much was it?

    Typically they are all have the Hitachi HD44780 controller. It's the de-facto standard. If it has 14 pins (16 if it has a backlight), you can use it.

    You can get LCD's on ebay for about $6 shipped. DO NOT GET THE $1-$3 ONES FROM CHINA! They are all garbage off the production lines. Plus they take weeks to get to you.
  • DaktologistDaktologist Global Moderator
    edited July 2010
    i ordered mine through sparkfun.com they have cheep lcds
  • KatzenklavierKatzenklavier Regular
    edited July 2010
  • fractalsfractals Regular
    edited August 2010
    I want to make a head unit for my car stereo. It'll probably start off as an ipod controller with a LCD to show the song playing and run the audio through an amplifier. Hopefully it'll end up being a full carputer, with a nice big touchscreen built into my dash, and make it control everything in my car. At that point it will be multiple arduinos and avrs and probably a gumstix running linux for the touchscreen.
  • KatzenklavierKatzenklavier Regular
    edited August 2010
    Google yenka pics. It's a flowchart like designer that writes the code for you.
Sign In or Register to comment.