Arduino Bluetooth score counter

I have followed a tutorial controlling an Arduino uno via the hm-10 Bluetooth module from an android phone, I then changed the uuid to the one for my module. However, when I run the app on evothings, the connect button does not seem to do anything. can anyone guide me towards what I may be doing wrong ?

https://evothings.com/control-an-led-using-hm-10-ble-module-an-arduino-and-a-mobile-app/

have you ensured you have the right module?

I have the Lanmu Hm-10 which I'm pretty sure is a clone, so I don't know how that affects it

clare:
can anyone guide me towards what I may be doing wrong ?

Please post your program so we can see what you are trying.

And when posting code please use the code button </>so your code looks like thisand is easy to copy to a text editor See How to use the Forum

…R

code]<!DOCTYPE html>
<!DOCTYPE html>

<html>

<!--

This is an app that demonstrates how to control an Arduio board

using BLE (Bluetooth Low Energy).

Please note that you must use a HM-10 compatible module for this example to work.

-->

<head>



	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, user-scalable=no,

		shrink-to-fit=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />



	<title>HM-10 and Arduino LED On/Off BLE</title>



	<style>

		@import 'ui/css/evothings-app.css';

	</style>



	<script>

	// Redirect console.log to Evothings Workbench.

	if (window.hyper && window.hyper.log) { console.log = hyper.log }

	window.onerror = function(msg, url, line)

	{

		console.log(msg + ": " + url + ":" + line);

	};

	</script>



	<script src="cordova.js"></script>

	<script src="libs/jquery/jquery.js"></script>

	<script src="libs/evothings/evothings.js"></script>

	<script src="libs/evothings/ui/ui.js"></script>

	<script src="libs/evothings/arduinoble/arduinoble.js"></script>



</head>



<body ontouchstart=""><!-- ontouchstart="" enables low-delay CSS transitions. -->



	<header>

		<button class="back" onclick="history.back()">

			<img src="ui/images/arrow-left.svg" />

		</button>



		<img class="logotype" src="ui/images/logo.svg" alt="Evothings" />



		<!--<button class="menu" onclick=""><img src="ui/images/menu.svg" /></button>-->

	</header>



	<h1>HM-10 and Arduino LED On/Off BLE</h1>



	<p id="info">Initializing...</p>



	<button class="yellow wide" onclick="app.connect()">CONNECT</button>



	




	<button class="green wide big" onclick="app.ledOn()">LED ON</button>



	




	<button class="red wide big" onclick="app.ledOff()">LED OFF</button>



	<script>

	// Application object.

	var app = {}



	// Connected device.

	app.device = null;



	// Turn on LED.

	app.ledOn = function()

	{

		app.device && app.device.writeDataArray(new Uint8Array([1]), '0000ffe0-0000-1000-8000-00805f9b34fb');

	}



	// Turn off LED.

	app.ledOff = function()

	{

		app.device && app.device.writeDataArray(new Uint8Array([0]), '0000ffe0-0000-1000-8000-00805f9b34fb');

	}



	app.showMessage = function(info)

	{

		document.getElementById('info').innerHTML = info

	};



	// Called when BLE and other native functions are available.

	app.onDeviceReady = function()

	{

		app.showMessage('Touch the connect button to begin.');

	};



	app.connect = function()

	{

		evothings.arduinoble.close();



		evothings.arduinoble.connect(

			'BT05', // Name of the module.

			function(device)

			{

				app.device = device;

				app.showMessage('Connected! Touch buttons to turn LED on/off.');

			},

			function(errorCode)

			{

				app.showMessage('Connect error: ' + errorCode + '.');

			});

	};



	document.addEventListener(

		'deviceready',

		function() { evothings.scriptsLoaded(app.onDeviceReady) },

		false);

	</script>



</body>



</html>

The HTML code in Reply #4 is not the program on your Arduino. Post your Arduino program.

...R

#include <SoftwareSerial.h>

#define LED_PIN 2



SoftwareSerial mySerial(7, 8); // RX, TX  

// Connect HM10      Arduino Uno

//     Pin 1/TXD          Pin 7

//     Pin 2/RXD          Pin 8



void setup() {  

  Serial.begin(9600);

  // If the baudrate of the HM-10 module has been updated,

  // you may need to change 9600 by another value

  // Once you have found the correct baudrate,

  // you can update it using AT+BAUDx command 

  // e.g. AT+BAUD0 for 9600 bauds

  mySerial.begin(9600);

}



void loop() {  

  int c;

  

  if (mySerial.available()) {

    c = mySerial.read();  

    Serial.println("Got input:");

    if (c != 0)

    {

      // Non-zero input means "turn on LED".

      Serial.println("  on");

      digitalWrite(LED_PIN, HIGH);

    }

    else

    {

      // Input value zero means "turn off LED".

      Serial.println("  off");

      digitalWrite(LED_PIN, LOW);

    }  

  }

}

A few words of commentary, or just friendly chat would be nice.

This does not look right

    if (c != 0)
    {
      // Non-zero input means "turn on LED".
      Serial.println("  on");
      digitalWrite(LED_PIN, HIGH);
    }
    else
    {
      // Input value zero means "turn off LED".
      Serial.println("  off");
      digitalWrite(LED_PIN, LOW);
    } 
  }

I wonder if you mean

 if (c != '0')

in other words the character '0' rather than a byte value of 0. I guess it's possible you are sending the byte value of 0 but it seems unlikely. Debugging is much easier if you send data as human readable characters.

...R