Pages: [1] 2   Go Down
Author Topic: starting the Windows media player from the UNO?  (Read 3030 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 2
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it possible to run the Windows Media Player from the UNO-board, and shut the player down again?

If yes......

How is it done...?

Regards
Brian Hansen
Denmark
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Gobetwino? http://mikmo.dk/gobetwino.html
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

  Bigger  Smaller  Reset Quote Modify Remove 

--------------------------------------------------------------------------------

I thank you very much for the link.

I had some big trouble to make it work with windows 7. But after changing to XP it is working fine.

By the way, are you danish? (god to now for later comunication)

Brian

 
 
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you tell me what problems you had with GoBetwino and windows 7.

I'm woking on an update.

And yes i am danish :-)

MikMo  / Mikael
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Øh..så skifter jeg lige til DK.

Det er mig der har lavet en bommert mht. windows7. ....noget med at vælge de rigtige ikoner at trykke på, måske gik det hele lidt for skærkt da jeg skulle installere på W7. Programmet kører lige nu også på min Windows7, indtil videre uden problemer.
Hvis jeg støder på nogle "bugs" lover jeg at sende dem til dig.

Vh
Brian



Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hej Mikael

Jeg udnytter at jeg har "fanget" dig, til lige at spørge om en sidste ting. Håber du vil hjælpe mig...igen.

Når jeg sender Serial.println til dit program, får gobetwino koden mange gange, så efter "timeout" gentager programmet visningen af den bestemte fil. Jeg kan se det samme i "Serial overvågningen" så det er helt sikkert mine evner indenfor kode skrivning der halter.
Vil du kigge på Sketch'en, og  give et bud på hvor jeg kan sætte en bremse, så Serial.println... kun bliver sendt en gang?.
På forhånd tak.

int kon1 = 7;//kontakt1
int kon2 = 8;//kontakt2
int val1 = 0;
int val2 = 0;


void setup()
{
pinMode(kon1, INPUT);
pinMode(kon2, INPUT);
Serial.begin(9600);

}

void loop()

{
 val1 = digitalRead(kon1);
 val2 = digitalRead(kon2);
 
  val1 =!val1;
  val2 =!val2;
 if (val1 == HIGH)
 {
   Serial.println("#S|MUSIK1|[]#");
   delay(val1);
 }
 if (val2 == HIGH)
 {
   Serial.println("#S|BILLED1|[]#");
   delay(val2);

 }}
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys, this is an English language forum, so please provide translations, so others can help, or be helped.
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, you are right. So here is translation of the pre posting.

When i am sending Serial.println(XXXXXX) to my PC the "Code" is send many times, I just want the arduino to send it once.
I need something in the sketch to control the how many times Serial.println is send.
The sketch looks like this....

int kon1 = 7;//button1
int kon2 = 8;//button2
int val1 = 0;
int val2 = 0;

void setup()
{
pinMode(kon1, INPUT);
pinMode(kon2, INPUT);
Serial.begin(9600);
}
void loop()
{
 val1 = digitalRead(kon1);
 val2 = digitalRead(kon2);
 
  val1 =!val1;
  val2 =!val2;
 if (val1 == HIGH)
 {
   Serial.println("#S|MUSIK1|[]#");
   delay(val1);
 }
 if (val2 == HIGH)
 {
   Serial.println("#S|BILLED1|[]#");
   delay(val2);
}

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 49998
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
When i am sending Serial.println(XXXXXX) to my PC the "Code" is send many times, I just want the arduino to send it once.

Then, you need to send only when a transition occurs, not whenever the state is HIGH or LOW.

Detecting a transition is simply a matter of comparing the current state of the switch with the previous state, If they are not the same, a transition occurred. At the end of loop(). set the previous state to the current state, ready for next time.
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi PaulS

That make sense....thank you so far...

But, i am total NewBie...so is it possible that you could "challenge" me with some hints, of what to write in the sketch???  smiley-lol

Regards
LYDFANGER
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 49998
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
so is it possible that you could "challenge" me with some hints, of what to write in the sketch?

Code:
// Global variables
int currState1;
int prevState1;
int currState2;
int prevState2;

Code:
void loop()
{
   currState1 = digitalRead(kon1);
   if(currState1 != prevState1)
   {
      // A transition occurred - from pressed to released or from released to pressed
      if(currState1 == HIGH)
      {
         // The transition was to whatever state HIGH represents
         // Could be pressed or released, depending on how the
         // switch is wired

         // Do whatever needs to be done once when the switch is HIGH
      }
   }
   prevState1 = currState1;
}

I'm guessing that you can figure out what needs to be done for the other pin, and what needs to be merged where in that code, based on the comments.

You do have external resistors wired with your switches, don't you? Not that I understand why you don't keep it simpler and use the internal pullup resistors.
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi again

Thank you very much.

I do understand, and i am able to merge the right way.

You are right, i am using pullup with resistor on the breadboard.

as you know i am a newbie, so when you say internal resistor, I think: Is that a "speciel pin" or how is that working?

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 49998
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All the digital pins on the Arduino have internal pullup resistors. These can be activated by calling digitalWrite() with the second argument being HIGH (the first is the pin number) after the pin is set to INPUT (using pinMode()).

If you really are using an external pullup resistor, the pin would read LOW when the switch was pressed, and HIGH when not pressed (for a normally open switch).

Using the internal pullup resistor is easy. In setup():
Code:
pinMode(kon1, INPUT); // Make pin INPUT
digitalWrite(kon1, HIGH); // Turn on pullup resistor

Then, connect one leg of the switch to pin 7 and the other leg to ground. No external resistor needed.

In loop(), read the switch in the normal way. LOW == pressed, and HIGH == released.
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi again,again

What you are writing explains why I had to use "val = !val" to make HIGH == 1 and LOW ==0.

Where can I find info about "Hardware features" like the internal resistor, i guess it is not the only hardware feature on the board?

Now I will use some time "to play" with the "new information" you just have given me.


Once more:

Thank very,very much.
 Regards
LYDFANGER


Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 49998
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Where can I find info about "Hardware features" like the internal resistor, i guess it is not the only hardware feature on the board?
Start here: http://arduino.cc/en/Main/Hardware
Pick whichever board you have, and read all the details, even if you don't think you will use them (yet).
Logged

Pages: [1] 2   Go Up
Jump to: