Author Topic: electronic project  (Read 18604 times)

0 Members and 1 Guest are viewing this topic.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: electronic project
« Reply #45 on: February 03, 2012, 01:49:35 pm »
yay, i got my breadboard, some leds, condensators, resistor and diodes, they didn't have any transistors Ö so now i con't yet make something useful, just some leds in parallel and serie lol
You can make passive filters with those. Google RC low-pass filter and RC hi-pass filter. Those filters modify audio signals for example.

thanks for that hint, i made both of them, and now i improved it a bit so now i can place it between the output of my mp3 and the input of the amplifier and i can adjust the low and high frequencies now, and it sounds amazing :)

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: electronic project
« Reply #46 on: February 04, 2012, 04:50:36 am »
Sounds like fun! How was getting your feet wet?

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: electronic project
« Reply #47 on: February 04, 2012, 10:29:03 am »
Sounds like fun! How was getting your feet wet?

nice especially when it worked :) well, it seems like fun to me, now i only learn the real stuff..
and my arduino and some new components are being shipped, so now i have to wait :)
« Last Edit: February 04, 2012, 10:29:50 am by Nick »

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: electronic project
« Reply #48 on: March 04, 2012, 10:16:34 am »
I'm back into business! I made some minor electronic things like leds blinking, potmeter controls etc.. well, now i'm quite familiar with it, and i thought it would be nice to step over to the arduino, which i did ! and i'm extremely happy with it..

i made a servo controllable with a joystick, fading leds, and a led with 3 'modes': blinking, on and off. I used a button to switch between the modes.

All these things are basic, i know, but they were perfect to get started with arduino.
Now i'm working on a computer interface in which i can send data to the arduino and collect data it sends to the pc to display in a textbox (maybe a graph later)

i already made the programs for both the arduino and the pc (in vidual basics) and it all works fine.
It can display the string i send from the arduino to my textbox in the form :-) and i'm extremely happy with that xp

But now i discovered something, there are always 2 bytes send after the data transmission arduino->PC. those bytes are 10 13 (in that order), what are they? they're not ASCII chars, and they appear after each sending. So i thought it's just a kind of closing bytes or so. Does someone have experience with that?

edit: i should've waited another 13 mins to post, it would have been exactly one month Ö
« Last Edit: March 04, 2012, 10:18:41 am by Nick »

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: electronic project
« Reply #49 on: March 04, 2012, 10:21:26 am »
Binairy :)
If you like my work: why not give me an internet?








Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: electronic project
« Reply #50 on: March 04, 2012, 10:23:34 am »
so i don't have to worry about them? ok then :) thanks..

oh, and it also makes it possible to switch a led on and off with 2 buttons in the VB program

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: electronic project
« Reply #51 on: March 04, 2012, 10:31:34 am »
so i don't have to worry about them? ok then :) thanks..

oh, and it also makes it possible to switch a led on and off with 2 buttons in the VB program
Well those are headers I guess.
If you like my work: why not give me an internet?








Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: electronic project
« Reply #52 on: March 06, 2012, 12:56:35 am »
It probably is closing bytes. Don't worry about it if it's working.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: electronic project
« Reply #53 on: March 06, 2012, 01:31:21 am »
It all works fine, here's a screenie of the prog:


but now i have another problem.
I can send everything and receive the bytes to paste them back together to 1 thing (since every character is sent apart)
now i was trying to find how i could send for example 101 to the arduino. I can split it up into string with the pc, but how can i make it readable for the arduino that it is 101, and not 49 48 49 ... i tried a lot, but nothing seems to be working xs

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: electronic project
« Reply #54 on: March 06, 2012, 05:37:25 pm »
So, you want to send it as the integer 101, not the string of chars 1,0,1? That shouldn't be too difficult.

Serial.write() writes binary values instead of strings, but you'll need to give it an integer input to get an integer transmission. How are you sending the values?

If you're using the serial monitor, you'll either need to find another sending method, or have the conversion occur on the arduino's side. first you'll need a loop checking that the values in the string recieved are between 48 and 57, to make sure it only has 0-9 inside, then just subtract 48 from every value, and add them together with proper adjustment for size. (ie 9012 would be 9*1000 + 0*100 + 1*10 + 2)

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: electronic project
« Reply #55 on: March 06, 2012, 05:48:07 pm »
well, that was what i thought of it too, but i tried it, and it seems not to be working xs it gives overflow (i suppose), it returns -1, and sometimes -100..

the sending as 1,0,1 could work perfectly, but receiving and rewriting them seems the problem, but i'll figure it out :)

now another problem..i have this code:
Code: [Select]
int recVal;
int pwmVal;
int ledPin = 10;
boolean dataReceived = false;
int dataTimer = 0;

void setup() {
  Serial.begin(19200);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  if (Serial.available() > 0) {
    recVal = Serial.read();
    
    if (recVal == 'S') {
      dataTimer = 0;
      while (dataReceived == false && dataTimer < 100) {
        pwmVal = Serial.read();
        dataTimer++;
        if (pwmVal != -1) {
          Serial.println(pwmVal);
        }
      }
      if (dataTimer >= 100) {
        Serial.println("Nothing received");
      }
    }
    
  }
}

but it seems that the pwmVal = Serial.read() does not return anything. it gives or an ndless loop (that's why i put the dataTimer into it), or it returns -1, which means nothing is received, while i send "S" and another string ("a") directly after each other (in visual basics) like this:

Code: [Select]
Arduino.Write("S")
Arduino.Write("a")
« Last Edit: March 06, 2012, 05:49:00 pm by Nick »

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: electronic project
« Reply #56 on: March 06, 2012, 06:09:47 pm »
It could be that it's just missing the sent bytes. The best way to ensure that's not happening is to have some sort of acknowledged receiving system. Have the sender send until it recieves an acknoledgement, and have the reciever send an acknowledgement if it ever recieves something when it checks.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: electronic project
« Reply #57 on: March 06, 2012, 06:57:59 pm »
wow, that's actually a great idea, i'll try to do that.. but it receives the "S" i'm sure of that, so why not the "a", that's what i think is strange..

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: electronic project
« Reply #58 on: March 06, 2012, 07:00:29 pm »
Chances are that VB  is sending them too fast, so the arduino is still busy processing that it got the first one.
« Last Edit: March 06, 2012, 07:00:36 pm by willrandship »

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: electronic project
« Reply #59 on: March 23, 2012, 05:26:21 pm »
i got it working to receive values and print them in a graph.

Now i'm working on a virtual screen for the arduino.
With virtual i mean my arduino connected cia usb (serial) to my pc and run a program on the pc that interprets the sent data from the arduino and prints what the arduino sent.

It currently supports text, rectangles, filled rectangles, ellipses and filled ellipses. i'm working on the line drawing system, which shouldn't be that hard to make :)