ryansuchocki / microscheme

A Scheme subset for Atmel microcontrollers.

Home Page:http://ryansuchocki.github.io/microscheme/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot set pin 1 low

technomancy opened this issue · comments

(define pins (list 0 1 2 3))

(for-each output pins)
(for-each low pins)

Using a multimeter tells me that pin 1 remains high.

This is on an astar micro, which is the same chip as the leonardo. This led me to speculate that perhaps the arduino-ports or arduino-pins mapping in stdlib.ms was incorrect. However, if I load this program onto an Uno, I get both 0 and 1 remaining high.

I think this is due to interference from the UART. (i,e. tx/rx on pins 0/1)

On latest master, I've moved the UART initialisation to an explicit primitive (serial-init). The pins should be fine if that primitive isn't called.

Does this fix it?

Aha; that would make sense. Just tested and confirmed this fixes the problem on both my Uno and my A-Star. Thanks!'