Offline
Newbie
Karma: 2
Posts: 38
|
 |
« on: July 13, 2012, 07:52:48 am » |
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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #1 on: July 13, 2012, 08:17:26 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 2
Posts: 38
|
 |
« Reply #2 on: July 19, 2012, 04:02:13 pm » |
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
Edison Member
Karma: 5
Posts: 2340
Do it !
|
 |
« Reply #3 on: July 19, 2012, 04:26:41 pm » |
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
Newbie
Karma: 2
Posts: 38
|
 |
« Reply #4 on: July 19, 2012, 05:49:14 pm » |
Ø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
Newbie
Karma: 2
Posts: 38
|
 |
« Reply #5 on: July 20, 2012, 05:06:56 pm » |
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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #6 on: July 21, 2012, 01:25:30 am » |
Guys, this is an English language forum, so please provide translations, so others can help, or be helped.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 2
Posts: 38
|
 |
« Reply #7 on: July 21, 2012, 04:21:01 am » |
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
Online
Brattain Member
Karma: 316
Posts: 35590
Seattle, WA USA
|
 |
« Reply #8 on: July 21, 2012, 07:56:22 am » |
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
Newbie
Karma: 2
Posts: 38
|
 |
« Reply #9 on: July 22, 2012, 05:59:36 am » |
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???  Regards LYDFANGER
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 316
Posts: 35590
Seattle, WA USA
|
 |
« Reply #10 on: July 22, 2012, 06:28:31 am » |
so is it possible that you could "challenge" me with some hints, of what to write in the sketch? // Global variables int currState1; int prevState1; int currState2; int prevState2; 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
Newbie
Karma: 2
Posts: 38
|
 |
« Reply #11 on: July 22, 2012, 06:44:51 am » |
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
Online
Brattain Member
Karma: 316
Posts: 35590
Seattle, WA USA
|
 |
« Reply #12 on: July 22, 2012, 07:23:29 am » |
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(): 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
Newbie
Karma: 2
Posts: 38
|
 |
« Reply #13 on: July 22, 2012, 07:49:55 am » |
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
Online
Brattain Member
Karma: 316
Posts: 35590
Seattle, WA USA
|
 |
« Reply #14 on: July 22, 2012, 07:52:36 am » |
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/HardwarePick whichever board you have, and read all the details, even if you don't think you will use them (yet).
|
|
|
|
|
Logged
|
|
|
|
|
|