Corona remote: problem

Hi,

I have Corona Remote and I am trying to control a ball with it. It does connect, but it does not seem to be working.
Here is my main.lua code:

local physics = require("physics")  
physics.start()  
physics.setGravity(0, 0)  
   
local ball = display.newImage("ball.png")  
ball.x = 100  
ball.y = 100  
physics.addBody(ball, { bounce = 0.4, radius = 30} )  
   
local motionx = 0  
local motiony = 0  
   
local function onAccelerate(event)  
motionx = 15 \* event.xGravity  
motiony = 15 \* event.yGravity  
end  
Runtime:addEventListener("accelerometer", onAccelerate)  
   
local function moveBall(event)  
ball.x = ball.x - motionx  
ball.y = ball.y - motiony  
end  
Runtime:addEventListener("enterFrame", moveBall)  
   
-- Load The Remote  
local remote = require("remote")  
   
-- Start The Remote On Port 8080  
-- "fast" Network Speed ( or "slow" )  
remote.startServer( "8080" , "fast" )  
   
-- Get The Latest Accelerometer Values  
local function updateAccelerometer()  
 xGravity = remote.xGravity  
 yGravity = remote.yGravity  
 zGravity = remote.zGravity  
 xInstant = remote.xInstant  
 yInstant = remote.yInstant  
 zInstant = remote.zInstant  
 isShake = remote.isShake  
 -- Only Use If Compass Activated and running v1.1  
 magnetic = remote.magnetic  
end  
   
-- Add Enter Frame Listener  
Runtime:addEventListener( "enterFrame" , updateAccelerometer )  

Thanks in advance! [import]uid: 15281 topic_id: 5698 reply_id: 305698[/import]

Try moving this:

-- Load The Remote  
local remote = require("remote")  
   
-- Start The Remote On Port 8080  
-- "fast" Network Speed ( or "slow" )  
remote.startServer( "8080" , "fast" )  
   
-- Get The Latest Accelerometer Values  
local function updateAccelerometer()  
 xGravity = remote.xGravity  
 yGravity = remote.yGravity  
 zGravity = remote.zGravity  
 xInstant = remote.xInstant  
 yInstant = remote.yInstant  
 zInstant = remote.zInstant  
 isShake = remote.isShake  
 -- Only Use If Compass Activated and running v1.1  
 magnetic = remote.magnetic  
end  
   
-- Add Enter Frame Listener  
Runtime:addEventListener( "enterFrame" , updateAccelerometer )  

to before everything else in your code. Maybe just maybe, it’ll work [import]uid: 30185 topic_id: 5698 reply_id: 19540[/import]

Ive answered the other post here http://developer.anscamobile.com/forum/2011/01/29/corona-remote-problem [import]uid: 5354 topic_id: 5698 reply_id: 20421[/import]