Show Posts
Pages: 1 ... 33 34 [35] 36 37 ... 88
511  Community / Bar Sport / Re: How microprocessors work on: March 25, 2013, 05:06:22 pm
http://en.wikipedia.org/wiki/Rosetta_Project and other stuff  The Long Now group does.
512  International / Scandinavia / Re: Hur ska jag avgöra vilken av två sensorer som triggas först? on: March 25, 2013, 05:04:08 pm
Jeg synes(tycker) det er for svært at forklare programmering via forum. En hjælpende hånd, henvisning til en algoritme, osv det er OK. Jeg fornemmer en stigende panik ...

Den der "IngenLED" er som en lås. Hvis IngenLED er True, dvs vi har endnu ikke rykt/koblet en kontakt, så tester vi som før, i dit første program. Hvis den er false, dvs vi HAR valgt en LED så hopper vi over test af kontakter og derved ignorerer hvad der sker med dem.

Til dit første program så tilføjer du testen "if (IngenLED ) {  alt det der med at test kontakt og tænda LED }
Bemærk dom ekstra {} som alt bliver udført eller intet bliver udført afhængig af IngenLED.

I din kode hvor du tænder en LED skal du også bruge "IngenLED = false ;" - nu har du jo en tændt en LED.

Så skulle det virke....

En helt anden teknik er at lige efter du har tændt din LED så bruger du "while(1) ;" - det er det samme som at programmet stopper der og ALDRIG kommer videre (indtil RESET knappen tryks).
513  International / Scandinavia / Re: Hur ska jag avgöra vilken av två sensorer som triggas först? on: March 24, 2013, 02:46:22 pm
Tips #2 (siden den første ikke var tydlig nok smiley )
Code:
boolean IngenLED = true ;
  :
if ( IngenLED )  // har endnu ikke valgt LED
  {
  kod der tester. Hvis en er trykt, tænd den LED og
    IngenLED = false ;
  }
514  Using Arduino / Project Guidance / Re: Car Park with Arduino Uno on: March 24, 2013, 11:35:31 am
Well, I took the trouble to download your code, then put in my IDE andhit the compile button to get your error messages. Life would be easier if you did those things --> http://arduino.cc/forum/index.php/topic,148850.0.html see the end of section 7.

Your problem is
Code:
const int One = 3 , 4;
and lines like that.
How can one constant (or variable for that matter) hold several values? It can not. From your program I can not guess what you meant by that.
Code:
if(COUNTER<1Car)
is flagged as invalid suffix "Car" on integer constant
Your problem is that you can not combine a number "1" with "Car" like that. I can not guess if you meant 1+Car or a variable named "one_car".

First make some little program that turns LED 1 on if you hit the "add car" and off when you hit the "subtract car". I think that will help you understand some basic syntax of C. After that we can look into the flow of your program logic.
515  Community / Exhibition / Gallery / Re: Just Another 3x3x3 Led Cube on: March 24, 2013, 11:18:59 am
Thumbs up. Yes, I have seen several 3-cube, 5-cube and one nice 11-cube done by friends. And each is an accomplishment by its creator.  It should not stop us "mere mortals" from doing something simpler for our enjoyment! (I am thinking of doing a 1x1x1 LED cube  smiley-cool)

Care to mention (not the whole code/diagram) what technique you used to control the LEDs - straight from each pin or some driver chip? On/Off or level control? Store the patterns on chip or calculate on the fly or feed from the USB (or other source)? You mention "Menu" - is there a LCD interface or ...?
516  International / Scandinavia / Re: Hur ska jag avgöra vilken av två sensorer som triggas först? on: March 24, 2013, 11:07:23 am
Du vil have en tilstands skift i stil med
A åben : B åben -> ingen LED
Og så ENTEN
A lukket : B åben -> LED A lyser
og fra det tidspunkt A lyser uanset hvad du gør med B
ELLER
A Åben : B lukket -> LED B lyser
og fra det tidspunkt lyser B uanset hvad du gør med A
--
Som du ser har jeg nu mere nøjagtigt beskrevet hvad der skal ske. Du kan endnu mere nøjagtigt beskrive det ... og når det er meget meget nøjagtigt og detaljret, så er programmet skrevet. Så skal et bare skrives i C-syntax.
Tricket du har her, at du nok skal have en variabel der siger LED-A-lys-tilstand (true/false) og når den er true så checker du kun på om "nollställ" - du skal ikke kigge på knapperne mere.
"Nolställer" - du har ikke sagt hvad det er: Begge åben igen, eller RESET, eller en 3. knap?
517  International / Scandinavia / Re: Arduino Design on: March 24, 2013, 11:00:37 am
Låt oss ta ett exempel: Jag är en användare som behöver ett kort som har minst 2 reläer och en RTC klocka. SRAM och Flash minne är inte så viktiga eftersom mitt program är väldigt liten, så en atmega328p hade varit bra som utgångspunkt. Dvs ett kort som ser ut som en UNO plus 2 reläer och en RTC klocka..
OK, men hvorfor skulle der så være en masse gøgl (lull-lull?) af ekstra peripheri interfaces?

