Code for a robotic pet to interact with.

Dependencies:   mbed wave_player Servo Motordriver mbed-rtos 4DGL-uLCD-SE SDFileSystem_OldbutworkswithRTOS HC_SR04_Ultrasonic_Library

main.cpp

Committer:
jprocter3
Date:
2019-04-16
Revision:
0:7b070cdce8bd
Child:
1:a2a5171ac99f
Child:
2:672f7335a017

File content as of revision 0:7b070cdce8bd:

#include "mbed.h"
#include "rtos.h"
#include "uLCD_4DGL.h"
uLCD_4DGL uLCD(p28,p27,p29); // serial tx, serial rx, reset pin;
DigitalOut speaker(p18);

DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);

volatile unsigned int state;
volatile unsigned int energy;
volatile unsigned int touched;
volatile unsigned int fed;

void sonar(void const *argument) {
    
}

void touchpad(void const *argument) {
    
}

void screen(void const *argument) {
    
}

void sound(void const *argument) {
    
}

void wheels(void const *argument) {
    
}

int main() {
    uLCD.cls();
    uLCD.printf("Change baudrate.....");
    uLCD.baudrate(3000000); //jack up baud rate to max
    uLCD.background_color(BLACK);
    uLCD.cls();

    Thread thread1(sonar);
    Thread thread2(touchpad);
    Thread thread3(screen);
    Thread thread4(sound);
    Thread thread5(wheels);
    
    while(1) {
        
    }
}