I am trying to upload the below code .my question is how can I check memory related to above ic
I am looking low cost Atmel ic.where I can upload below program
Atmel ic price must me around 20 to 40Rs.
It must be compatible with arduino ide
Allow me to program using avr programmer.
int Sound = 1;
int i;
int SW1 = 2;
int SW2 = 3;
void Police_Alarm()
{
for (i = 440; i < 1000; i++)
{
tone(Sound, i, 50);
delay(5);
}
for (i = 1000; i > 440; i--)
{
tone(Sound, i, 50);
delay(5);
}
}
void Fire_Alarm()
{
tone(Sound, 800, 800);
delay(200);
tone(Sound, 600, 800);
delay(200);
}
void setup() {
// put your setup code here, to run once:
pinMode(SW1, INPUT);
pinMode(SW2, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if ((SW1 == 1) && (SW2 == 1))
{
Police_Alarm();
}
if ((SW1 == 0) && (SW2 == 0))
{
Fire_Alarm();
}
}
SW1 and SW2 are the pin numbers not the pin states.
void loop() {
// put your main code here, to run repeatedly:
if ((SW1 == 1) && (SW2 == 1))
{
Police_Alarm();
}
if ((SW1 == 0) && (SW2 == 0))
{
Fire_Alarm();
}
}
IS there any MCU with 8PIN IC which support Arduino IDE for Programming
int Sound = 13;
int i;
int SW1 = 3;
int SW2 = 4;
void Police_Alarm()
{
for (i = 440; i < 1000; i++)
{
tone(Sound, i, 50);
delay(5);
}
for (i = 1000; i > 440; i--)
{
tone(Sound, i, 50);
delay(5);
}
}
void Fire_Alarm()
{
tone(Sound, 800, 800);
delay(200);
tone(Sound, 600, 800);
delay(200);
}
void setup() {
// put your setup code here, to run once:
pinMode(SW1, INPUT);
pinMode(SW2, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(SW1) == 1)
{
if (digitalRead(SW2) == 1)
{
Police_Alarm();
}
}
if (digitalRead(SW1) == 0)
{
if (digitalRead(SW2) == 0)
{
Fire_Alarm();
}
}
}