Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of frdm_Grove_Relay_Example by
Simply Import this Program into your mbed compiler
Select Compile to generate the binary file
Plug the Grove Shield v2 on the top of your FRDM-K64F
Connect on end of the 4-pin Grove cable to the Relay module and the other end to the port D6 of the Grove Adapter.
Drag n drop the frdm_Grove_Relay_Example_K64F.bin into the mbed drive from your file explorer
Wait for download to complete
Press the Reset/SW1 button of your FRDM-K64F board to launch the program
The relay should now switch On and Off each time you press the SW2 button of your FRDM-K64F (see picture below)!!

Revision 0:3b9b4fce896e, committed 2016-01-01
- Comitter:
- GregC
- Date:
- Fri Jan 01 16:33:29 2016 +0000
- Commit message:
- Freedom Seeed Grove Relay Example
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Jan 01 16:33:29 2016 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+DigitalOut relay(D6);
+InterruptIn sw2(SW2);
+
+void sw2_release(void)
+{
+ relay = !relay;
+}
+
+int main()
+{
+ sw2.rise(&sw2_release);
+ while (true) {
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jan 01 16:33:29 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file
