You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReact,{Component}from'react';import{AppRegistry,StyleSheet,Text,View,TouchableHighlight,DeviceEventEmitter}from'react-native';importOrientationfrom'react-native-orientation';import{Accelerometer}from'NativeModules';varnoble=require('react-native-ble');Accelerometer.setAccelerometerUpdateInterval(5);classarduinoCarextendsComponent{handlePressIn(){Accelerometer.startAccelerometerUpdates();}handlePressOut(){Accelerometer.stopAccelerometerUpdates();}componentWillMount(){noble.on('stateChange',console.log);//noble.on('discover', console.log);}componentDidMount(){Orientation.lockToLandscape();DeviceEventEmitter.addListener('AccelerationData',function(data){console.log('acceleration data ',data.acceleration);});}render(){return(<Viewstyle={styles.container}><TouchableHighlightunderlayColor='#A74040'style={styles.button}onPressIn={this.handlePressIn}onPressOut={this.handlePressOut}><Textstyle={styles.buttonText}>Start</Text></TouchableHighlight></View>);}}AppRegistry.registerComponent('arduinoCar',()=>arduinoCar);
The text was updated successfully, but these errors were encountered:
if i call noble.on('stateChange', console.log); i will get an error
Illegal invocation
Noble.EventEmitter.emit
events.js @77:0
here is full code. could anyone help?
The text was updated successfully, but these errors were encountered: