18. 1Sheeld telephone

Mål: Att kunna ringa ett visst nummer med mobiltelefonen om en knapp trycks in.

Koppling: En tryck-knapp eller en mikrobrytare kopplad direkt till GND och pin12 på Arduinon. Observera en “internal pullup-resistor” i koden.


Fritzing kopplingsschema

1Sheeld telephone


Arduino koden

#define CUSTOM_SETTINGS
#define INCLUDE_PHONE_SHIELD
#include <OneSheeld.h>

int buttonPin = 12;

void setup() 
{
  OneSheeld.begin();
  pinMode(buttonPin,INPUT_PULLUP);
}

void loop()
{
  if(digitalRead(buttonPin) == LOW)
  {
      Phone.call("040*******");
      OneSheeld.delay(300);
  }
}

 


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s