-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpico_lib.cpp
33 lines (25 loc) · 976 Bytes
/
pico_lib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/timer.h"
#include "fsm_state_manager.hpp"
#include "i2c_slave.hpp"
#include "communication_handler.hpp"
int64_t alarm_callback(alarm_id_t id, void *user_data) {
// Put your timeout handler code in here
return 0;
}
int main()
{
auto stateManager = StateMachine::RobotArm::FSMStateManager::getInstance();
stateManager->handleEvent(StateMachine::RobotArm::Event::Done);
Communication::Hardware::I2CSlave::init(&Communication::RobotArm::rxCallback,
&Communication::RobotArm::txCallback, 55, true);
stdio_init_all();
// Timer example code - This example fires off the callback after 2000ms
add_alarm_in_ms(2000, alarm_callback, NULL, false);
// For more examples of timer use see https://github.com/raspberrypi/pico-examples/tree/master/timer
while (true) {
printf("Hello, world!\n");
sleep_ms(1000);
}
}