Making a Remote Controlled Car using Sun SPOT

  
Inside:
Repository
Here remote Sun SPOT will send data to Sun SPOT on car which will drive the IC according to DC IO pins D0 - D3. The IC will drive the Motors which will run the car. package org. sunspotworld. demo; import com. sun. spot. io. j2me. radiogram. Radiogram; import com. sun. spot. io. j2me. radiogram. RadiogramConnection; import com. sun. spot. peripheral. NoRouteExcepti
Making a Remote Controlled Car using Sun SPOT - schematic

on; import com. sun. spot. peripheral. Spot; import com. sun. spot. peripheral. radio. IRadioPolicyManager; import com. sun. spot. sensorboard. EDemoBoard; import com. sun. spot. sensorboard. peripheral. ITriColorLED; import com. sun. spot. sensorboard. peripheral. IAccelerometer3D; import java. io. IOException; import javax. microedition. midlet. MIDletStateChangeException; import com. sun. spot. util. IEEEAddress; import com. sun. spot. util. Utils; import javax. microedition. io. Connector; /** * Remote Spot will send Tilt values to the Car Spot. * * @author Jay Mahadeokar */ public class StartApp extends javax. microedition. midlet. MIDlet { EDemoBoard demoboard = EDemoBoard. getInstance(); protected void startApp() throws MIDletStateChangeException { IRadioPolicyManager rpm = Spot. getInstance(). getRadioPolicyManager(); IEEEAddress myAddr = new IEEEAddress(rpm. getIEEEAddress(); System. out. println("Hi! my address = " + myAddr. asDottedHex(); //This is my Car Sun SPOT address IEEEAddress bsAddress = new IEEEAddress(new String("0014. 4F01. 0000. 1231"); IAccelerometer3D acc = demoboard. getAccelerometer(); while(true) { try{ RadiogramConnection conn = (RadiogramConnection)Connector. open("radiogram://0014. 4F01. 0000. 1A29:10"); Radiogram rdg = (Radiogram)conn. newDatagram(conn. getMaximumLength(); try { //Get control called and value sent to car spot! rdg. writeUTF(""+getControl(); conn. send(rdg); Utils. sleep(200);...



Leave Comment

characters left:

New Circuits

.