arduino-copilot-1.2.0: Arduino programming in haskell using the Copilot stream DSL

Safe HaskellNone
LanguageHaskell98

Copilot.Arduino.Library.Serial.Device

Description

This module be used to create a new module targeting a specific serial device. See CoPilot.Arduino.Library.Serial and CoPilot.Arduino.Library.Serial.XBee for examples.

Synopsis

Documentation

data Base Source #

Constructors

BIN 
OCT 
DEC 
HEX 
Instances
Show Base Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

Methods

showsPrec :: Int -> Base -> ShowS #

show :: Base -> String #

showList :: [Base] -> ShowS #

Integral t => FormatableType (t :: Type) Base Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

Methods

formatter :: Proxy t -> Base -> String Source #

class FormatableType t f where Source #

Methods

formatter :: Proxy t -> f -> String Source #

class ShowableType t where Source #

Methods

showCType :: Proxy t -> String Source #

Instances
ShowableType Bool Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Double Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Float Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Int8 Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Int16 Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Int32 Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Int64 Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Word8 Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Word16 Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Word32 Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

ShowableType Word64 Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

newtype Baud Source #

Constructors

Baud Int 
Instances
Eq Baud Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

Methods

(==) :: Baud -> Baud -> Bool #

(/=) :: Baud -> Baud -> Bool #

Show Baud Source # 
Instance details

Defined in Copilot.Arduino.Library.Serial.Device

Methods

showsPrec :: Int -> Baud -> ShowS #

show :: Baud -> String #

showList :: [Baud] -> ShowS #

outputD Source #

Arguments

:: SerialDeviceName 
-> Stream Bool

This Stream controls when output is sent to the serial port.

-> [FormatOutput] 
-> Sketch () 

char :: Char -> FormatOutput Source #

Use this to output a Char

str :: String -> FormatOutput Source #

Use this to output a String

show :: forall t. (ShowableType t, Typed t) => Stream t -> FormatOutput Source #

Use this to show the current value of a Stream.

Numbers will be formatted in decimal. Bool is displayed as 0 and 1.

byte :: Stream Int8 -> FormatOutput Source #

Write a byte to the serial port.

showFormatted :: forall t f. (ShowableType t, Typed t, FormatableType t f) => Stream t -> f -> FormatOutput Source #

Show the current value of a Stream with control over the formatting.

When used with a Float, provide the number of decimal places to show.

Serial.showFormatted (constant (1.234 :: Float)) 2 -- "1.23"

When used with any Integral type, provide the Base to display it in

Serial.showFormatted (constant (78 :: Int8)) Serial.HEX -- "4E"

input'D :: SerialDeviceName -> [Int8] -> Input Int8 Source #

The list is used to simulate serial input when interpreting the program.

noInput :: Int8 Source #

Value that is read from serial port when there is no input available.

type family IsDigitalIOPin t where ... Source #

Equations

IsDigitalIOPin t = True ~ If (HasPinCapability DigitalIO t) True (TypeError (Text "This Pin does not support digital IO"))