Requests

All of my applications, electronic projects and games are here.
User avatar
Stigern
Site Admin
Posts: 159
Joined: Sat May 28, 2011 8:18 am
Location: Norway
Contact:

Requests

Postby Stigern » Fri Jun 03, 2011 1:40 pm

Got some ideas for me? Games or Programs?

Please post em here =)

JaytheDervish
Posts: 1
Joined: Mon Jun 27, 2011 9:17 pm
Contact:

Re: Requests

Postby JaytheDervish » Mon Jun 27, 2011 9:27 pm

Hey Stigern, I saw your youtube video for your camera mount. I have already implemented a sweep and a slider bar for my servo with arduino and C#, but I'd love to integrate them as well as have the ability to stop the sweep function (I used the basic sweep example from the site, but implemented it for two servos operating in 3 dimensions).

Can you share some code snippets of your arduino code?

User avatar
Stigern
Site Admin
Posts: 159
Joined: Sat May 28, 2011 8:18 am
Location: Norway
Contact:

Re: Requests

Postby Stigern » Thu Sep 01, 2011 8:07 am

JaytheDervish wrote:Hey Stigern, I saw your youtube video for your camera mount. I have already implemented a sweep and a slider bar for my servo with arduino and C#, but I'd love to integrate them as well as have the ability to stop the sweep function (I used the basic sweep example from the site, but implemented it for two servos operating in 3 dimensions).

Can you share some code snippets of your arduino code?


Hm, sorry for the delay! But I've found the code, I think :P

Code: Select all

// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
Servo myservo2;  // create servo object to control a servo
boolean light = false;
boolean servo1 = false;
boolean servo2 = false;
int idler = 250;


void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  myservo2.attach(10);  // attaches the servo on pin 9 to the servo object
  Serial.begin(9600);
  pinMode(13, OUTPUT);
  pinMode(5, OUTPUT);
}

void loop()
{
  // Lets see, if we can read something from the serial port.
  if (Serial.available() > 0) {
    // Dump all we read to int b
    int b = Serial.read();


    // First check if it's in the range of the servo movement.
    if (b == 191)
    {
      servo1 = true;
      idler = 250;
    }
    if (b > 0 && b < 181 && servo1 == true)
    {
      servo1 = false;
      myservo.write(b);
    }

    // First check if it's in the range of the servo movement.
    if (b == 192)
    {
      servo2 = true;
      idler = 250;
    }
    if (b > 0 && b < 181 && servo2 == true)
    {
      servo2 = false;
      myservo2.write(b);
    }



    // If then if it's a specific command, in this case turn on light.
    if (b == 182 && light == true)
    {
      digitalWrite(13, LOW);
      light = false;
    }
    // Or turn off.
    else if (b == 182 && light == false)
    {
      digitalWrite(13, HIGH);
      light = true;
    }

    // Servo 2 encoding
    if (b > 183)
    {
      Serial.print(b);
    }

    Serial.flush();
  }



  if (idler > 0)
    idler--;

  if (idler == 0)
  {
    digitalWrite(5, LOW);
  }
  if (idler > 0)
  {
    digitalWrite(5, HIGH);
  }

 // Serial.print(idler);

  delay(1);
}

Arduino Geek
Posts: 2
Joined: Sat Sep 03, 2011 11:53 pm
Contact:

Re: Requests

Postby Arduino Geek » Sun Sep 04, 2011 12:02 am

Hey Stigern! I am very interested in the CPU Load monitor using an Arduino with 9 Leds. I was wondering if you could share the C# Code. I am confused in how to get the cpu load in C#. I fell in love with this project because it's just what I need! I want to light different color leds depending on the cpu load of my desktop so I know how much load it has without looking at the task manager :) Thank you very much and keep up the good work!

User avatar
Stigern
Site Admin
Posts: 159
Joined: Sat May 28, 2011 8:18 am
Location: Norway
Contact:

Re: Requests

Postby Stigern » Sun Sep 04, 2011 9:18 am

Arduino Geek wrote:Hey Stigern! I am very interested in the CPU Load monitor using an Arduino with 9 Leds. I was wondering if you could share the C# Code. I am confused in how to get the cpu load in C#. I fell in love with this project because it's just what I need! I want to light different color leds depending on the cpu load of my desktop so I know how much load it has without looking at the task manager :) Thank you very much and keep up the good work!


Sure, I packed both the Arduino code and the C# project in a .rar file for you =)
Thanks for nice words!
Attachments
CpuLoad.rar
Arduino CPU Load LED Meter. C# Source and Arduino Project!
(798.24 KiB) Downloaded 1002 times

Arduino Geek
Posts: 2
Joined: Sat Sep 03, 2011 11:53 pm
Contact:

Re: Requests

Postby Arduino Geek » Sun Sep 04, 2011 10:05 am

Stigern wrote:
Arduino Geek wrote:Hey Stigern! I am very interested in the CPU Load monitor using an Arduino with 9 Leds. I was wondering if you could share the C# Code. I am confused in how to get the cpu load in C#. I fell in love with this project because it's just what I need! I want to light different color leds depending on the cpu load of my desktop so I know how much load it has without looking at the task manager :) Thank you very much and keep up the good work!


Sure, I packed both the Arduino code and the C# project in a .rar file for you =)
Thanks for nice words!


Thank you so so much!!! If you want some project idea here's one that may be useful to you... make a red LED flash and stay ON everytime someone posts a new message on the forums ;) That would be cool!

User avatar
Stigern
Site Admin
Posts: 159
Joined: Sat May 28, 2011 8:18 am
Location: Norway
Contact:

Re: Requests

Postby Stigern » Sun Sep 04, 2011 11:44 am

Arduino Geek wrote:
Stigern wrote:
Arduino Geek wrote:Hey Stigern! I am very interested in the CPU Load monitor using an Arduino with 9 Leds. I was wondering if you could share the C# Code. I am confused in how to get the cpu load in C#. I fell in love with this project because it's just what I need! I want to light different color leds depending on the cpu load of my desktop so I know how much load it has without looking at the task manager :) Thank you very much and keep up the good work!


Sure, I packed both the Arduino code and the C# project in a .rar file for you =)
Thanks for nice words!


Thank you so so much!!! If you want some project idea here's one that may be useful to you... make a red LED flash and stay ON everytime someone posts a new message on the forums ;) That would be cool!


No Problem =)

Thats a great idea! :D It would be possible with a ethernet shield.


Return to “Stigerns Projects”

Who is online

Users browsing this forum: No registered users and 1 guest