vineri, 19 iulie 2013

my graduation project





No! I have not disappeared! I worked on the graduation project. Watch the video!

Thanks to all my teachers!

I'll come back soon with new examples

luni, 25 februarie 2013

Arduino i2c - Testing an Automatic Control System





2 Arduino connected through i2c
Slave Arduino reads data from phototransistor and send them to Arduino Master
This change PWM command so that the engine has run 4 rotations per second as set.

duminică, 6 ianuarie 2013

C# communicate with Arduino Part.3




I made a C # application to control two servos via USB with Arduino.




When you pull the slider bar, the value is sent to the Arduino, which represent the positions of the servo.
Each servo has his own bar.






 
C# code :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
using System.Threading;

namespace SERIAL_ANALOG_WRITE
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void bara1_ValueChanged(object sender, EventArgs e)
        {
            val_bara1.Text = Convert.ToString(bara1.Value);
            transmite1();
        }





        

[... do you want the rest of the code???? ...]



        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (serialPort1.IsOpen) serialPort1.Close();
        }
    }
}


Arduino code :


#include <Servo.h> 
int v, v1, v2, v3, v4;
Servo servo1;
Servo servo2;

void setup()
{
   servo1.attach(9);
   servo2.attach(10);
   Serial.begin(9600);
}

void loop()
{
  if (Serial.available()>0)
  {

[... bla-bla-bla...]

  }
  
  delay(10);
}


C# communicate with Arduino Part.2





I tried to command a servo, via usb, from C # application to an Arduino.



When you pull the slider bar, the value is sent to the Arduino, which represent the positions of the servo.




C# code:

using System.Text;
using System.Windows.Forms;
using System.IO.Ports;

namespace SERIAL_ANALOG_WRITE
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void bara_ValueChanged(object sender, EventArgs e)
        {
           

[ do you want the rest of the code???? ]


        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (serialPort1.IsOpen) serialPort1.Close();
        }
    }
}