Find Jobs
Hire Freelancers

La Cena de los Filosofos en Arduino.

$140-450 MXN

Completed
Posted about 6 years ago

$140-450 MXN

Paid on delivery
Busco que usando 5 leds RGB mediante Arduino demuestre visualmente el funcionamiento de el problema de la cena de los filosofos, es decir, un color de los RGB para cada estado (pensando, hambriento y comiendo). Algo similar a lo mostrado en este video: [login to view URL] Aqui mismo anexo un codigo de ejemplo: #define MAX 5 Semaphore forks[MAX]; byte ids = 1; byte leds[] = { 5, 6, 7, 8, 9 }; void eating(byte id) { digitalWrite(leds[id], HIGH); Tasks::delay(1 + random(MAX * 100)); digitalWrite(leds[id], LOW); } class Philosopher: public Task { public: void setup() { _id = ids++; } void loop() { forks[_id - 1].wait(); forks[_id].wait(); eating(_id); forks[_id - 1].signal(); forks[_id].signal(); } private: byte _id; }; Philosopher philosophers[MAX-1]; void setup() { randomSeed(analogRead(0)); Tasks::init(); Tasks::set_idle_handler(timer_sleep); for (int i = 0; i forks[i].signal(); pinMode(leds[i], OUTPUT); } for (int i = 0; i Tasks::start(philosophers[i]); } void loop() { forks[0].wait(); forks[MAX-1].wait(); eating(0); forks[0].signal(); forks[MAX-1].signal(); }
Project ID: 16270776

About the project

1 proposal
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hola Sí, puedo manejar este proyecto hermano No dude en ponerse en contacto conmigo I dont know spanish but will try to use google translater.
$370 MXN in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of MEXICO
Mexico
0.0
0
Member since Feb 10, 2018

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.