Loading...
Welcome,
Guest
. Please
login
or
register
.
May 22, 2013, 08:23:41 am
|
Arduino Forum
::
International
::
Italiano
(Moderators:
Federico Vanzati
,
leo72
,
UweFederer
) :: Millis
« previous topic
next topic »
Pages:
1
[
2
]
Go Down
Print
Author
Topic: Millis (Read 549 times)
0 Members and 1 Guest are viewing this topic.
lesto
0
Online
Tesla Member
Karma: 82
Posts: 8217
:(){:|:&};:
Re: Millis
«
Reply #15 on:
April 29, 2011, 11:42:07 am »
Bigger
Smaller
Reset
Quote from: Federico Vanzati on April 29, 2011, 10:38:50 am
il led rimane sempre acceso perchè aggiorni millis() ad ogni ciclo entrando nel primo if, il problema non è tanto che st non diventa 1.
quoto, non mi ero accorto del particolare
Logged
my Arduino code:
https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui:
http://playground.arduino.cc/Italiano/Newbie
ARDUIX
0
Offline
Jr. Member
Karma: 0
Posts: 95
Arduino rocks
Re: Millis
«
Reply #16 on:
April 30, 2011, 06:45:11 am »
Bigger
Smaller
Reset
Ciao! Ho messo la booleana, ho messo il millis nel setup ma il led rimane acceso!! Nn so veramente cm fare...
Code:
#define LED 9
int stato;
boolean st=false;
int acceso=5000;
unsigned long tempo;
void setup() {
pinMode(LED,OUTPUT);
tempo=millis();
Serial.begin(9600);
}
void loop(){
//st=digitalRead(LED);
if(st==false)
{
digitalWrite(LED,HIGH);
st=true;
}
if((millis()-tempo>=acceso)&&(st==true))
{
digitalWrite(LED,LOW);
st=false;
}
}
Logged
lesto
0
Online
Tesla Member
Karma: 82
Posts: 8217
:(){:|:&};:
Re: Millis
«
Reply #17 on:
April 30, 2011, 07:12:28 am »
Bigger
Smaller
Reset
non aggiorni tempo all'interno degli if, però strano, il led dovrebbe accendersi una volta e poi rimanere spento
ps. ma ce l'hai messa la resistenza in serie al led?
Logged
my Arduino code:
https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui:
http://playground.arduino.cc/Italiano/Newbie
ARDUIX
0
Offline
Jr. Member
Karma: 0
Posts: 95
Arduino rocks
Re: Millis
«
Reply #18 on:
April 30, 2011, 07:27:31 am »
Bigger
Smaller
Reset
No, ma perchè dovrei metterla? (scusa l'ignoranza).. cmq ho risolto mettendo millis nel setup con il led di partenza acceso e lo faccio spengere dopo 5 secondi.
Logged
lesto
0
Online
Tesla Member
Karma: 82
Posts: 8217
:(){:|:&};:
Re: Millis
«
Reply #19 on:
April 30, 2011, 08:08:16 am »
Bigger
Smaller
Reset
ah se non vuoi fare che lampegga allora ok
Logged
my Arduino code:
https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui:
http://playground.arduino.cc/Italiano/Newbie
leo72
Forum Moderator
Italy
Offline
Brattain Member
Karma: 219
Posts: 16462
Don't know what I do
Re: Millis
«
Reply #20 on:
April 30, 2011, 09:33:53 am »
Bigger
Smaller
Reset
Quote from: ARDUIX on April 30, 2011, 07:27:31 am
No, ma perchè dovrei metterla?
Per non ridurgli la sua vita utile.. se non bruciarlo.
Logged
Guide for ATtinys, swRTC and secTimer libs, Micrologio, Atmega1284 core, ArduinoISP2, leOS operating system etc..
Pages:
1
[
2
]
Go Up
Print
« previous topic
next topic »
|
Arduino Forum
::
International
::
Italiano
(Moderators:
Federico Vanzati
,
leo72
,
UweFederer
) :: Millis
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> General Discussion
-----------------------------
Using Arduino
-----------------------------
=> Installation & Troubleshooting
=> Project Guidance
=> Programming Questions
=> General Electronics
=> LEDs and Multiplexing
=> Displays
=> Audio
=> Motors, Mechanics, and Power
=> Sensors
=> Networking, Protocols, and Devices
=> Interfacing w/ Software on the Computer
-----------------------------
Topics
-----------------------------
=> E-Textiles and Craft
=> Robotics
=> Science and Measurement
=> Home Automation and Networked Objects
=> Device Hacking
=> Education and Teaching
=> Interactive Art
=> Product Design
-----------------------------
Development
-----------------------------
=> Suggestions for the Arduino Project
=> Other Hardware Development
=> Other Software Development
-----------------------------
Community
-----------------------------
=> Website and Forum
=> Products and Services
=> Gigs and Collaborations
=> Workshops and Events
=> Local Groups
=> Exhibition / Gallery
=> Bar Sport
-----------------------------
International
-----------------------------
=> Deutsch
=> Español
=> Français
=> Italiano
=> Portugues
=> Scandinavia
-----------------------------
Forum 2005-2010 (read only)
-----------------------------
===> Uno Punto Zero
===> Bar Sport
===> Frequently-Asked Questions
===> News
===> Exhibition
===> Workshops
===> Interfacing
===> Bugs & Suggestions
===> Development
===> Troubleshooting
===> Portugues
===> Deutsch
===> Español
===> Français
===> Italiano
===> Scandinavia
===> Development
===> Interfacing
===> Syntax & Programs
===> Bugs & Suggestions
===> Troubleshooting
===> Report Spam at Arduino.cc
===> Forum
===> Playground Wiki
=> General
=> Hardware
=> Software
=> International
=> Web/Forum/Email/Spam
-----------------------------
Using Arduino
-----------------------------
=> Storage
=> Microcontrollers
-----------------------------
International
-----------------------------
===> Humor y Debate
===> Talleres, Encuentros, ...
===> Tutoriels et cours
===> Réalisations et Projets Finis
===> Le bar
=> Nederlands
===> Software
===> Hardware
===> Proyectos
===> Documentación
=> India
===> Hardware
===> Software
===> Megatopic
-----------------------------
Products
-----------------------------
=> The Arduino Starter Kit
=> Arduino Due
-----------------------------
International
-----------------------------
===> Generale
-----------------------------
Products
-----------------------------
=> Arduino Esplora
=> Arduino GSM Shield
-----------------------------
Maker Faire Rome - The European Edition
-----------------------------
=> Makers
=> Events and Tour
Loading...