Using Arduino / General Electronics / cant communitcate with the arduino
on: April 29, 2012, 03:13:59 am
im learning to design a pcb for my first project and put a arduino chip in instead of using the board, but im havint trouble communicating to the chip, i have my USB to TTL Converter installed with the correct driver but i cant seem to communicate or download anything to the chip. i am connedted on a serial port but just the usb to ttl converter.
im using the ATMEGA328 ARDUINO chip i have it all set up as it should be ive read a couple of guides, but on the com port all i can see id the usb to ttl converter, not the arduino chip, i have the +5, gnd, txd, rxd, from the port connected to the chip but no urduino?
i have a complete uno board also, but when i place the ic into the board it also doesnt recognise the chip as well?
any help greatly appreciated
ok found out i need to burn the bootloader on the ic, ive found the guide here and tryed several times using an uno board connected to breadboard followed the instructions, but cant seem to burn the bootloader, keep on getting an error does this guide actualy work, are there another guides out there that may work?
Using Arduino / Programming Questions / Re: help with boolean
on: April 24, 2012, 05:22:39 am
my alarm is here, is a high output that switches on a buzzer circuit.
digitalWrite(Buz, HIGH); // Alarm on
my mute switch is here, a low in to mute the alarm.
int Mute = A2; // mute switch input
to be honest i really dont know how to act upon the input (mute)
(pinMode(Mute, OUTPUT); // Set the switch pin as 1p.) sorry corrected should be INPUT
Using Arduino / Programming Questions / help adding a mute button and delay
on: April 24, 2012, 05:08:57 am
* 2 switches monitoring two fans, healthly if both fan1 and fan2 switches are low output switches a relay, if any input high an alarm sounds no output to relay.
//int muteoutput = 2; // mute buzzer (removes the low in the buz circuit to mute) XXXXX
int Buz = 10; // buzzer sounds if fault
int Mute = A2; // mut switch input
int Service = 9; // service switch
int Supfanled = 4; // supply fan led
int Extfanled = 5; // ext fan led.
int Esled = 8; // emergency stop switch led
int Relay = 3; // green led lights if fan1 and fan2 are low connected to pin 9. healthey fan1 and fan2
int Gasled = 12; // led to indicate gas is on.
int Fanfault = 6; // red led lights if fan 1 or fan2 are high connected to pin 8. (sounds an alarm)
int Es = A3; // emergency stop switch input.
int Fan2 = A5; // fan switch is connected to pin 3
int Fan1 = A4; // fan switch is connected to pin 2
int Fan1val; // var for reading the pin status
int Fan2val; // var for reading the pin status
int Esval; // val for reading emergency stop status
int Srviceval; // val for service status.
boolean running = false; // *****
pinMode(Service, INPUT); // service switch on just gas operates nothing else
digitalWrite(Service, HIGH); //turn on pulup r
pinMode(Supfanled, OUTPUT); // supply fan led o/p
pinMode(Extfanled, OUTPUT); // extfan led o/p
pinMode(Gasled, OUTPUT); // Greenlled as op.
pinMode(Fanfault, OUTPUT); // redled as op.
pinMode(Fan1, INPUT); // Set the switch pin as ip.
digitalWrite(Fan1, HIGH); // turn on internal r
pinMode(Fan2, INPUT); // Set the switch pin as ip.
digitalWrite(Fan2, HIGH); // turn on internal r
pinMode(Relay, OUTPUT); // Set the switch pin as op.
pinMode(Buz, OUTPUT); // Set the switch pin as op.
pinMode(Mute, OUTPUT); // Set the switch pin as 1p.
pinMode(Es, INPUT); // Set the switch pin as 1p. *****
digitalWrite(Es, HIGH); // turn on pullup r
pinMode(Esled, OUTPUT); // Set the switch pin as 1p
pinMode(Mute, INPUT); // set the switch pin as ip
digitalWrite(Mute, HIGH); // turn on pullup resistor
Fan1val = digitalRead(Fan1); // read input value and store it in fan1
Fan2val = digitalRead(Fan2); // read input value and store it in fan2
Esval = digitalRead(Es); // read estop value and store value
if ((Fan1val == LOW) && (Fan2val == LOW) && (Esval == LOW))
delay (1000); // check if both inputs show fan OK (Switch is pressed)
digitalWrite(Gasled, HIGH); // turn green led on.
digitalWrite(Relay, HIGH); // turn on gas relay.
digitalWrite(Buz,LOW); // buzzer off, no error
digitalWrite(Fanfault,LOW); // red led off no fault
digitalWrite(Gasled, LOW); // turn green OFF
digitalWrite(Relay, LOW); // turn off relay **** Turn off Relay if fault has been greater than 30 seconds*****
digitalWrite(Fanfault, HIGH); // red led on
digitalWrite(Buz, HIGH); // Alarm on ****want to toggle this on/off only when fault, with the mute button *******
digitalWrite(Supfanled, Fan1val); //fan1 status led
digitalWrite(Extfanled, Fan2val); //fan2 status led
digitalWrite(Esled, Esval); //estop status
im really struggling with my program and im stuck, all i need to finish my project is to add a mute to my alarm, and a 30 sec delay to my relay.
finding it really difficuly to understand mills() to add a delay and boolean to make a mute button, hope someone could help me maby if i see the code it will help understand how these work and help me go faward
Using Arduino / Programming Questions / Re: help with boolean
on: April 22, 2012, 10:06:55 am
// input and alatm circuit, if any inputs are on for more > 30 seconds alarm sounds, mute button to turn off alarm.
int InputA = 2; // input a
int InputB = 3; // input b
int Mute = 4; // mute button, low input
int Led = 5; // LED on pin 3
int Alarm = 6; // alarm sounds
int ABgood = 7; // healthy a and b inputs made.
int ABfail = 8; // FAIL a or b failed.
int InputAval; // val for reading input a
int InputBval; // val for reading input b
boolean running = false;
pinMode(InputA, INPUT); //input a input
digitalWrite(InputA, HIGH); //turn on pullup r
pinMode(InputB, INPUT); //input b input
digitalWrite(InputB, HIGH); //turn on pullup r
pinMode(Mute, INPUT); //mute push switch input
digitalWrite(Mute, HIGH); //turn on pull up r
pinMode(Led, OUTPUT); //led to show
pinMode(Alarm, OUTPUT); //alarm circuit.
pinMode(ABgood, OUTPUT); //lights up green led for healthy status.
pinMode(ABfail, OUTPUT); } //lights up red led for a fail.
InputAval = digitalRead(InputA); // read input value and store it in fan1
InputBval = digitalRead(InputB); // read input value and store it in fan2
if ((InputAval == LOW) && (InputBval == LOW))
digitalWrite(ABgood, HIGH); // a and b inputs are healthy.
digitalWrite(Alarm, LOW); // no alarm
digitalWrite(ABfail, LOW); // no fail led lit
digitalWrite(Alarm, HIGH); // Alarm sounds ****want to MUTE/toggle this output****
digitalWrite(ABfail, HIGH);} // fail led lit.
if (digitalRead(Mute) == LOW) // switch is pressed - pullup keeps pin high normally
delay(100); // delay to debounce switch
running = !running; // toggle running variable
digitalWrite(Alarm, running); } // indicate via LED
yes paul i see what you mean, looks more logical will take on board your advice thank you