Skip to content

Commit

Permalink
Blinking was moved to the Idris side.
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden committed May 12, 2020
1 parent a090364 commit 8fedf28
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
6 changes: 5 additions & 1 deletion Blink.idr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ delay : Int -> IO ()
delay ms = foreign FFI_C "idrard_delay" (Int -> IO ()) ms

blink : Int -> Int -> IO ()
blink pin ms = foreign FFI_C "idrard_blink" (Int -> Int -> IO ()) pin ms
blink pin t = do digitalWrite pin 1
delay t
digitalWrite pin 0
delay t
blink pin t

main : IO ()
main =
Expand Down
11 changes: 0 additions & 11 deletions idris_arduino.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,3 @@ void idrard_pinMode(int pin, int mode)
void idrard_delay(int ms) {
delay(ms);
}

void idrard_blink(int pin, int ms) {
// pinMode(pin, OUTPUT);
while(1) {
digitalWrite(pin, 1);
delay(ms);
digitalWrite(pin, 0);
delay(ms);
}
}

1 change: 0 additions & 1 deletion idris_arduino.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
void idrard_digitalWrite(int pin, int val);
void idrard_pinMode(int pin, int mode);
void idrard_delay(int ms);
void idrard_blink(int pin, int ms);

0 comments on commit 8fedf28

Please sign in to comment.