- BBMagic FLOOD module with battery
- Raspberry Pi zero W or Raspberry Pi 3 (both have Bluetooth Low Energy) with operating system installed
Installing gcc compiler
To install gcc log in to the system and type:sudo apt-get install gcc
Get example project file
Download example ‘bbmagic_flood_sketch’ from Download page.
…or in text mode: wget http://bbmagic.net/download/src/bbmagic_flood_sketch.tar.gz
Unpack project file tar.gz:tar -zxvf bbmagic_flood_sketch.tar.gz
and go to the project folder:cd bbmagic_flood_sketch
Compile the project
To compile type: make
Run program
Dont forget to power up the BBMagic FLOOD sensor
Make sure executable file has proper permissions and if not change them:chmod 755 bbmagic_flood_sketch
…and run application:sudo ./bbmagic_flood_sketch
After a while put BBMagic FLOOD sensor’s electrodes to the water
…and watch the screen… you get flood alert 🙂
Ctrl+C ends our little program.
Awsome job !! Congratulations !!
If you want LED indicates bluetooth transmission connect it like this (two possibilities)