My First Arduino Circuit

After the workshop, I plugged in my Indiuno with the LCD and within half an hour had the LCD working.

Source: http://arduino.cc/en/Tutorial/LiquidCrystal

Photos:

Next up was using the 7-segment display and the shift register. After a lot of googling and experimenting – finally managed to set it up so that it counts from 0 to 9. I used the on-board switch on pin # 7. Had to use a lot of binary to decimal conversions to get the numbers correct – but finally got it down pat 🙂

Attached circuit diagram and sketch if anyone’s interested.

7-segment_bb

//Pin connected to ST_CP of 74HC595
int latchPin = 4;
//Pin connected to SH_CP of 74HC595
int clockPin = 3;
////Pin connected to DS of 74HC595
int dataPin = 2;
int buttonPin = 7;
int numberToDisplay = 0;
int segNumbers[10] = {126,48,109,121,51,91,95,112,127,123};

void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(buttonPin,INPUT_PULLUP);
}

void loop() {
      // take the latchPin low so 
      // the LEDs don't change while you're sending in bits:
      digitalWrite(latchPin, LOW);
      // shift out the bits:
      shiftOut(dataPin, clockPin, LSBFIRST, segNumbers[numberToDisplay]);  
      //take the latch pin high so the LEDs will light up:
      digitalWrite(latchPin, HIGH);
      if (digitalRead(buttonPin) == LOW){
        numberToDisplay++;
        if (numberToDisplay > 9) {numberToDisplay = 0;}
      }
      while(digitalRead(buttonPin)==0);
      delay(100);
}

My start in the electronics world

Have always been fascinated with electronics and computers – but never knew how to go about it.

Finally got a chance to experiment – when Abhiram decided to hold a small electronics workshop. Well – got up early (comparatively) on a Saturday and went to see what could happen.

Workshop

 

The workshop was great – Abhiram started right from the basics of analog circuits and went on to explain how digital circuits are created using microcontrollers. In addition to all this – he arranged for starter kits for us – which included an Induino and lots of LEDs, resistors, sensors, et al to get us started. (Though he did warn us that this was an expensive hobby :-))

Anyways – long story short – I had a lot of fun and am now hooked to microcontroller programming.