ModmataC  1.0
A C library for Arduino communication
servo.c
#include "ModmataC.h"
int main() {
// start serial connection with arduino, given a port and baud rate
connectArduino("/dev/ttyACM0", 115200, 1);
delay(1000);
for(int i = 0; i <= 180; i++) {
servoWrite(6, i);
delay(15);
}
for(int i = 180; i >= 0; i--) {
servoWrite(6, i);
delay(15);
}
}
int connectArduino(char *port, int baudRate, int id)
Definition: ModmataC.c:93
void servoWrite(uint16_t pinNum, uint16_t input)
Definition: ModmataC.c:264
void closeConnection()
Definition: ModmataC.c:51
void servoDetach(uint16_t pinNum)
Definition: ModmataC.c:250
void servoAttach(uint16_t pinNum)
Definition: ModmataC.c:237
void delay(int millis)
Definition: ModmataC.c:56