Showing posts with label description. Show all posts
Showing posts with label description. Show all posts

Tuesday, March 11, 2014

Arduino 4x20 LCD and 2 inputs comparator

Staring a new build. So as to that I had an idea, that it can be helpful for everyone starting with code writing to try and manipulate this snippet. It's a simple code to operate a LCD and 2 inputs on A0 and A1. It compares the two with if and else. After the comparator it makes a readable output on the LCD. From here it's very simple to put the comparison into outputs of your own choosing.




//4x20 LCD, 2 sensors in A0 and A1 compare them and output to the LCD
// include the library code:
#include <LiquidCrystal.h>

// initialize the library liquidcrystal.h with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int sensorPin1 = A0; // defines input pin
int sensorValue1 = 0; // make a varianle sensorValue
int sensorPin2 = A1;
int sensorValue2 = 0;

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(20, 4);

}

void loop() {

  sensorValue1 = analogRead(sensorPin1); // get the value of sensor 1
  sensorValue2 = analogRead(sensorPin2); // get valur for sensor 2

    lcd.setCursor(0, 0); // Set cursor to top left
  lcd.print(sensorValue1);

  lcd.setCursor(0, 1);
  lcd.print(sensorValue2);

  if (sensorValue1 < sensorValue2){
    lcd.setCursor(0, 2);
    lcd.print("1 is higher than 2");
  }
  else{
    lcd.setCursor(0, 3);
    lcd.print("2 is higher than 1");
  }

  delay(200);
  lcd.clear();


}

Sunday, February 2, 2014

Max7219 and a LED matrix with Arduino, blinking LED-s the hard way

DIY led matrix
DIY 7805 PSU
 First trial to make the 7219 work with Arduino. I had ordered the MAX7219-s a good few months ago, but still hadn't made anything with them. So this is mi stab at making them work. In mi junk bin i had a bunch of perf board and white led-s so just a matter of soldering together I thought. Well soldering is the easy part but to mi surprise it took a good hour or so to solder the 7805 coupled with 7219 and the led matrix together.

So mi first attempt. To replicate or try it for yourself you need.

  • Soldering iron
  • 30 LED-s
  • MAX7219 IC
  • 7805 Voltage regulator
  • 10 uF and 100 uF capacitors
  • jumper wires

Max7219 connected with DIY 5x6 Led matrix



Wednesday, January 22, 2014

Wireless 433mHz with Arduino, hitting the radiowaves

433mHz sender unit(left) and receiver unit (right)
I picked a pair of these up for 0.99$ each, so who can resist the tempation.

Monday, January 20, 2014

What is Arduino

Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board (as said by the developers of Arduino).


Cheapest arduino choices 

In all things combined it's the next best thing since the computers were invented. Anything you can imagine you can develop with it, and if you want to go to masses you can always strip it and use the Atmega microcontroller. 

Okay there are a few defects, mainly no integrated graphics department. But there are workarounds for that, although not as powerful that there should be but still it's a possibility.

In mi opinion why it's the next best thing is because it's popularity has skyrocketed. Because of that there are endless add-ons for it. That's why I said you can do everything with it, and so much has already been done by the community. Also the community who can argue with that. If you could ever get in some kind of trouble, there is always someone who can help you.