With this skill, kids can ask Amazon Alexa the current weather. The result will display on BBC micro:bit LEDs. This is a sample that connects Amazon Alexa and BBC micro:bit.
Application Id: amzn1.ask.skill.3d69813d-d47b-4cf7-8e79-af25b589b8f6 Step 1 : Make Amazon Alexa Skill (Amazon Alexa herself. )
- Select Skill Type:
Custom Interaction Model , and input
Invocation Name , Click
- Input AWS Lambda ARN (See Step 2 : Make AWS Lambda), click
Step 2 : Make AWS Lambda (amazon Alexa's logic.)
- Then you can test the skill, if you finish
Publishing Information and
Privacy & Compliance, you can
submit for Certification .
Alexa Skills Kit, and click
Name, and copy the lambda source to the source area, and input the other fields, click
- In the next screen, click
Step 3: Get weather information
- Then you will see ARN, fill the arn to Step 1's arn field.
Step 4 : Send weather information to Android Device
- Go to http://openweathermap.org, and sign up a account, and you can find API key at your member page. Replace your app id by the key.
Application name, select
Push notification platform to
Google Cloud Messaging(GCM), input
API key (You can get this key from firebase. See Step 5 : build for Android Device), click
Create platform application
- Now you can find the ARN, replace android source by this arn (if necessary, modify Region field to your region).
Topic name and
Display name, then click
- You can find topic ARN, and replace lambda source and android source. (if necessary, modify Region field to your region).
Identity pool name and check
Enable access to unauthenticated identities .click
Create Pool .
- In the next screen click
- You will find the cognito ARN, and replace android source by this arn (if necessary, modify Region field to your region).
- Go to https://console.aws.amazon.com/iam/home?region=us-east-1#/roles , select your cognito role name such as Cognito_xxxxxUnauth_Role.
Step 5 : Build for Android Device
- Add SNS permission such as below picture.
- Go to https://firebase.google.com ,you can
Create new project ,and you can find
Server key on
CLOUD MESSAGING tab. Fill this information to Step 4 : Send weather information to Android Device.
- Create firebase android app ,then download the google-services.json file from your firebase console, replace android source file.
Step 6 : Let micro:bit run!
- Use Android Studio import downloaded project, modify the arn information and firebase information, build app to android device.
- Go to https://pxt.microbit.org, add Bluetooth support, then click
- When you back to
Blocks, you will see like below picture.
- Transfer this program to micro:bit. and DONE!