-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.h
59 lines (50 loc) · 2.58 KB
/
functions.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "learnpi.h"
#define PI_BAD_GPIO -3 // GPIO not 0-53
#define NO_KEY_PRESSED "NO_KEY_IS_PRESSED"
int yylineno;
int yyparse();
void yyerror(char *s, ...);
int get_value_type(struct val *value);
struct val *print_type(struct val *value);
struct val *square_root(struct val *value);
struct val *create_LED(struct val **pin);
struct val *create_COMPLEXTYPE(struct val **pin, int pin_no, int datatype);
struct val *create_BUTTON(struct val **pin);
struct val *create_KEYPAD(struct val ** pin);
struct val *create_BUZZER(struct val ** pin);
struct val *create_SERVO_MOTOR(struct val ** pin);
struct val *sum(struct val *first, struct val *second);
struct val *subtract(struct val *first, struct val *second);
struct val *multiply(struct val *first, struct val *second);
struct val *divide(struct val *first, struct val *second);
struct val *get_absolute_value(struct val *value);
struct val *change_sign(struct val *value);
struct val *calculate_logical_and(struct val *first, struct val *second);
struct val *calculate_logical_or(struct val *first, struct val *second);
struct val *calculate_greater_than(struct val *first, struct val *second);
struct val *calculate_less_than(struct val *first, struct val *second);
struct val *calculate_equals(struct val *first, struct val *second);
struct val *calculate_not_equals(struct val *first, struct val *second);
struct val *calculate_greater_equal_than(struct val *first, struct val *second);
struct val *calculate_less_equal_than(struct val *first, struct val *second);
struct val *create_bit_value(int bit_value);
struct val *create_integer_value(int integer_value);
struct val *create_decimal_value(double decimal_value);
struct val *create_string_value(char *string_value);
struct val *create_led_value(struct val ** pin, int is_declaration);
struct val *create_button_value(struct val ** pin, int is_declaration);
struct val *create_keypad_value(struct val ** pin, int is_declaration);
struct val *create_buzzer_value(struct val ** pin, int is_declaration);
struct val *create_servo_motor_value(struct val ** pin, int is_declaration);
struct val *create_complex_value(struct val ** pin, int number_of_pins, int datatype);
int led_on(struct val * value);
int led_off(struct val * value);
struct val *is_button_pressed(struct val * value);
struct val *get_pressed_key(struct val * value);
char read_last_pressed_key(struct val * value);
int buzz_start(struct val * value);
int buzz_stop(struct val * value);
int move_servo_to_angle(struct val * value, int angle);
int move_servo_infinitely(struct val * value);
int servo_stop(struct val * value);
void delay_pi();