Here are our cars. It took long to get a result, especially communication between phone and car was tough. One team didn't succeed in presenting their car. One pupil is supposed to work on it at home during summer.
City car
Based on Arduino and two motors and app coded in our school.
FormulaE.zip
(Unzip this file, save it in your Android smartphone and install it to get the application).
Elite drivers
Based on Lego Mindstorm NXT and piloted with NXT Remote Control app.
International Motor Company Car
Based on raspberry pi and two motors. Still under programming.
Team over wheels
Based on Arduino, two motors, 4 wheels and app coded in our school.
FormulaE.zip
(Unzip this file, save it in your Android smartphone and install it to get the application).
Here is the Arduino code in this car :
FormulaEArduino.zip
/*
* Bluetooth Arduino Car for Formula E
* This program lets you control motors thanks to DFRobot arduino motor shield using a bluetooth module
*/
char Incoming_value = 0; //Variable for storing Incoming_value
int dirA = 4;
int pwrA = 5;
int dirB = 7;
int pwrB = 6;
void setup()
{
//Setup Motor A
pinMode(dirA, OUTPUT); //Initiates Direction Motor A pin
pinMode(pwrA, OUTPUT); //Initiates Power Motor A pin
//Setup Motor B
pinMode(dirB, OUTPUT); //Initiates Direction Motor B pin
pinMode(pwrB, OUTPUT); //Initiates Power Motor B pin
Serial.begin(9600); //Sets the data rate in bits per second (baud) for serial data transmission
}
void loop()
{
if(Serial.available() > 0)
{
Incoming_value = Serial.read(); //Read the incoming data and store it into variable Incoming_value
switch (Incoming_value) {
case '0': // STOP when 0 is received
analogWrite(pwrA, 0); // power to 0
analogWrite(pwrB, 0); // power to 0
digitalWrite(dirA, LOW); // reverse direction
digitalWrite(dirB, LOW); // reverse direction
break;
case '1': // FORWARD when 1 is received
analogWrite(pwrA, 255); // power to maximum
analogWrite(pwrB, 222); // power to maximum (222 to get equal speeds for both motors)
digitalWrite(dirA, HIGH); // normal direction
digitalWrite(dirB, HIGH); // normal direction
break;
case '2': // LEFT when 2 is received
analogWrite(pwrA, 255); // power to maximum
analogWrite(pwrB, 222); // power to maximum (222 to get equal speeds for both motors)
digitalWrite(dirA, HIGH); // normal direction
digitalWrite(dirB, LOW); // reverse direction
break;
case '3': // RIGHT when 3 is received
analogWrite(pwrA, 255); // power to maximum
analogWrite(pwrB, 222); // power to maximum (222 to get equal speeds for both motors)
digitalWrite(dirA, LOW); // reverse direction
digitalWrite(dirB, HIGH); // normal direction
break;
case '4': // BACKWARDS when 4 is received
analogWrite(pwrA, 255); // power to maximum
analogWrite(pwrB, 222); // power to maximum (222 to get equal speeds for both motors)
digitalWrite(dirA, LOW); // reverse direction
digitalWrite(dirB, LOW); // reverse direction
break;
}
}
}