Recent Posts

Pages: [1] 2 3 ... 10
1
Français / Re: Projet de boite à dons/tir...
Last post by hbachetti - Today at 09:06 am
Salut

Je pense que ton projet ressemble fort à un automate.
Pour chaque action à réaliser il faut que tu te poses la question : quelle est l'événement qui la déclenche. Ensuite chaque action réalisée fait basculer ton automate dans un état. Cet état dans ton cas peut être carrément l'endroit où la pièce se trouve.
Le premier état s'appelle IDLE en anglais ou REPOS. Les autres états s'appelleront TAPIS, RAMPE, etc.
Exemple :

Etat IDLE        ->        événement "pièce introduite"        ->        action "start"        ->        état "STARTED"

L'action start met en route le buzzer, la lumière et le tapis roulant.
A ce moment là on voit déjà que ta description manque de précision : quand arrête t-on tout ça ?
- quand la pièce entre dans la chambre 1 ou 2 ?

La majeure partie du temps, quand le problème est simple, on peut l'écrire avec un switch / case :

EXEMPLE

Sinon, avec "Finite State Machine arduino" sous google tu trouveras certainement une implémentation qui te conviendra.

@+

2
Programming Questions / Re: Errors when combining I2C ...
Last post by pert - Today at 09:02 am
Save it in a text file and attach it to a reply. The forum doesn't show the "Attachments and other options" link when you are using Quick Reply so you actually need to click the "Reply" button.
3
I'm not sure I understand.

The power supply of the DM2282 is connected and has a GND, but doesn't the Arduino need a separate GND connection as well?

At the moment no pin is connected to the GND pin so how does the LOW signal do that? Maybe you know the electronic explanation for this...? Are the 9 and 8 pins connected to GND somehow on the Arduino chip?



Thanks
4
Software / Non capisco if else
Last post by SangueVivo - Today at 09:00 am
Buongiorno a tutti,
non riesco a capire come funzionano le istruzioni if else. In teoria ci sono ma poi scrivo uno sketch semplice semplice e mi confondo:

Code: [Select]
int i=0;
void setup() {
 
Serial.begin(9600);

}

void loop() {
 
  Serial.print ("i = ");
  Serial.println(i);
  delay(500);

if (i=0){
  Serial.println("start");
  delay(2000);
}
else {
  Serial.println("stop");
  delay(2000);
}
}


perchè il monitor seriale mi restituisce "stop" anche se io ho detto se i=0 scrivi start?
5
Thank you for the help!  I think I got the code right, but I couldn't paste the error, it exceeded the max length for a post.  Any suggestions?

Jake
6
i am using arduino board . i pick the correct board and port. When i doing the blink example , it comes with these error.

Sketch uses 13460 bytes (41%) of program storage space. Maximum is 32256 bytes.
Global variables use 1095 bytes (53%) of dynamic memory, leaving 953 bytes for local variables. Maximum is 2048 bytes.
An error occurred while uploading the sketch
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x20
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x6f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x6f
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
7
I probably misunderstood, sorry. You will probably be looking at structs and / or classes.
8
Project Guidance / Re: 200 vs 400 step motors
Last post by PaulRB - Today at 08:53 am
You won't need the GPS if you have WiFi. With WiFi you can just get the time from an NTP server.

If you are going to get WiFi, get an "Arduino" with WiFi built-in, rather than needing separate Arduino and WiFi shield. As I suggested before, my recommendation would be to get a Wemos Mini. Very easy to use, very cheap, and the Wemos has way more speed and memory than an Uno, so you are less likely to run out of resources while developing your code. But the Wemos does have fewer pins. If you choose your components carefully, that probably won't be an issue. If it is, its as easy to add more pins to a Wemos as it is to add WiFi to an Uno, and the result is better overall.
9
Programming Questions / Re: switch between 2 loops
Last post by UKHeliBob - Today at 08:52 am
OK.  Maybe blink the LED at full brightness for a number of times at the start of each function, different for each function, to prove that they are being called.
10
You can disable auto reset by connecting a 10 uF capacitor between reset and ground.

You can also cut the "reset-en" jumper on your board.

Note that if auto-reset is disabled when you upload you will need to manually reset the microcontroller.

As for doing it in software, it seems like it should be possible but I've never tried it.
Pages: [1] 2 3 ... 10