Det er et lidt selvmodsigende kravspecifikation : 1: Det skal bare bruges til "lidt"; (2) det skal have alle mulige kombinationer.

OK, nok negativitet, nu vil jeg være lidt positiv også smiley Det ting jeg hyppigst bruger til mine projekter er Steppere (men stepperdriver chip skulle nok altid være ekstern), flere enkle IO pins (LED/segmenter og switches) og måske et par PWM(forstærket) output og analog input. USB er ofte ikke attachet (efter debug osv er færdig) og strøm forsyningen er typisk allerede reguleret. Set i total prisen af et board med alt er det prismæssigt ikke den store forskel mellem 328 og de andre. Jeg er endnu ikke løbet tør med en 328 undtagen i digitale IO'er, men har kan en god "expanderport" med shiftregister klare det meste. Nåh jo og LED driverPWM (go gamle TLC5940). Formfactor skal vare så lille som muligt, dvs mindre en  Uno der er halveret i bredden og lidt kortere.

518  Community / Exhibition / Gallery / Re: Demultiplexer/3 to 8 decoder on: March 23, 2013, 06:11:17 am
Thank you for sharing.

I think it is important that projekts off *ALL* sizes are shown. Yours may seem trivial to some, but it is clear you have overcome your set of challenges, and have indeed a right to be proud. Besides, one never knows what even a "simple" projekt might inspire other to do. Good webpage to round it off, too.

Carry on ....
519  International / Scandinavia / Re: Arduino Design on: March 23, 2013, 06:00:51 am
Alt det som perhof skrev : +1
520  Community / Bar Sport / Re: How microprocessors work on: March 20, 2013, 04:59:45 pm
Is it normal to find this talk very very fascinating?  smiley-wink

This is Archaeology-on-technology (sure there is a nicer or proper word for it somewhere). BECAUSE the original is lost, and it was a "milestone" or de-facto standard much revolved about.

The fascinating thing IMHO is that the emulator simulates the physical wiring - assuming perfect transistors. Fine, as only the logic function is being done, not racetimes or other failures.

OK, enough posting - I need to look at the webpages now.
521  Using Arduino / Project Guidance / Re: Pinball Project on: March 17, 2013, 04:27:44 pm
Thats what the "Exhibition / Gallery" forum group is for smiley
522  Using Arduino / Microcontrollers / Re: "virgin Atmega328PU" to "chip in ArduinoUNO REV3" with only Arduino? on: March 13, 2013, 11:53:13 am
Are you selling those?
Nope. But that is what I bought, at my local RS webstore. Already replaced one. Careless with a 24V wire that briefly touched the chip...
523  Using Arduino / Programming Questions / Re: Button to start an array on: March 13, 2013, 11:50:21 am
The "start array" and "stop array" make no sense. Remove the lines, When you push the button the LEDs will light up and down, once.
Code:
    // start array:   
    digitalWrite(ledPins[thisPin], HIGH);
...
else {
    // stop array:
    digitalWrite(ledPin, LOW);
  }
If you want the running lights to run until the button is pushed again the code needs quite some rearranging.

Pardon the question - but what does the professor know or teach you as it clearly isnt programming?
524  Using Arduino / Microcontrollers / Re: "virgin Atmega328PU" to "chip in ArduinoUNO REV3" with only Arduino? on: March 13, 2013, 11:40:02 am
You can buy a spare chip with the "standard" Arduino boot loader on it.
525  Using Arduino / Programming Questions / Re: Converting sensor text output to a number on: March 10, 2013, 04:10:58 pm
Easy enough smiley-wink No need to buffer anything (or worse; buffering into String ) Assuming you know how to handle the serial port, in your loop do:
() If initialise flag is true, zero  your 3 number variables Y, P and R. Note that we need to do "Y". Rest all countrs /flags.
() Read the next byte until you get past the #YPR (basically anything that is a letter or '=' is discarded)
() When you get a valid digit, put it into the appropiate Y P or R variable, first multiplying previous content by 10. Basically this converts ASCII to int, one char at a time, as they arrive. .
() If you see a decimal point start counting in a seperate variable. Everytime you add a digit in above step, count one if we started counting. If you see a "-" just note this in another boolean variable
() When you see a "," or "\n" the number is done. Move on the next in the Y P R pointer. When done all 3, you're done!

Draw backs - the code will not fail if the number is badly formatted (like two decimal poins) but return some (unpredictable) result. I have used above algorithm in my "nnnC" function published as a post (Search for "nnnC"), yours just needs to do 3 numbers.

Pages: 1 ... 33 34 [35] 36 37 ... 88